Skip to content

Commit 4b71943

Browse files
committed
Make PROCEDURAL optional in CREATE/DROP LANGUAGE.
1 parent 90c6394 commit 4b71943

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

doc/src/sgml/ref/create_language.sgml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_language.sgml,v 1.12 2000/10/05 19:48:17 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_language.sgml,v 1.13 2000/11/04 21:04:54 momjian Exp $
33
Postgres documentation
44
-->
55

@@ -23,7 +23,7 @@ Postgres documentation
2323
<date>1999-07-20</date>
2424
</refsynopsisdivinfo>
2525
<synopsis>
26-
CREATE [ TRUSTED ] PROCEDURAL LANGUAGE '<replaceable class="parameter">langname</replaceable>'
26+
CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE '<replaceable class="parameter">langname</replaceable>'
2727
HANDLER <replaceable class="parameter">call_handler</replaceable>
2828
LANCOMPILER '<replaceable class="parameter">comment</replaceable>'
2929
</synopsis>

doc/src/sgml/ref/drop_language.sgml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_language.sgml,v 1.7 1999/07/22 15:09:10 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_language.sgml,v 1.8 2000/11/04 21:04:54 momjian Exp $
33
Postgres documentation
44
-->
55

@@ -23,7 +23,7 @@ Postgres documentation
2323
<date>1999-07-20</date>
2424
</refsynopsisdivinfo>
2525
<synopsis>
26-
DROP PROCEDURAL LANGUAGE '<replaceable class="PARAMETER">name</replaceable>'
26+
DROP [ PROCEDURAL ] LANGUAGE '<replaceable class="PARAMETER">name</replaceable>'
2727
</synopsis>
2828

2929
<refsect2 id="R2-SQL-DROPLANGUAGE-1">

src/backend/parser/gram.y

+9-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.202 2000/10/31 10:22:10 petere Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.203 2000/11/04 21:04:55 momjian Exp $
1515
*
1616
* HISTORY
1717
* AUTHOR DATE MAJOR EVENT
@@ -154,7 +154,7 @@ static void doNegateFloat(Value *v);
154154
%type <str> user_valid_clause
155155
%type <list> user_list, user_group_clause, users_in_new_group_clause
156156

157-
%type <boolean> TriggerActionTime, TriggerForSpec, PLangTrusted
157+
%type <boolean> TriggerActionTime, TriggerForSpec, PLangTrusted, opt_procedural
158158

159159
%type <str> OptConstrFromTable
160160

@@ -1654,7 +1654,7 @@ IntegerOnly: Iconst
16541654
*
16551655
*****************************************************************************/
16561656

1657-
CreatePLangStmt: CREATE PLangTrusted PROCEDURAL LANGUAGE Sconst
1657+
CreatePLangStmt: CREATE PLangTrusted opt_procedural LANGUAGE Sconst
16581658
HANDLER def_name LANCOMPILER Sconst
16591659
{
16601660
CreatePLangStmt *n = makeNode(CreatePLangStmt);
@@ -1668,15 +1668,20 @@ CreatePLangStmt: CREATE PLangTrusted PROCEDURAL LANGUAGE Sconst
16681668

16691669
PLangTrusted: TRUSTED { $$ = TRUE; }
16701670
| /*EMPTY*/ { $$ = FALSE; }
1671+
;
16711672

1672-
DropPLangStmt: DROP PROCEDURAL LANGUAGE Sconst
1673+
DropPLangStmt: DROP opt_procedural LANGUAGE Sconst
16731674
{
16741675
DropPLangStmt *n = makeNode(DropPLangStmt);
16751676
n->plname = $4;
16761677
$$ = (Node *)n;
16771678
}
16781679
;
16791680

1681+
opt_procedural: PROCEDURAL { $$ = TRUE; }
1682+
| /*EMPTY*/ { $$ = TRUE; }
1683+
;
1684+
16801685
/*****************************************************************************
16811686
*
16821687
* QUERIES :

src/tools/pgcvslog

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
# cvs log -d '>1999-06-14 00:00:00 GMT' . > log
99
#
1010
# pre and post-branch logs:
11+
# find . -name CVS -type d -exec touch '{}/Entries.Static' \;
1112
# cvs log -d'2000-05-08 00:00:00 GMT<2000-05-29 00:00:00 GMT'
1213
# cvs log -d'>2000-05-29 00:00:00 GMT' -rREL7_0_PATCHES
14+
# find . -name CVS -type d -exec rm '{}/Entries.Static' \;
1315
#
1416

1517
cat "$@" |
@@ -18,7 +20,7 @@ cat "$@" |
1820
# we don't print anything from the -- or == line and the date:
1921

2022
awk '
21-
$0 ~ /^Working file:/ {workingfile = $0}
23+
$0 ~ /^Working file:/ {workingfile = "/" $3}
2224

2325
($0 ~ /^====*$/ || $0 ~ /^----*$/) && skip == "N" \
2426
{
@@ -27,7 +29,7 @@ awk '
2729
{
2830
printf ("%s| %10d|%s\n", datetime, NR, "");
2931
printf ("%s| %10d|%s\n", datetime, NR, "---");
30-
printf ("%s| %10d|%s\n", datetime, NR+1, "");
32+
/* printf ("%s| %10d|%s\n", datetime, NR+1, "");*/
3133
}
3234
}
3335

@@ -46,6 +48,8 @@ awk '
4648
datetime=$2"-"$3
4749
if (workingfile != "" && skip == "N")
4850
{
51+
gsub(";", "", $5);
52+
printf ("%s| %10d| %70s\n", datetime, NR-2, $5);
4953
printf ("%s| %10d|%s\n", datetime, NR-1, workingfile);
5054
printf ("%s| %10d|%s\n", datetime, NR, $0);
5155
printf ("%s| %10d|%s\n", datetime, NR+1, "");
@@ -59,7 +63,7 @@ sort | cut -d'|' -f3 | cat |
5963
# collect duplicate narratives
6064
awk ' BEGIN { slot = 0;}
6165
{
62-
if ($0 ~ /^Working file:/)
66+
if ($0 ~ /^\//)
6367
{
6468
if (slot != oldslot)
6569
same = 0;

0 commit comments

Comments
 (0)