@@ -1518,16 +1518,16 @@ ERROR: duplicate key value violates unique constraint "pfield_name"
15181518DETAIL: Key (name)=(PF1_1) already exists.
15191519update PSlot set backlink = 'WS.not.there' where slotname = 'PS.base.a1';
15201520ERROR: WS.not.there does not exist
1521- CONTEXT: PL/pgSQL function "tg_backlink_a" line 16 at assignment
1521+ CONTEXT: PL/pgSQL function "tg_backlink_a" line 17 at assignment
15221522update PSlot set backlink = 'XX.illegal' where slotname = 'PS.base.a1';
15231523ERROR: illegal backlink beginning with XX
1524- CONTEXT: PL/pgSQL function "tg_backlink_a" line 16 at assignment
1524+ CONTEXT: PL/pgSQL function "tg_backlink_a" line 17 at assignment
15251525update PSlot set slotlink = 'PS.not.there' where slotname = 'PS.base.a1';
15261526ERROR: PS.not.there does not exist
1527- CONTEXT: PL/pgSQL function "tg_slotlink_a" line 16 at assignment
1527+ CONTEXT: PL/pgSQL function "tg_slotlink_a" line 17 at assignment
15281528update PSlot set slotlink = 'XX.illegal' where slotname = 'PS.base.a1';
15291529ERROR: illegal slotlink beginning with XX
1530- CONTEXT: PL/pgSQL function "tg_slotlink_a" line 16 at assignment
1530+ CONTEXT: PL/pgSQL function "tg_slotlink_a" line 17 at assignment
15311531insert into HSlot values ('HS', 'base.hub1', 1, '');
15321532ERROR: duplicate key value violates unique constraint "hslot_name"
15331533DETAIL: Key (slotname)=(HS.base.hub1.1 ) already exists.
@@ -2067,13 +2067,13 @@ end$$ language plpgsql;
20672067select test_variable_storage();
20682068NOTICE: should see this
20692069CONTEXT: SQL statement "SELECT trap_zero_divide(-100)"
2070- PL/pgSQL function "test_variable_storage" line 7 at PERFORM
2070+ PL/pgSQL function "test_variable_storage" line 8 at PERFORM
20712071NOTICE: should see this only if -100 <> 0
20722072CONTEXT: SQL statement "SELECT trap_zero_divide(-100)"
2073- PL/pgSQL function "test_variable_storage" line 7 at PERFORM
2073+ PL/pgSQL function "test_variable_storage" line 8 at PERFORM
20742074NOTICE: should see this only if -100 fits in smallint
20752075CONTEXT: SQL statement "SELECT trap_zero_divide(-100)"
2076- PL/pgSQL function "test_variable_storage" line 7 at PERFORM
2076+ PL/pgSQL function "test_variable_storage" line 8 at PERFORM
20772077 test_variable_storage
20782078-----------------------
20792079 123456789012
@@ -2302,7 +2302,7 @@ end;
23022302$$ language plpgsql;
23032303select raise_test1(5);
23042304ERROR: too many parameters specified for RAISE
2305- CONTEXT: PL/pgSQL function "raise_test1" line 2 at RAISE
2305+ CONTEXT: PL/pgSQL function "raise_test1" line 3 at RAISE
23062306create function raise_test2(int) returns int as $$
23072307begin
23082308 raise notice 'This message has too few parameters: %, %, %', $1, $1;
@@ -2311,7 +2311,7 @@ end;
23112311$$ language plpgsql;
23122312select raise_test2(10);
23132313ERROR: too few parameters specified for RAISE
2314- CONTEXT: PL/pgSQL function "raise_test2" line 2 at RAISE
2314+ CONTEXT: PL/pgSQL function "raise_test2" line 3 at RAISE
23152315--
23162316-- reject function definitions that contain malformed SQL queries at
23172317-- compile-time, where possible
@@ -2424,7 +2424,7 @@ ERROR: column "sqlstate" does not exist
24242424LINE 1: SELECT sqlstate
24252425 ^
24262426QUERY: SELECT sqlstate
2427- CONTEXT: PL/pgSQL function "excpt_test1" line 2 at RAISE
2427+ CONTEXT: PL/pgSQL function "excpt_test1" line 3 at RAISE
24282428create function excpt_test2() returns void as $$
24292429begin
24302430 begin
@@ -2439,7 +2439,7 @@ ERROR: column "sqlstate" does not exist
24392439LINE 1: SELECT sqlstate
24402440 ^
24412441QUERY: SELECT sqlstate
2442- CONTEXT: PL/pgSQL function "excpt_test2" line 4 at RAISE
2442+ CONTEXT: PL/pgSQL function "excpt_test2" line 5 at RAISE
24432443create function excpt_test3() returns void as $$
24442444begin
24452445 begin
@@ -2821,7 +2821,7 @@ begin
28212821end$$ language plpgsql;
28222822select footest();
28232823ERROR: query returned more than one row
2824- CONTEXT: PL/pgSQL function "footest" line 4 at SQL statement
2824+ CONTEXT: PL/pgSQL function "footest" line 5 at SQL statement
28252825create or replace function footest() returns void as $$
28262826declare x record;
28272827begin
@@ -2884,7 +2884,7 @@ begin
28842884end$$ language plpgsql;
28852885select footest();
28862886ERROR: query returned no rows
2887- CONTEXT: PL/pgSQL function "footest" line 4 at SQL statement
2887+ CONTEXT: PL/pgSQL function "footest" line 5 at SQL statement
28882888create or replace function footest() returns void as $$
28892889declare x record;
28902890begin
@@ -2894,7 +2894,7 @@ begin
28942894end$$ language plpgsql;
28952895select footest();
28962896ERROR: query returned more than one row
2897- CONTEXT: PL/pgSQL function "footest" line 4 at SQL statement
2897+ CONTEXT: PL/pgSQL function "footest" line 5 at SQL statement
28982898create or replace function footest() returns void as $$
28992899declare x record;
29002900begin
@@ -2918,7 +2918,7 @@ begin
29182918end$$ language plpgsql;
29192919select footest();
29202920ERROR: query returned no rows
2921- CONTEXT: PL/pgSQL function "footest" line 4 at EXECUTE statement
2921+ CONTEXT: PL/pgSQL function "footest" line 5 at EXECUTE statement
29222922create or replace function footest() returns void as $$
29232923declare x record;
29242924begin
@@ -2928,7 +2928,7 @@ begin
29282928end$$ language plpgsql;
29292929select footest();
29302930ERROR: query returned more than one row
2931- CONTEXT: PL/pgSQL function "footest" line 4 at EXECUTE statement
2931+ CONTEXT: PL/pgSQL function "footest" line 5 at EXECUTE statement
29322932drop function footest();
29332933-- test scrollable cursor support
29342934create function sc_test() returns setof integer as $$
@@ -2972,7 +2972,7 @@ $$ language plpgsql;
29722972select * from sc_test(); -- fails because of NO SCROLL specification
29732973ERROR: cursor can only scan forward
29742974HINT: Declare it with SCROLL option to enable backward scan.
2975- CONTEXT: PL/pgSQL function "sc_test" line 6 at FETCH
2975+ CONTEXT: PL/pgSQL function "sc_test" line 7 at FETCH
29762976create or replace function sc_test() returns setof integer as $$
29772977declare
29782978 c refcursor;
@@ -3559,7 +3559,7 @@ end;
35593559$$ language plpgsql;
35603560select raise_test();
35613561ERROR: RAISE option already specified: MESSAGE
3562- CONTEXT: PL/pgSQL function "raise_test" line 2 at RAISE
3562+ CONTEXT: PL/pgSQL function "raise_test" line 3 at RAISE
35633563-- conflict on errcode
35643564create or replace function raise_test() returns void as $$
35653565begin
@@ -3568,7 +3568,7 @@ end;
35683568$$ language plpgsql;
35693569select raise_test();
35703570ERROR: RAISE option already specified: ERRCODE
3571- CONTEXT: PL/pgSQL function "raise_test" line 2 at RAISE
3571+ CONTEXT: PL/pgSQL function "raise_test" line 3 at RAISE
35723572-- nothing to re-RAISE
35733573create or replace function raise_test() returns void as $$
35743574begin
@@ -3639,7 +3639,7 @@ select case_test(4);
36393639select case_test(5); -- fails
36403640ERROR: case not found
36413641HINT: CASE statement is missing ELSE part.
3642- CONTEXT: PL/pgSQL function "case_test" line 4 at CASE
3642+ CONTEXT: PL/pgSQL function "case_test" line 5 at CASE
36433643select case_test(8);
36443644 case_test
36453645----------------------
@@ -3667,7 +3667,7 @@ select case_test(12);
36673667select case_test(13); -- fails
36683668ERROR: case not found
36693669HINT: CASE statement is missing ELSE part.
3670- CONTEXT: PL/pgSQL function "case_test" line 4 at CASE
3670+ CONTEXT: PL/pgSQL function "case_test" line 5 at CASE
36713671create or replace function catch() returns void as $$
36723672begin
36733673 raise notice '%', case_test(6);
@@ -3943,7 +3943,7 @@ LINE 1: SELECT 'foo\\bar\041baz'
39433943 ^
39443944HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
39453945QUERY: SELECT 'foo\\bar\041baz'
3946- CONTEXT: PL/pgSQL function "strtest" line 3 at RETURN
3946+ CONTEXT: PL/pgSQL function "strtest" line 4 at RETURN
39473947 strtest
39483948-------------
39493949 foo\bar!baz
@@ -4026,7 +4026,7 @@ ERROR: column "foo" does not exist
40264026LINE 1: SELECT rtrim(roomno) AS roomno, foo FROM Room ORDER BY roomn...
40274027 ^
40284028QUERY: SELECT rtrim(roomno) AS roomno, foo FROM Room ORDER BY roomno
4029- CONTEXT: PL/pgSQL function "inline_code_block" line 3 at FOR over SELECT rows
4029+ CONTEXT: PL/pgSQL function "inline_code_block" line 4 at FOR over SELECT rows
40304030-- Check variable scoping -- a var is not available in its own or prior
40314031-- default expressions.
40324032create function scope_test() returns int as $$
@@ -4063,7 +4063,7 @@ LINE 1: select q1,q2 from int8_tbl
40634063 ^
40644064DETAIL: It could refer to either a PL/pgSQL variable or a table column.
40654065QUERY: select q1,q2 from int8_tbl
4066- CONTEXT: PL/pgSQL function "conflict_test" line 4 at FOR over SELECT rows
4066+ CONTEXT: PL/pgSQL function "conflict_test" line 5 at FOR over SELECT rows
40674067create or replace function conflict_test() returns setof int8_tbl as $$
40684068#variable_conflict use_variable
40694069declare r record;
0 commit comments