diff --git a/doc/src/sgml/external-projects.sgml b/doc/src/sgml/external-projects.sgml index 8fb3cbf..5100e83 100644 *** a/doc/src/sgml/external-projects.sgml --- b/doc/src/sgml/external-projects.sgml *************** *** 145,151 **** PostgreSQL includes several procedural languages with the base distribution: PL/PgSQL, PL/Tcl, PL/Perl, and PL/Python. --- 145,151 ---- PostgreSQL includes several procedural languages with the base distribution: PL/pgSQL, PL/Tcl, PL/Perl, and PL/Python. diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml index da831a0..d3bf847 100644 *** a/doc/src/sgml/plpgsql.sgml --- b/doc/src/sgml/plpgsql.sgml *************** EXECUTE 'SELECT count(*) FROM ' *** 1139,1155 **** quote_ident ! use in PL/PgSQL quote_literal ! use in PL/PgSQL quote_nullable ! use in PL/PgSQL --- 1139,1155 ---- quote_ident ! use in PL/pgSQL quote_literal ! use in PL/pgSQL quote_nullable ! use in PL/pgSQL *************** RETURN expressionRETURN NEXT and RETURN QUERY RETURN NEXT ! in PL/PgSQL RETURN QUERY ! in PL/PgSQL --- 1492,1502 ---- <command>RETURN NEXT</> and <command>RETURN QUERY</command> RETURN NEXT ! in PL/pgSQL RETURN QUERY ! in PL/pgSQL *************** END LOOP label exceptions ! in PL/PgSQL --- 2220,2226 ---- exceptions ! in PL/pgSQL *************** END LOOP label reporting errors ! in PL/PgSQL --- 2898,2904 ---- reporting errors ! in PL/pgSQL diff --git a/doc/src/sgml/release-7.4.sgml b/doc/src/sgml/release-7.4.sgml index ce1fb03..1886f4d 100644 *** a/doc/src/sgml/release-7.4.sgml --- b/doc/src/sgml/release-7.4.sgml *************** enabled *** 1897,1903 **** files during postmaster startup Various memory leakage fixes Various portability improvements ! Fix PL/PgSQL to handle var := var correctly when the variable is of pass-by-reference type Update contrib/tsearch2 to use current Snowball code --- 1897,1903 ---- files during postmaster startup Various memory leakage fixes Various portability improvements ! Fix PL/pgSQL to handle var := var correctly when the variable is of pass-by-reference type Update contrib/tsearch2 to use current Snowball code diff --git a/doc/src/sgml/release-8.0.sgml b/doc/src/sgml/release-8.0.sgml index 0174b8e..ae9e119 100644 *** a/doc/src/sgml/release-8.0.sgml --- b/doc/src/sgml/release-8.0.sgml *************** when opening the file fails Fix password prompting in pg_restore on Windows ! Fix PL/PgSQL to handle var := var correctly when the variable is of pass-by-reference type Fix PL/Perl %_SHARED so it's actually shared --- 2512,2518 ---- constraints more reliably Fix password prompting in pg_restore on Windows ! Fix PL/pgSQL to handle var := var correctly when the variable is of pass-by-reference type Fix PL/Perl %_SHARED so it's actually shared diff --git a/doc/src/sgml/release-8.1.sgml b/doc/src/sgml/release-8.1.sgml index c4ea448..2d84b00 100644 *** a/doc/src/sgml/release-8.1.sgml --- b/doc/src/sgml/release-8.1.sgml *************** *** 1212,1218 **** ! Fix PL/PgSQL to not fail when a FOR loop's target variable is a record containing composite-type fields (Tom) --- 1212,1218 ---- ! Fix PL/pgSQL to not fail when a FOR loop's target variable is a record containing composite-type fields (Tom) *************** SELECT CURRENT_TIMESTAMP AT TIME ZONE 'E *** 4343,4349 **** ! Allow SQL and PL/PgSQL functions to use OUT and INOUT parameters (Tom) --- 4343,4349 ---- ! Allow SQL and PL/pgSQL functions to use OUT and INOUT parameters (Tom) *************** SELECT CURRENT_TIMESTAMP AT TIME ZONE 'E *** 4378,4389 **** ! PL/PgSQL Server-Side Language Changes ! Overhaul the memory management of PL/PgSQL functions (Neil) The parsetree of each function is now stored in a separate --- 4378,4389 ---- ! PL/pgSQL Server-Side Language Changes ! Overhaul the memory management of PL/pgSQL functions (Neil) The parsetree of each function is now stored in a separate *************** SELECT CURRENT_TIMESTAMP AT TIME ZONE 'E *** 4426,4432 **** Add support for an optional INTO clause to ! PL/PgSQL's EXECUTE statement (Pavel Stehule, Neil) --- 4426,4432 ---- Add support for an optional INTO clause to ! PL/pgSQL's EXECUTE statement (Pavel Stehule, Neil) diff --git a/doc/src/sgml/release-8.2.sgml b/doc/src/sgml/release-8.2.sgml index 7a552bc..01254fe 100644 *** a/doc/src/sgml/release-8.2.sgml --- b/doc/src/sgml/release-8.2.sgml *************** *** 1661,1667 **** ! Fix PL/PgSQL to not fail when a FOR loop's target variable is a record containing composite-type fields (Tom) --- 1661,1667 ---- ! Fix PL/pgSQL to not fail when a FOR loop's target variable is a record containing composite-type fields (Tom) *************** *** 4883,4889 **** ! PL/PgSQL Server-Side Language Changes --- 4883,4889 ---- ! PL/pgSQL Server-Side Language Changes *************** *** 5448,5454 **** linkend="guc-local-preload-libraries">local_preload_libraries that allows libraries to be loaded into specific sessions without explicit cooperation from the client application. This allows ! external add-ons to implement features such as a PL/PgSQL debugger. --- 5448,5454 ---- linkend="guc-local-preload-libraries">local_preload_libraries that allows libraries to be loaded into specific sessions without explicit cooperation from the client application. This allows ! external add-ons to implement features such as a PL/pgSQL debugger. diff --git a/doc/src/sgml/release-8.3.sgml b/doc/src/sgml/release-8.3.sgml index 9827b93..bf18c6a 100644 *** a/doc/src/sgml/release-8.3.sgml --- b/doc/src/sgml/release-8.3.sgml *************** *** 2239,2245 **** ! Fix PL/PgSQL to not fail when a FOR loop's target variable is a record containing composite-type fields (Tom) --- 2239,2245 ---- ! Fix PL/pgSQL to not fail when a FOR loop's target variable is a record containing composite-type fields (Tom) *************** current_date < 2017-11-17 *** 3914,3920 **** ! Previously PL/PgSQL functions that referenced temporary tables would fail if the temporary table was dropped and recreated between function invocations, unless EXECUTE was used. This improvement fixes that problem and many related issues. --- 3914,3920 ---- ! Previously PL/pgSQL functions that referenced temporary tables would fail if the temporary table was dropped and recreated between function invocations, unless EXECUTE was used. This improvement fixes that problem and many related issues. *************** current_date < 2017-11-17 *** 4740,4746 **** The first request for statistics in a transaction takes a statistics snapshot that does not change during the transaction. This function allows the snapshot to be discarded and a new snapshot loaded during ! the next statistics query. This is particularly useful for PL/PgSQL functions, which are confined to a single transaction. --- 4740,4746 ---- The first request for statistics in a transaction takes a statistics snapshot that does not change during the transaction. This function allows the snapshot to be discarded and a new snapshot loaded during ! the next statistics query. This is particularly useful for PL/pgSQL functions, which are confined to a single transaction. *************** current_date < 2017-11-17 *** 4835,4841 **** ! PL/PgSQL Server-Side Language --- 4835,4841 ---- ! PL/pgSQL Server-Side Language *************** current_date < 2017-11-17 *** 4848,4854 **** Allow IN as an alternative to ! FROM in PL/PgSQL's FETCH statement, for consistency with the backend's FETCH command (Pavel Stehule) --- 4848,4854 ---- Allow IN as an alternative to ! FROM in PL/pgSQL's FETCH statement, for consistency with the backend's FETCH command (Pavel Stehule) *************** current_date < 2017-11-17 *** 4856,4862 **** ! Add MOVE to PL/PgSQL (Magnus, Pavel Stehule, Neil) --- 4856,4862 ---- ! Add MOVE to PL/pgSQL (Magnus, Pavel Stehule, Neil) *************** current_date < 2017-11-17 *** 4867,4873 **** ! This adds convenient syntax for PL/PgSQL set-returning functions that want to return the result of a query. RETURN QUERY is easier and more efficient than a loop around RETURN NEXT. --- 4867,4873 ---- ! This adds convenient syntax for PL/pgSQL set-returning functions that want to return the result of a query. RETURN QUERY is easier and more efficient than a loop around RETURN NEXT. diff --git a/doc/src/sgml/release-8.4.sgml b/doc/src/sgml/release-8.4.sgml index 9c88d24..884c4a5 100644 *** a/doc/src/sgml/release-8.4.sgml --- b/doc/src/sgml/release-8.4.sgml *************** WITH w AS (SELECT * FROM foo) SELECT * F *** 2689,2695 **** ! In particular, this means that functions written in PL/PgSQL and other PL languages can now be called this way. --- 2689,2695 ---- ! In particular, this means that functions written in PL/pgSQL and other PL languages can now be called this way. *************** WITH w AS (SELECT * FROM foo) SELECT * F *** 3815,3821 **** ! PL/PgSQL Server-Side Language --- 3815,3821 ---- ! PL/pgSQL Server-Side Language diff --git a/doc/src/sgml/release-9.0.sgml b/doc/src/sgml/release-9.0.sgml index d425c00..d928f6c 100644 *** a/doc/src/sgml/release-9.0.sgml --- b/doc/src/sgml/release-9.0.sgml *************** *** 1948,1954 **** ! <link linkend="plpgsql">PL/PgSQL</link> Server-Side Language --- 1948,1954 ---- ! <link linkend="plpgsql">PL/pgSQL</link> Server-Side Language diff --git a/doc/src/sgml/release-old.sgml b/doc/src/sgml/release-old.sgml index 25c3f2e..7cb1451 100644 *** a/doc/src/sgml/release-old.sgml --- b/doc/src/sgml/release-old.sgml *************** pages *** 692,698 **** enabled Various memory leakage fixes Various portability improvements ! Fix PL/PgSQL to handle var := var correctly when the variable is of pass-by-reference type --- 692,698 ---- enabled Various memory leakage fixes Various portability improvements ! Fix PL/pgSQL to handle var := var correctly when the variable is of pass-by-reference type diff --git a/src/pl/plpgsql/src/gram.y b/src/pl/plpgsql/src/gram.y index bd62942..a28c670 100644 *** a/src/pl/plpgsql/src/gram.y --- b/src/pl/plpgsql/src/gram.y *************** make_scalar_list1(char *initial_name, *** 3058,3068 **** } /* ! * When the PL/PgSQL parser expects to see a SQL statement, it is very * liberal in what it accepts; for example, we often assume an * unrecognized keyword is the beginning of a SQL statement. This * avoids the need to duplicate parts of the SQL grammar in the ! * PL/PgSQL grammar, but it means we can accept wildly malformed * input. To try and catch some of the more obviously invalid input, * we run the strings we expect to be SQL statements through the main * SQL parser. --- 3058,3068 ---- } /* ! * When the PL/pgSQL parser expects to see a SQL statement, it is very * liberal in what it accepts; for example, we often assume an * unrecognized keyword is the beginning of a SQL statement. This * avoids the need to duplicate parts of the SQL grammar in the ! * PL/pgSQL grammar, but it means we can accept wildly malformed * input. To try and catch some of the more obviously invalid input, * we run the strings we expect to be SQL statements through the main * SQL parser. *************** make_scalar_list1(char *initial_name, *** 3071,3077 **** * any database access and does not check any semantic rules, it just * checks for basic syntactic correctness. We do this here, rather * than after parsing has finished, because a malformed SQL statement ! * may cause the PL/PgSQL parser to become confused about statement * borders. So it is best to bail out as early as we can. * * It is assumed that "stmt" represents a copy of the function source text --- 3071,3077 ---- * any database access and does not check any semantic rules, it just * checks for basic syntactic correctness. We do this here, rather * than after parsing has finished, because a malformed SQL statement ! * may cause the PL/pgSQL parser to become confused about statement * borders. So it is best to bail out as early as we can. * * It is assumed that "stmt" represents a copy of the function source text diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c index e09b55b..3ddcf3b 100644 *** a/src/pl/plpgsql/src/pl_comp.c --- b/src/pl/plpgsql/src/pl_comp.c *************** do_compile(FunctionCallInfo fcinfo, *** 336,342 **** * per-function memory context, so it can be reclaimed easily. */ func_cxt = AllocSetContextCreate(TopMemoryContext, ! "PL/PgSQL function context", ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); --- 336,342 ---- * per-function memory context, so it can be reclaimed easily. */ func_cxt = AllocSetContextCreate(TopMemoryContext, ! "PL/pgSQL function context", ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); *************** plpgsql_compile_inline(char *proc_source *** 768,774 **** * its own memory context, so it can be reclaimed easily. */ func_cxt = AllocSetContextCreate(CurrentMemoryContext, ! "PL/PgSQL function context", ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); --- 768,774 ---- * its own memory context, so it can be reclaimed easily. */ func_cxt = AllocSetContextCreate(CurrentMemoryContext, ! "PL/pgSQL function context", ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 8b4855b..6601320 100644 *** a/src/pl/plpgsql/src/pl_exec.c --- b/src/pl/plpgsql/src/pl_exec.c *************** static int *** 2064,2070 **** exec_stmt_return(PLpgSQL_execstate *estate, PLpgSQL_stmt_return *stmt) { /* ! * If processing a set-returning PL/PgSQL function, the final RETURN * indicates that the function is finished producing tuples. The rest of * the work will be done at the top level. */ --- 2064,2070 ---- exec_stmt_return(PLpgSQL_execstate *estate, PLpgSQL_stmt_return *stmt) { /* ! * If processing a set-returning PL/pgSQL function, the final RETURN * indicates that the function is finished producing tuples. The rest of * the work will be done at the top level. */ diff --git a/src/pl/plpgsql/src/po/fr.po b/src/pl/plpgsql/src/po/fr.po index 0ae0619..27a56d0 100644 *** a/src/pl/plpgsql/src/po/fr.po --- b/src/pl/plpgsql/src/po/fr.po *************** msgstr "%s sur ou prs de %s " *** 804,812 **** #~ msgstr "" #~ "Attendait une variable RECORD, ROW ou une liste de variables scalaires\n" #~ "suivant INTO." ! #~ msgid "SQL statement in PL/PgSQL function \"%s\" near line %d" #~ msgstr "instruction SQL dans la fonction PL/pgsql %s prs de la ligne %d" ! #~ msgid "string literal in PL/PgSQL function \"%s\" near line %d" #~ msgstr "" #~ "chane littrale dans la fonction PL/pgsql %s prs de la ligne %d" #~ msgid "expected \")\"" --- 804,812 ---- #~ msgstr "" #~ "Attendait une variable RECORD, ROW ou une liste de variables scalaires\n" #~ "suivant INTO." ! #~ msgid "SQL statement in PL/pgSQL function \"%s\" near line %d" #~ msgstr "instruction SQL dans la fonction PL/pgsql %s prs de la ligne %d" ! #~ msgid "string literal in PL/pgSQL function \"%s\" near line %d" #~ msgstr "" #~ "chane littrale dans la fonction PL/pgsql %s prs de la ligne %d" #~ msgid "expected \")\"" diff --git a/src/pl/plpgsql/src/po/it.po b/src/pl/plpgsql/src/po/it.po index b4d2c2a..dcf547c 100644 *** a/src/pl/plpgsql/src/po/it.po --- b/src/pl/plpgsql/src/po/it.po *************** msgstr "%s a o vicino \"%s\"" *** 810,821 **** #~ "Attesa una variabile di tipo RECORD, ROW o una lista di variabili scalari " #~ "dopo la clausola INTO" ! #~ msgid "SQL statement in PL/PgSQL function \"%s\" near line %d" ! #~ msgstr "istruzione SQL nella funzione PL/PgSQL \"%s\" vicino alla linea %d" ! #~ msgid "string literal in PL/PgSQL function \"%s\" near line %d" #~ msgstr "" ! #~ "stringa letterale nella funzione PL/PgSQL \"%s\" vicino alla linea %d" #~ msgid "expected \")\"" #~ msgstr "atteso \")\"" --- 810,821 ---- #~ "Attesa una variabile di tipo RECORD, ROW o una lista di variabili scalari " #~ "dopo la clausola INTO" ! #~ msgid "SQL statement in PL/pgSQL function \"%s\" near line %d" ! #~ msgstr "istruzione SQL nella funzione PL/pgSQL \"%s\" vicino alla linea %d" ! #~ msgid "string literal in PL/pgSQL function \"%s\" near line %d" #~ msgstr "" ! #~ "stringa letterale nella funzione PL/pgSQL \"%s\" vicino alla linea %d" #~ msgid "expected \")\"" #~ msgstr "atteso \")\"" diff --git a/src/pl/plpgsql/src/po/ja.po b/src/pl/plpgsql/src/po/ja.po index b1d38f9..4a7ff1f 100644 *** a/src/pl/plpgsql/src/po/ja.po --- b/src/pl/plpgsql/src/po/ja.po *************** msgstr "INTO 変数の指定が多すぎ *** 612,624 **** #: gram.y:2749 #, c-format ! msgid "SQL statement in PL/PgSQL function \"%s\" near line %d" ! msgstr "PL/PgSQL 関数 \"%s\" の %d 行目周辺の SQL ステートメント" #: gram.y:2792 #, c-format ! msgid "string literal in PL/PgSQL function \"%s\" near line %d" ! msgstr "PL/PgSQL 関数 \"%s\" の %d 行目周辺の文字列リテラル" #: gram.y:2805 msgid "label does not exist" --- 612,624 ---- #: gram.y:2749 #, c-format ! msgid "SQL statement in PL/pgSQL function \"%s\" near line %d" ! msgstr "PL/pgSQL 関数 \"%s\" の %d 行目周辺の SQL ステートメント" #: gram.y:2792 #, c-format ! msgid "string literal in PL/pgSQL function \"%s\" near line %d" ! msgstr "PL/pgSQL 関数 \"%s\" の %d 行目周辺の文字列リテラル" #: gram.y:2805 msgid "label does not exist" diff --git a/src/pl/plpgsql/src/po/ro.po b/src/pl/plpgsql/src/po/ro.po index d3e97de..9be39b7 100644 *** a/src/pl/plpgsql/src/po/ro.po --- b/src/pl/plpgsql/src/po/ro.po *************** msgstr "prea multe variabile INTO specif *** 652,659 **** #: gram.y:2734 #, c-format ! msgid "SQL statement in PL/PgSQL function \"%s\" near line %d" ! msgstr "comandă SQL în funcția PL/PgSQL \"%s\" aproape de linia %d" #: gram.y:2748 msgid "label does not exist" --- 652,659 ---- #: gram.y:2734 #, c-format ! msgid "SQL statement in PL/pgSQL function \"%s\" near line %d" ! msgstr "comandă SQL în funcția PL/pgSQL \"%s\" aproape de linia %d" #: gram.y:2748 msgid "label does not exist" diff --git a/src/test/regress/expected/plpgsql.out b/src/test/regress/expected/plpgsql.out index de17574..b454e63 100644 *** a/src/test/regress/expected/plpgsql.out --- b/src/test/regress/expected/plpgsql.out *************** insert into IFace values ('IF', 'orion', *** 1541,1547 **** ERROR: IFace slotname "IF.orion.ethernet_interface_name_too_long" too long (20 char max) -- -- The following tests are unrelated to the scenario outlined above; ! -- they merely exercise specific parts of PL/PgSQL -- -- -- Test recursion, per bug report 7-Sep-01 --- 1541,1547 ---- ERROR: IFace slotname "IF.orion.ethernet_interface_name_too_long" too long (20 char max) -- -- The following tests are unrelated to the scenario outlined above; ! -- they merely exercise specific parts of PL/pgSQL -- -- -- Test recursion, per bug report 7-Sep-01 diff --git a/src/test/regress/sql/plpgsql.sql b/src/test/regress/sql/plpgsql.sql index 6783678..4811558 100644 *** a/src/test/regress/sql/plpgsql.sql --- b/src/test/regress/sql/plpgsql.sql *************** insert into IFace values ('IF', 'orion', *** 1420,1426 **** -- -- The following tests are unrelated to the scenario outlined above; ! -- they merely exercise specific parts of PL/PgSQL -- -- --- 1420,1426 ---- -- -- The following tests are unrelated to the scenario outlined above; ! -- they merely exercise specific parts of PL/pgSQL -- --