Skip to content

Commit cdd9146

Browse files
committed
The trailing semicolon in a plpgsql function definition is now optional.
Per gripe 9/26.
1 parent d435592 commit cdd9146

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/pl/plpgsql/src/gram.y

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* procedural language
55
*
66
* IDENTIFICATION
7-
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.24 2001/07/12 17:42:07 momjian Exp $
7+
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.25 2001/09/26 21:35:28 tgl Exp $
88
*
99
* This software is copyrighted by Jan Wieck - Hamburg.
1010
*
@@ -210,11 +210,11 @@ static PLpgSQL_expr *make_tupret_expr(PLpgSQL_row *row);
210210

211211
%%
212212

213-
pl_function : T_FUNCTION comp_optsect pl_block
213+
pl_function : T_FUNCTION comp_optsect pl_block opt_semi
214214
{
215215
yylval.program = (PLpgSQL_stmt_block *)$3;
216216
}
217-
| T_TRIGGER comp_optsect pl_block
217+
| T_TRIGGER comp_optsect pl_block opt_semi
218218
{
219219
yylval.program = (PLpgSQL_stmt_block *)$3;
220220
}
@@ -234,7 +234,11 @@ comp_option : O_OPTION O_DUMP
234234
}
235235
;
236236

237-
pl_block : decl_sect K_BEGIN lno proc_sect K_END ';'
237+
opt_semi :
238+
| ';'
239+
;
240+
241+
pl_block : decl_sect K_BEGIN lno proc_sect K_END
238242
{
239243
PLpgSQL_stmt_block *new;
240244

@@ -704,7 +708,7 @@ proc_stmts : proc_stmts proc_stmt
704708
}
705709
;
706710

707-
proc_stmt : pl_block
711+
proc_stmt : pl_block ';'
708712
{ $$ = $1; }
709713
| stmt_assign
710714
{ $$ = $1; }

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy