*** a/doc/src/sgml/libpq.sgml
--- b/doc/src/sgml/libpq.sgml
***************
*** 5418,5423 **** int PQsetClientEncoding(PGconn *conn, const char *VERBOSE>
! mode includes all available fields. Changing the verbosity does not
! affect the messages available from already-existing
! PGresult> objects, only subsequently-created ones.
--- 5431,5442 ----
returned messages include severity, primary text, and position only;
this will normally fit on a single line. The default mode produces
messages that include the above plus any detail, hint, or context
! fields (these might span multiple lines). The COMPACT mode is otherwise
! the same as the default, except the context field will be omitted for
! non-error messages. The VERBOSE> mode includes all
! available fields. Changing the verbosity does not affect the messages
! available from already-existing PGresult> objects, only
! subsequently-created ones.
*** a/src/bin/psql/startup.c
--- b/src/bin/psql/startup.c
***************
*** 796,801 **** verbosity_hook(const char *newval)
--- 796,803 ----
pset.verbosity = PQERRORS_DEFAULT;
else if (strcmp(newval, "terse") == 0)
pset.verbosity = PQERRORS_TERSE;
+ else if (strcmp(newval, "compact") == 0)
+ pset.verbosity = PQERRORS_COMPACT;
else if (strcmp(newval, "verbose") == 0)
pset.verbosity = PQERRORS_VERBOSE;
else
*** a/src/interfaces/libpq/fe-protocol3.c
--- b/src/interfaces/libpq/fe-protocol3.c
***************
*** 915,920 **** pqGetErrorNotice3(PGconn *conn, bool isError)
--- 915,924 ----
if (val)
appendPQExpBuffer(&workBuf, libpq_gettext("QUERY: %s\n"), val);
val = PQresultErrorField(res, PG_DIAG_CONTEXT);
+ }
+ if (isError || (conn->verbosity != PQERRORS_TERSE &&
+ conn->verbosity != PQERRORS_COMPACT))
+ {
if (val)
appendPQExpBuffer(&workBuf, libpq_gettext("CONTEXT: %s\n"), val);
}
*** a/src/interfaces/libpq/libpq-fe.h
--- b/src/interfaces/libpq/libpq-fe.h
***************
*** 106,111 **** typedef enum
--- 106,112 ----
typedef enum
{
PQERRORS_TERSE, /* single-line error messages */
+ PQERRORS_COMPACT, /* single-line error messages on non-error messags */
PQERRORS_DEFAULT, /* recommended style */
PQERRORS_VERBOSE /* all the facts, ma'am */
} PGVerbosity;
*** a/src/pl/plpgsql/src/pl_exec.c
--- b/src/pl/plpgsql/src/pl_exec.c
***************
*** 39,46 ****
#include "utils/typcache.h"
- static const char *const raise_skip_msg = "RAISE";
-
typedef struct
{
int nargs; /* number of arguments */
--- 39,44 ----
***************
*** 867,876 **** plpgsql_exec_error_callback(void *arg)
{
PLpgSQL_execstate *estate = (PLpgSQL_execstate *) arg;
- /* if we are doing RAISE, don't report its location */
- if (estate->err_text == raise_skip_msg)
- return;
-
if (estate->err_text != NULL)
{
/*
--- 865,870 ----
***************
*** 3032,3038 **** exec_stmt_raise(PLpgSQL_execstate *estate, PLpgSQL_stmt_raise *stmt)
/*
* Throw the error (may or may not come back)
*/
- estate->err_text = raise_skip_msg; /* suppress traceback of raise */
ereport(stmt->elog_level,
(err_code ? errcode(err_code) : 0,
--- 3026,3031 ----
*** a/src/test/regress/expected/alter_table.out
--- b/src/test/regress/expected/alter_table.out
***************
*** 361,371 **** CREATE FUNCTION boo(int) RETURNS int IMMUTABLE STRICT LANGUAGE plpgsql AS $$ BEG
--- 361,374 ----
INSERT INTO tmp7 VALUES (8, 18);
ALTER TABLE tmp7 ADD CONSTRAINT identity CHECK (b = boo(b));
NOTICE: boo: 18
+ CONTEXT: PL/pgSQL function boo(integer) line 1 at RAISE
ALTER TABLE tmp3 ADD CONSTRAINT IDENTITY check (b = boo(b)) NOT VALID;
NOTICE: merging constraint "identity" with inherited definition
ALTER TABLE tmp3 VALIDATE CONSTRAINT identity;
NOTICE: boo: 16
+ CONTEXT: PL/pgSQL function boo(integer) line 1 at RAISE
NOTICE: boo: 20
+ CONTEXT: PL/pgSQL function boo(integer) line 1 at RAISE
-- Try (and fail) to create constraint from tmp5(a) to tmp4(a) - unique constraint on
-- tmp4 is a,b
ALTER TABLE tmp5 add constraint tmpconstr foreign key(a) references tmp4(a) match full;
*** a/src/test/regress/expected/event_trigger.out
--- b/src/test/regress/expected/event_trigger.out
***************
*** 70,79 **** alter event trigger regress_event_trigger disable;
--- 70,82 ----
-- regress_event_trigger
create table event_trigger_fire1 (a int);
NOTICE: test_event_trigger: ddl_command_start CREATE TABLE
+ CONTEXT: PL/pgSQL function test_event_trigger() line 3 at RAISE
NOTICE: test_event_trigger: ddl_command_end CREATE TABLE
+ CONTEXT: PL/pgSQL function test_event_trigger() line 3 at RAISE
-- regress_event_trigger_end should fire here
drop table event_trigger_fire1;
NOTICE: test_event_trigger: ddl_command_end DROP TABLE
+ CONTEXT: PL/pgSQL function test_event_trigger() line 3 at RAISE
-- alter owner to non-superuser should fail
alter event trigger regress_event_trigger owner to regression_bob;
ERROR: permission denied to change owner of event trigger "regress_event_trigger"
***************
*** 194,200 **** PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_two_table_three"
PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
ERROR: object audit_tbls.schema_two_table_three of type table cannot be dropped
! CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_two_table_three"
PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
DELETE FROM undroppable_objs WHERE object_identity = 'audit_tbls.schema_two_table_three';
DROP SCHEMA schema_one, schema_two CASCADE;
--- 197,204 ----
SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_two_table_three"
PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
ERROR: object audit_tbls.schema_two_table_three of type table cannot be dropped
! CONTEXT: PL/pgSQL function undroppable() line 14 at RAISE
! SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_two_table_three"
PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
DELETE FROM undroppable_objs WHERE object_identity = 'audit_tbls.schema_two_table_three';
DROP SCHEMA schema_one, schema_two CASCADE;
***************
*** 224,229 **** NOTICE: table "schema_one_table_three" does not exist, skipping
--- 228,234 ----
CONTEXT: SQL statement "DROP TABLE IF EXISTS audit_tbls.schema_one_table_three"
PL/pgSQL function test_evtrig_dropped_objects() line 8 at EXECUTE statement
ERROR: object schema_one.table_three of type table cannot be dropped
+ CONTEXT: PL/pgSQL function undroppable() line 14 at RAISE
DELETE FROM undroppable_objs WHERE object_identity = 'schema_one.table_three';
DROP SCHEMA schema_one, schema_two CASCADE;
NOTICE: drop cascades to 7 other objects
*** a/src/test/regress/expected/plancache.out
--- b/src/test/regress/expected/plancache.out
***************
*** 237,244 **** NOTICE: table "temptable" does not exist, skipping
--- 237,247 ----
CONTEXT: SQL statement "drop table if exists temptable cascade"
PL/pgSQL function cachebug() line 4 at SQL statement
NOTICE: 1
+ CONTEXT: PL/pgSQL function cachebug() line 8 at RAISE
NOTICE: 2
+ CONTEXT: PL/pgSQL function cachebug() line 8 at RAISE
NOTICE: 3
+ CONTEXT: PL/pgSQL function cachebug() line 8 at RAISE
cachebug
----------
***************
*** 249,256 **** NOTICE: drop cascades to view vv
--- 252,262 ----
CONTEXT: SQL statement "drop table if exists temptable cascade"
PL/pgSQL function cachebug() line 4 at SQL statement
NOTICE: 1
+ CONTEXT: PL/pgSQL function cachebug() line 8 at RAISE
NOTICE: 2
+ CONTEXT: PL/pgSQL function cachebug() line 8 at RAISE
NOTICE: 3
+ CONTEXT: PL/pgSQL function cachebug() line 8 at RAISE
cachebug
----------
*** a/src/test/regress/expected/plpgsql.out
--- b/src/test/regress/expected/plpgsql.out
***************
*** 1518,1544 **** ERROR: duplicate key value violates unique constraint "pfield_name"
DETAIL: Key (name)=(PF1_1) already exists.
update PSlot set backlink = 'WS.not.there' where slotname = 'PS.base.a1';
ERROR: WS.not.there does not exist
! CONTEXT: PL/pgSQL function tg_backlink_a() line 17 at assignment
update PSlot set backlink = 'XX.illegal' where slotname = 'PS.base.a1';
ERROR: illegal backlink beginning with XX
! CONTEXT: PL/pgSQL function tg_backlink_a() line 17 at assignment
update PSlot set slotlink = 'PS.not.there' where slotname = 'PS.base.a1';
ERROR: PS.not.there does not exist
! CONTEXT: PL/pgSQL function tg_slotlink_a() line 17 at assignment
update PSlot set slotlink = 'XX.illegal' where slotname = 'PS.base.a1';
ERROR: illegal slotlink beginning with XX
! CONTEXT: PL/pgSQL function tg_slotlink_a() line 17 at assignment
insert into HSlot values ('HS', 'base.hub1', 1, '');
ERROR: duplicate key value violates unique constraint "hslot_name"
DETAIL: Key (slotname)=(HS.base.hub1.1 ) already exists.
insert into HSlot values ('HS', 'base.hub1', 20, '');
ERROR: no manual manipulation of HSlot
delete from HSlot;
ERROR: no manual manipulation of HSlot
insert into IFace values ('IF', 'notthere', 'eth0', '');
ERROR: system "notthere" does not exist
insert into IFace values ('IF', 'orion', 'ethernet_interface_name_too_long', '');
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
--- 1518,1552 ----
DETAIL: Key (name)=(PF1_1) already exists.
update PSlot set backlink = 'WS.not.there' where slotname = 'PS.base.a1';
ERROR: WS.not.there does not exist
! CONTEXT: PL/pgSQL function tg_backlink_set(character,character) line 30 at RAISE
! PL/pgSQL function tg_backlink_a() line 17 at assignment
update PSlot set backlink = 'XX.illegal' where slotname = 'PS.base.a1';
ERROR: illegal backlink beginning with XX
! CONTEXT: PL/pgSQL function tg_backlink_set(character,character) line 47 at RAISE
! PL/pgSQL function tg_backlink_a() line 17 at assignment
update PSlot set slotlink = 'PS.not.there' where slotname = 'PS.base.a1';
ERROR: PS.not.there does not exist
! CONTEXT: PL/pgSQL function tg_slotlink_set(character,character) line 30 at RAISE
! PL/pgSQL function tg_slotlink_a() line 17 at assignment
update PSlot set slotlink = 'XX.illegal' where slotname = 'PS.base.a1';
ERROR: illegal slotlink beginning with XX
! CONTEXT: PL/pgSQL function tg_slotlink_set(character,character) line 77 at RAISE
! PL/pgSQL function tg_slotlink_a() line 17 at assignment
insert into HSlot values ('HS', 'base.hub1', 1, '');
ERROR: duplicate key value violates unique constraint "hslot_name"
DETAIL: Key (slotname)=(HS.base.hub1.1 ) already exists.
insert into HSlot values ('HS', 'base.hub1', 20, '');
ERROR: no manual manipulation of HSlot
+ CONTEXT: PL/pgSQL function tg_hslot_biu() line 12 at RAISE
delete from HSlot;
ERROR: no manual manipulation of HSlot
+ CONTEXT: PL/pgSQL function tg_hslot_bd() line 12 at RAISE
insert into IFace values ('IF', 'notthere', 'eth0', '');
ERROR: system "notthere" does not exist
+ CONTEXT: PL/pgSQL function tg_iface_biu() line 8 at RAISE
insert into IFace values ('IF', 'orion', 'ethernet_interface_name_too_long', '');
ERROR: IFace slotname "IF.orion.ethernet_interface_name_too_long" too long (20 char max)
+ CONTEXT: PL/pgSQL function tg_iface_biu() line 14 at RAISE
--
-- The following tests are unrelated to the scenario outlined above;
-- they merely exercise specific parts of PL/pgSQL
***************
*** 1934,1941 **** begin
--- 1942,1952 ----
end$$ language plpgsql;
select trap_zero_divide(50);
NOTICE: should see this
+ CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 6 at RAISE
NOTICE: should see this only if 50 <> 0
+ CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 8 at RAISE
NOTICE: should see this only if 50 fits in smallint
+ CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 10 at RAISE
trap_zero_divide
------------------
2
***************
*** 1943,1949 **** NOTICE: should see this only if 50 fits in smallint
--- 1954,1962 ----
select trap_zero_divide(0);
NOTICE: should see this
+ CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 6 at RAISE
NOTICE: caught division_by_zero
+ CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 16 at RAISE
trap_zero_divide
------------------
-1
***************
*** 1951,1958 **** NOTICE: caught division_by_zero
--- 1964,1974 ----
select trap_zero_divide(100000);
NOTICE: should see this
+ CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 6 at RAISE
NOTICE: should see this only if 100000 <> 0
+ CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 8 at RAISE
NOTICE: caught numeric_value_out_of_range
+ CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 19 at RAISE
trap_zero_divide
------------------
-2
***************
*** 1960,1968 **** NOTICE: caught numeric_value_out_of_range
--- 1976,1988 ----
select trap_zero_divide(-100);
NOTICE: should see this
+ CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 6 at RAISE
NOTICE: should see this only if -100 <> 0
+ CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 8 at RAISE
NOTICE: should see this only if -100 fits in smallint
+ CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 10 at RAISE
ERROR: -100 is less than zero
+ CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 12 at RAISE
create function trap_matching_test(int) returns int as $$
declare x int;
sx smallint;
***************
*** 1991,1996 **** select trap_matching_test(50);
--- 2011,2017 ----
select trap_matching_test(0);
NOTICE: caught data_exception
+ CONTEXT: PL/pgSQL function trap_matching_test(integer) line 13 at RAISE
trap_matching_test
--------------------
-1
***************
*** 1998,2003 **** NOTICE: caught data_exception
--- 2019,2025 ----
select trap_matching_test(100000);
NOTICE: caught data_exception
+ CONTEXT: PL/pgSQL function trap_matching_test(integer) line 13 at RAISE
trap_matching_test
--------------------
-1
***************
*** 2005,2010 **** NOTICE: caught data_exception
--- 2027,2033 ----
select trap_matching_test(1);
NOTICE: caught numeric_value_out_of_range or cardinality_violation
+ CONTEXT: PL/pgSQL function trap_matching_test(integer) line 16 at RAISE
trap_matching_test
--------------------
-2
***************
*** 2035,2040 **** end$$ language plpgsql;
--- 2058,2064 ----
set statement_timeout to 2000;
select blockme();
NOTICE: nyeah nyeah, can't stop me
+ CONTEXT: PL/pgSQL function blockme() line 16 at RAISE
blockme
---------
20
***************
*** 2066,2078 **** begin
end$$ language plpgsql;
select test_variable_storage();
NOTICE: should see this
! CONTEXT: SQL statement "SELECT trap_zero_divide(-100)"
PL/pgSQL function test_variable_storage() line 8 at PERFORM
NOTICE: should see this only if -100 <> 0
! CONTEXT: SQL statement "SELECT trap_zero_divide(-100)"
PL/pgSQL function test_variable_storage() line 8 at PERFORM
NOTICE: should see this only if -100 fits in smallint
! CONTEXT: SQL statement "SELECT trap_zero_divide(-100)"
PL/pgSQL function test_variable_storage() line 8 at PERFORM
test_variable_storage
-----------------------
--- 2090,2105 ----
end$$ language plpgsql;
select test_variable_storage();
NOTICE: should see this
! CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 6 at RAISE
! SQL statement "SELECT trap_zero_divide(-100)"
PL/pgSQL function test_variable_storage() line 8 at PERFORM
NOTICE: should see this only if -100 <> 0
! CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 8 at RAISE
! SQL statement "SELECT trap_zero_divide(-100)"
PL/pgSQL function test_variable_storage() line 8 at PERFORM
NOTICE: should see this only if -100 fits in smallint
! CONTEXT: PL/pgSQL function trap_zero_divide(integer) line 10 at RAISE
! SQL statement "SELECT trap_zero_divide(-100)"
PL/pgSQL function test_variable_storage() line 8 at PERFORM
test_variable_storage
-----------------------
***************
*** 2119,2124 **** select trap_foreign_key(1);
--- 2146,2152 ----
select trap_foreign_key(2); -- detects FK violation
NOTICE: caught foreign_key_violation
+ CONTEXT: PL/pgSQL function trap_foreign_key(integer) line 7 at RAISE
trap_foreign_key
------------------
0
***************
*** 2139,2144 **** DETAIL: Key (f1)=(2) is not present in table "master".
--- 2167,2173 ----
rollback to x;
select trap_foreign_key_2(); -- detects FK violation
NOTICE: caught foreign_key_violation
+ CONTEXT: PL/pgSQL function trap_foreign_key_2() line 7 at RAISE
trap_foreign_key_2
--------------------
0
***************
*** 2481,2487 **** END;
--- 2510,2518 ----
$$ LANGUAGE plpgsql;
SELECT reraise_test();
NOTICE: exception syntax_error thrown in inner block, reraising
+ CONTEXT: PL/pgSQL function reraise_test() line 8 at RAISE
NOTICE: RIGHT - exception syntax_error caught in inner block
+ CONTEXT: PL/pgSQL function reraise_test() line 12 at RAISE
reraise_test
--------------
***************
*** 2576,2583 **** begin
--- 2607,2617 ----
end; $$ language plpgsql;
select execute_into_test('eifoo');
NOTICE: 10 1
+ CONTEXT: PL/pgSQL function execute_into_test(character varying) line 12 at RAISE
NOTICE: 10 15
+ CONTEXT: PL/pgSQL function execute_into_test(character varying) line 14 at RAISE
NOTICE: 10 15 20
+ CONTEXT: PL/pgSQL function execute_into_test(character varying) line 16 at RAISE
execute_into_test
-------------------
(1,2)
***************
*** 2636,2644 **** begin
--- 2670,2682 ----
end; $$ language plpgsql;
select excpt_test3();
NOTICE: caught exception P0001 user exception
+ CONTEXT: PL/pgSQL function excpt_test3() line 6 at RAISE
NOTICE: P0001 user exception
+ CONTEXT: PL/pgSQL function excpt_test3() line 8 at RAISE
NOTICE: caught exception 22012 division by zero
+ CONTEXT: PL/pgSQL function excpt_test3() line 15 at RAISE
NOTICE: P0001 user exception
+ CONTEXT: PL/pgSQL function excpt_test3() line 17 at RAISE
excpt_test3
-------------
***************
*** 2659,2664 **** begin
--- 2697,2703 ----
end;$$ language plpgsql;
select raise_exprs();
NOTICE: {10,20,30}; 20; xyz; xyzabc; (10,aaa,,30);
+ CONTEXT: PL/pgSQL function raise_exprs() line 8 at RAISE
raise_exprs
-------------
***************
*** 2750,2807 **** begin
--- 2789,2899 ----
end; $$ language plpgsql;
select continue_test1();
NOTICE: ---1---
+ CONTEXT: PL/pgSQL function continue_test1() line 4 at RAISE
NOTICE: 1
+ CONTEXT: PL/pgSQL function continue_test1() line 7 at RAISE
NOTICE: 2
+ CONTEXT: PL/pgSQL function continue_test1() line 7 at RAISE
NOTICE: 3
+ CONTEXT: PL/pgSQL function continue_test1() line 7 at RAISE
NOTICE: 4
+ CONTEXT: PL/pgSQL function continue_test1() line 7 at RAISE
NOTICE: 5
+ CONTEXT: PL/pgSQL function continue_test1() line 7 at RAISE
NOTICE: 6
+ CONTEXT: PL/pgSQL function continue_test1() line 7 at RAISE
NOTICE: 7
+ CONTEXT: PL/pgSQL function continue_test1() line 7 at RAISE
NOTICE: 8
+ CONTEXT: PL/pgSQL function continue_test1() line 7 at RAISE
NOTICE: 9
+ CONTEXT: PL/pgSQL function continue_test1() line 7 at RAISE
NOTICE: 10
+ CONTEXT: PL/pgSQL function continue_test1() line 7 at RAISE
NOTICE: ---2---
+ CONTEXT: PL/pgSQL function continue_test1() line 12 at RAISE
NOTICE: 9
+ CONTEXT: PL/pgSQL function continue_test1() line 17 at RAISE
NOTICE: 8
+ CONTEXT: PL/pgSQL function continue_test1() line 17 at RAISE
NOTICE: 7
+ CONTEXT: PL/pgSQL function continue_test1() line 17 at RAISE
NOTICE: 6
+ CONTEXT: PL/pgSQL function continue_test1() line 17 at RAISE
NOTICE: 5
+ CONTEXT: PL/pgSQL function continue_test1() line 17 at RAISE
NOTICE: 4
+ CONTEXT: PL/pgSQL function continue_test1() line 17 at RAISE
NOTICE: 3
+ CONTEXT: PL/pgSQL function continue_test1() line 17 at RAISE
NOTICE: 2
+ CONTEXT: PL/pgSQL function continue_test1() line 17 at RAISE
NOTICE: 1
+ CONTEXT: PL/pgSQL function continue_test1() line 17 at RAISE
NOTICE: 0
+ CONTEXT: PL/pgSQL function continue_test1() line 17 at RAISE
NOTICE: ---3---
+ CONTEXT: PL/pgSQL function continue_test1() line 23 at RAISE
NOTICE: 1
+ CONTEXT: PL/pgSQL function continue_test1() line 28 at RAISE
NOTICE: 3
+ CONTEXT: PL/pgSQL function continue_test1() line 28 at RAISE
NOTICE: 5
+ CONTEXT: PL/pgSQL function continue_test1() line 28 at RAISE
NOTICE: 7
+ CONTEXT: PL/pgSQL function continue_test1() line 28 at RAISE
NOTICE: 9
+ CONTEXT: PL/pgSQL function continue_test1() line 28 at RAISE
NOTICE: ---4---
+ CONTEXT: PL/pgSQL function continue_test1() line 31 at RAISE
NOTICE: 5
+ CONTEXT: PL/pgSQL function continue_test1() line 36 at RAISE
NOTICE: 6
+ CONTEXT: PL/pgSQL function continue_test1() line 36 at RAISE
NOTICE: 7
+ CONTEXT: PL/pgSQL function continue_test1() line 36 at RAISE
NOTICE: 8
+ CONTEXT: PL/pgSQL function continue_test1() line 36 at RAISE
NOTICE: 9
+ CONTEXT: PL/pgSQL function continue_test1() line 36 at RAISE
NOTICE: 10
+ CONTEXT: PL/pgSQL function continue_test1() line 36 at RAISE
NOTICE: ---5---
+ CONTEXT: PL/pgSQL function continue_test1() line 40 at RAISE
NOTICE: 30
+ CONTEXT: PL/pgSQL function continue_test1() line 43 at RAISE
NOTICE: 40
+ CONTEXT: PL/pgSQL function continue_test1() line 43 at RAISE
NOTICE: ---6---
+ CONTEXT: PL/pgSQL function continue_test1() line 46 at RAISE
NOTICE: 30
+ CONTEXT: PL/pgSQL function continue_test1() line 49 at RAISE
NOTICE: 40
+ CONTEXT: PL/pgSQL function continue_test1() line 49 at RAISE
NOTICE: ---7---
+ CONTEXT: PL/pgSQL function continue_test1() line 52 at RAISE
NOTICE: 1
+ CONTEXT: PL/pgSQL function continue_test1() line 54 at RAISE
NOTICE: 2
+ CONTEXT: PL/pgSQL function continue_test1() line 54 at RAISE
NOTICE: 3
+ CONTEXT: PL/pgSQL function continue_test1() line 54 at RAISE
NOTICE: ---8---
+ CONTEXT: PL/pgSQL function continue_test1() line 58 at RAISE
NOTICE: 1
+ CONTEXT: PL/pgSQL function continue_test1() line 61 at RAISE
NOTICE: 2
+ CONTEXT: PL/pgSQL function continue_test1() line 61 at RAISE
NOTICE: 3
+ CONTEXT: PL/pgSQL function continue_test1() line 61 at RAISE
NOTICE: ---9---
+ CONTEXT: PL/pgSQL function continue_test1() line 66 at RAISE
NOTICE: 10
+ CONTEXT: PL/pgSQL function continue_test1() line 68 at RAISE
NOTICE: ---10---
+ CONTEXT: PL/pgSQL function continue_test1() line 72 at RAISE
NOTICE: 10
+ CONTEXT: PL/pgSQL function continue_test1() line 74 at RAISE
continue_test1
----------------
***************
*** 2924,2947 **** end;
--- 3016,3058 ----
$proc$ language plpgsql;
select for_vect();
NOTICE: 1
+ CONTEXT: PL/pgSQL function for_vect() line 6 at RAISE
NOTICE: 2
+ CONTEXT: PL/pgSQL function for_vect() line 6 at RAISE
NOTICE: 3
+ CONTEXT: PL/pgSQL function for_vect() line 6 at RAISE
NOTICE: 1 BB CC
+ CONTEXT: PL/pgSQL function for_vect() line 10 at RAISE
NOTICE: 2 BB CC
+ CONTEXT: PL/pgSQL function for_vect() line 10 at RAISE
NOTICE: 3 BB CC
+ CONTEXT: PL/pgSQL function for_vect() line 10 at RAISE
NOTICE: 4 BB CC
+ CONTEXT: PL/pgSQL function for_vect() line 10 at RAISE
NOTICE: 1
+ CONTEXT: PL/pgSQL function for_vect() line 14 at RAISE
NOTICE: 2
+ CONTEXT: PL/pgSQL function for_vect() line 14 at RAISE
NOTICE: 3
+ CONTEXT: PL/pgSQL function for_vect() line 14 at RAISE
NOTICE: 4
+ CONTEXT: PL/pgSQL function for_vect() line 14 at RAISE
NOTICE: 1 BB CC
+ CONTEXT: PL/pgSQL function for_vect() line 18 at RAISE
NOTICE: 2 BB CC
+ CONTEXT: PL/pgSQL function for_vect() line 18 at RAISE
NOTICE: 3 BB CC
+ CONTEXT: PL/pgSQL function for_vect() line 18 at RAISE
NOTICE: 4 BB CC
+ CONTEXT: PL/pgSQL function for_vect() line 18 at RAISE
NOTICE: 1 bb cc
+ CONTEXT: PL/pgSQL function for_vect() line 22 at RAISE
NOTICE: 2 bb cc
+ CONTEXT: PL/pgSQL function for_vect() line 22 at RAISE
NOTICE: 3 bb cc
+ CONTEXT: PL/pgSQL function for_vect() line 22 at RAISE
NOTICE: 4 bb cc
+ CONTEXT: PL/pgSQL function for_vect() line 22 at RAISE
for_vect
----------
***************
*** 2981,2986 **** begin
--- 3092,3098 ----
end$$ language plpgsql;
select footest();
NOTICE: x.f1 = 5, x.f2 = 6
+ CONTEXT: PL/pgSQL function footest() line 6 at RAISE
footest
---------
***************
*** 3005,3010 **** begin
--- 3117,3123 ----
end$$ language plpgsql;
select footest();
NOTICE: x.f1 = 5, x.f2 = 6
+ CONTEXT: PL/pgSQL function footest() line 6 at RAISE
footest
---------
***************
*** 3019,3024 **** begin
--- 3132,3138 ----
end$$ language plpgsql;
select footest();
NOTICE: x.f1 = 7, x.f2 = 8
+ CONTEXT: PL/pgSQL function footest() line 6 at RAISE
footest
---------
***************
*** 3044,3049 **** begin
--- 3158,3164 ----
end$$ language plpgsql;
select footest();
NOTICE: x.f1 = 3, x.f2 = 4
+ CONTEXT: PL/pgSQL function footest() line 6 at RAISE
footest
---------
***************
*** 3078,3083 **** begin
--- 3193,3199 ----
end$$ language plpgsql;
select footest();
NOTICE: x.f1 = 3, x.f2 = 4
+ CONTEXT: PL/pgSQL function footest() line 6 at RAISE
footest
---------
***************
*** 3282,3290 **** end;
--- 3398,3410 ----
$$ language plpgsql;
select pl_qual_names(42);
NOTICE: param1 = 2
+ CONTEXT: PL/pgSQL function pl_qual_names(integer) line 10 at RAISE
NOTICE: pl_qual_names.param1 = 42
+ CONTEXT: PL/pgSQL function pl_qual_names(integer) line 11 at RAISE
NOTICE: outerblock.param1 = 1
+ CONTEXT: PL/pgSQL function pl_qual_names(integer) line 12 at RAISE
NOTICE: innerblock.param1 = 2
+ CONTEXT: PL/pgSQL function pl_qual_names(integer) line 13 at RAISE
pl_qual_names
---------------
***************
*** 3353,3363 **** end
--- 3473,3489 ----
$$ language plpgsql;
select exc_using(5, 'foobar');
NOTICE: 1
+ CONTEXT: PL/pgSQL function exc_using(integer,text) line 5 at RAISE
NOTICE: 2
+ CONTEXT: PL/pgSQL function exc_using(integer,text) line 5 at RAISE
NOTICE: 3
+ CONTEXT: PL/pgSQL function exc_using(integer,text) line 5 at RAISE
NOTICE: 4
+ CONTEXT: PL/pgSQL function exc_using(integer,text) line 5 at RAISE
NOTICE: 5
+ CONTEXT: PL/pgSQL function exc_using(integer,text) line 5 at RAISE
NOTICE: 6
+ CONTEXT: PL/pgSQL function exc_using(integer,text) line 5 at RAISE
exc_using
-----------
26
***************
*** 3381,3391 **** end;
--- 3507,3523 ----
$$ language plpgsql;
select exc_using(5);
NOTICE: 1
+ CONTEXT: PL/pgSQL function exc_using(integer) line 10 at RAISE
NOTICE: 2
+ CONTEXT: PL/pgSQL function exc_using(integer) line 10 at RAISE
NOTICE: 3
+ CONTEXT: PL/pgSQL function exc_using(integer) line 10 at RAISE
NOTICE: 4
+ CONTEXT: PL/pgSQL function exc_using(integer) line 10 at RAISE
NOTICE: 5
+ CONTEXT: PL/pgSQL function exc_using(integer) line 10 at RAISE
NOTICE: 6
+ CONTEXT: PL/pgSQL function exc_using(integer) line 10 at RAISE
exc_using
-----------
***************
*** 3430,3451 **** end;
--- 3562,3600 ----
$$ language plpgsql;
select forc01();
NOTICE: 5 from c
+ CONTEXT: PL/pgSQL function forc01() line 9 at RAISE
NOTICE: 6 from c
+ CONTEXT: PL/pgSQL function forc01() line 9 at RAISE
NOTICE: 7 from c
+ CONTEXT: PL/pgSQL function forc01() line 9 at RAISE
NOTICE: 9 from c
+ CONTEXT: PL/pgSQL function forc01() line 13 at RAISE
NOTICE: 10 from c
+ CONTEXT: PL/pgSQL function forc01() line 13 at RAISE
NOTICE: 41 from c2
+ CONTEXT: PL/pgSQL function forc01() line 17 at RAISE
NOTICE: 42 from c2
+ CONTEXT: PL/pgSQL function forc01() line 17 at RAISE
NOTICE: 43 from c2
+ CONTEXT: PL/pgSQL function forc01() line 17 at RAISE
NOTICE: after loop, c2 = c2
+ CONTEXT: PL/pgSQL function forc01() line 20 at RAISE
NOTICE: 41 from special_name
+ CONTEXT: PL/pgSQL function forc01() line 23 at RAISE
NOTICE: 42 from special_name
+ CONTEXT: PL/pgSQL function forc01() line 23 at RAISE
NOTICE: 43 from special_name
+ CONTEXT: PL/pgSQL function forc01() line 23 at RAISE
NOTICE: after loop, c2 = special_name
+ CONTEXT: PL/pgSQL function forc01() line 25 at RAISE
NOTICE: 41
+ CONTEXT: PL/pgSQL function forc01() line 30 at RAISE
NOTICE: 42
+ CONTEXT: PL/pgSQL function forc01() line 30 at RAISE
NOTICE: 43
+ CONTEXT: PL/pgSQL function forc01() line 30 at RAISE
NOTICE: after loop, c2 =
+ CONTEXT: PL/pgSQL function forc01() line 32 at RAISE
forc01
--------
***************
*** 3466,3480 **** end;
--- 3615,3639 ----
$$ language plpgsql;
select forc01();
NOTICE: 1, 1
+ CONTEXT: PL/pgSQL function forc01() line 6 at RAISE
NOTICE: 2, 2
+ CONTEXT: PL/pgSQL function forc01() line 6 at RAISE
NOTICE: 3, 3
+ CONTEXT: PL/pgSQL function forc01() line 6 at RAISE
NOTICE: 4, 4
+ CONTEXT: PL/pgSQL function forc01() line 6 at RAISE
NOTICE: 5, 5
+ CONTEXT: PL/pgSQL function forc01() line 6 at RAISE
NOTICE: 6, 6
+ CONTEXT: PL/pgSQL function forc01() line 6 at RAISE
NOTICE: 7, 7
+ CONTEXT: PL/pgSQL function forc01() line 6 at RAISE
NOTICE: 8, 8
+ CONTEXT: PL/pgSQL function forc01() line 6 at RAISE
NOTICE: 9, 9
+ CONTEXT: PL/pgSQL function forc01() line 6 at RAISE
NOTICE: 10, 10
+ CONTEXT: PL/pgSQL function forc01() line 6 at RAISE
forc01
--------
***************
*** 3512,3526 **** end;
--- 3671,3695 ----
$$ language plpgsql;
select forc01();
NOTICE: 100, 2
+ CONTEXT: PL/pgSQL function forc01() line 10 at RAISE
NOTICE: 200, 4
+ CONTEXT: PL/pgSQL function forc01() line 10 at RAISE
NOTICE: 300, 6
+ CONTEXT: PL/pgSQL function forc01() line 10 at RAISE
NOTICE: 400, 8
+ CONTEXT: PL/pgSQL function forc01() line 10 at RAISE
NOTICE: 500, 10
+ CONTEXT: PL/pgSQL function forc01() line 10 at RAISE
NOTICE: 600, 12
+ CONTEXT: PL/pgSQL function forc01() line 10 at RAISE
NOTICE: 700, 14
+ CONTEXT: PL/pgSQL function forc01() line 10 at RAISE
NOTICE: 800, 16
+ CONTEXT: PL/pgSQL function forc01() line 10 at RAISE
NOTICE: 900, 18
+ CONTEXT: PL/pgSQL function forc01() line 10 at RAISE
NOTICE: 1000, 20
+ CONTEXT: PL/pgSQL function forc01() line 10 at RAISE
forc01
--------
***************
*** 3769,3776 **** select raise_test();
--- 3938,3947 ----
NOTICE: 1 2 3
DETAIL: some detail info
HINT: some hint
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
ERROR: 1 2 3
DETAIL: some detail info
+ CONTEXT: PL/pgSQL function raise_test() line 5 at RAISE
-- Since we can't actually see the thrown SQLSTATE in default psql output,
-- test it like this; this also tests re-RAISE
create or replace function raise_test() returns void as $$
***************
*** 3785,3792 **** end;
--- 3956,3965 ----
$$ language plpgsql;
select raise_test();
NOTICE: SQLSTATE: 22012 SQLERRM: check me
+ CONTEXT: PL/pgSQL function raise_test() line 7 at RAISE
ERROR: check me
DETAIL: some detail info
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
create or replace function raise_test() returns void as $$
begin
raise 'check me'
***************
*** 3799,3806 **** end;
--- 3972,3981 ----
$$ language plpgsql;
select raise_test();
NOTICE: SQLSTATE: 1234F SQLERRM: check me
+ CONTEXT: PL/pgSQL function raise_test() line 7 at RAISE
ERROR: check me
DETAIL: some detail info
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
-- SQLSTATE specification in WHEN
create or replace function raise_test() returns void as $$
begin
***************
*** 3814,3821 **** end;
--- 3989,3998 ----
$$ language plpgsql;
select raise_test();
NOTICE: SQLSTATE: 1234F SQLERRM: check me
+ CONTEXT: PL/pgSQL function raise_test() line 7 at RAISE
ERROR: check me
DETAIL: some detail info
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
create or replace function raise_test() returns void as $$
begin
raise division_by_zero using detail = 'some detail info';
***************
*** 3827,3834 **** end;
--- 4004,4013 ----
$$ language plpgsql;
select raise_test();
NOTICE: SQLSTATE: 22012 SQLERRM: division_by_zero
+ CONTEXT: PL/pgSQL function raise_test() line 6 at RAISE
ERROR: division_by_zero
DETAIL: some detail info
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
create or replace function raise_test() returns void as $$
begin
raise division_by_zero;
***************
*** 3836,3841 **** end;
--- 4015,4021 ----
$$ language plpgsql;
select raise_test();
ERROR: division_by_zero
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
create or replace function raise_test() returns void as $$
begin
raise sqlstate '1234F';
***************
*** 3843,3848 **** end;
--- 4023,4029 ----
$$ language plpgsql;
select raise_test();
ERROR: 1234F
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
create or replace function raise_test() returns void as $$
begin
raise division_by_zero using message = 'custom' || ' message';
***************
*** 3850,3855 **** end;
--- 4031,4037 ----
$$ language plpgsql;
select raise_test();
ERROR: custom message
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
create or replace function raise_test() returns void as $$
begin
raise using message = 'custom' || ' message', errcode = '22012';
***************
*** 3857,3862 **** end;
--- 4039,4045 ----
$$ language plpgsql;
select raise_test();
ERROR: custom message
+ CONTEXT: PL/pgSQL function raise_test() line 3 at RAISE
-- conflict on message
create or replace function raise_test() returns void as $$
begin
***************
*** 3915,3920 **** end;
--- 4098,4104 ----
$$ language plpgsql;
select stacked_diagnostics_test();
NOTICE: sqlstate: 22012, message: division by zero, context: [PL/pgSQL function zero_divide() line 4 at RETURN <- SQL statement "SELECT zero_divide()" <- PL/pgSQL function stacked_diagnostics_test() line 6 at PERFORM]
+ CONTEXT: PL/pgSQL function stacked_diagnostics_test() line 12 at RAISE
stacked_diagnostics_test
--------------------------
***************
*** 3936,3941 **** end;
--- 4120,4126 ----
$$ language plpgsql;
select stacked_diagnostics_test();
NOTICE: message: custom exception, detail: some detail of custom exception, hint: some hint related to custom exception
+ CONTEXT: PL/pgSQL function stacked_diagnostics_test() line 12 at RAISE
stacked_diagnostics_test
--------------------------
***************
*** 3972,3978 **** end;
--- 4157,4165 ----
$$ language plpgsql;
select raise_test();
NOTICE: 22012
+ CONTEXT: PL/pgSQL function raise_test() line 6 at RAISE
ERROR: substitute message
+ CONTEXT: PL/pgSQL function raise_test() line 7 at RAISE
drop function raise_test();
-- test passing column_name, constraint_name, datatype_name, table_name
-- and schema_name error fields
***************
*** 4002,4007 **** end;
--- 4189,4195 ----
$$ language plpgsql;
select stacked_diagnostics_test();
NOTICE: column >>some column name<<, constraint >>some constraint name<<, type >>some datatype name<<, table >>some table name<<, schema >>some schema name<<
+ CONTEXT: PL/pgSQL function stacked_diagnostics_test() line 21 at RAISE
stacked_diagnostics_test
--------------------------
***************
*** 4093,4098 **** end
--- 4281,4287 ----
$$ language plpgsql;
select catch();
NOTICE: caught case_not_found 20000 case not found
+ CONTEXT: PL/pgSQL function catch() line 6 at RAISE
catch
-------
***************
*** 4148,4157 **** begin
--- 4337,4351 ----
$$ language plpgsql;
select vari(1,2,3,4,5);
NOTICE: 1
+ CONTEXT: PL/pgSQL function vari(integer[]) line 4 at RAISE
NOTICE: 2
+ CONTEXT: PL/pgSQL function vari(integer[]) line 4 at RAISE
NOTICE: 3
+ CONTEXT: PL/pgSQL function vari(integer[]) line 4 at RAISE
NOTICE: 4
+ CONTEXT: PL/pgSQL function vari(integer[]) line 4 at RAISE
NOTICE: 5
+ CONTEXT: PL/pgSQL function vari(integer[]) line 4 at RAISE
vari
------
***************
*** 4159,4166 **** NOTICE: 5
--- 4353,4363 ----
select vari(3,4,5);
NOTICE: 3
+ CONTEXT: PL/pgSQL function vari(integer[]) line 4 at RAISE
NOTICE: 4
+ CONTEXT: PL/pgSQL function vari(integer[]) line 4 at RAISE
NOTICE: 5
+ CONTEXT: PL/pgSQL function vari(integer[]) line 4 at RAISE
vari
------
***************
*** 4168,4175 **** NOTICE: 5
--- 4365,4375 ----
select vari(variadic array[5,6,7]);
NOTICE: 5
+ CONTEXT: PL/pgSQL function vari(integer[]) line 4 at RAISE
NOTICE: 6
+ CONTEXT: PL/pgSQL function vari(integer[]) line 4 at RAISE
NOTICE: 7
+ CONTEXT: PL/pgSQL function vari(integer[]) line 4 at RAISE
vari
------
***************
*** 4221,4226 **** end;
--- 4421,4427 ----
$$ language plpgsql immutable strict;
select pleast(10);
NOTICE: non-variadic function called
+ CONTEXT: PL/pgSQL function pleast(numeric) line 3 at RAISE
pleast
--------
10
***************
*** 4280,4288 **** end;
--- 4481,4493 ----
$$ language plpgsql;
select * from rttest();
NOTICE: t 2
+ CONTEXT: PL/pgSQL function rttest() line 6 at RAISE
NOTICE: f 0
+ CONTEXT: PL/pgSQL function rttest() line 9 at RAISE
NOTICE: t 2
+ CONTEXT: PL/pgSQL function rttest() line 12 at RAISE
NOTICE: f 0
+ CONTEXT: PL/pgSQL function rttest() line 15 at RAISE
rttest
--------
10
***************
*** 4458,4463 **** LINE 4: return 'foo\\bar\041baz';
--- 4663,4669 ----
HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
select strtest();
NOTICE: foo\bar!baz
+ CONTEXT: PL/pgSQL function strtest() line 3 at RAISE
WARNING: nonstandard use of \\ in a string literal
LINE 1: SELECT 'foo\\bar\041baz'
^
***************
*** 4477,4482 **** end
--- 4683,4689 ----
$$ language plpgsql;
select strtest();
NOTICE: foo\bar!baz
+ CONTEXT: PL/pgSQL function strtest() line 3 at RAISE
strtest
-------------
foo\bar!baz
***************
*** 4491,4496 **** end
--- 4698,4704 ----
$$ language plpgsql;
select strtest();
NOTICE: foo\\bar\041baz\
+ CONTEXT: PL/pgSQL function strtest() line 3 at RAISE
strtest
------------------
foo\\bar\041baz\
***************
*** 4504,4509 **** end
--- 4712,4718 ----
$$ language plpgsql;
select strtest();
NOTICE: foo\bar!baz
+ CONTEXT: PL/pgSQL function strtest() line 3 at RAISE
strtest
-------------
foo\bar!baz
***************
*** 4520,4534 **** BEGIN
--- 4729,4753 ----
END LOOP;
END$$;
NOTICE: 001, Entrance
+ CONTEXT: PL/pgSQL function inline_code_block line 6 at RAISE
NOTICE: 002, Office
+ CONTEXT: PL/pgSQL function inline_code_block line 6 at RAISE
NOTICE: 003, Office
+ CONTEXT: PL/pgSQL function inline_code_block line 6 at RAISE
NOTICE: 004, Technical
+ CONTEXT: PL/pgSQL function inline_code_block line 6 at RAISE
NOTICE: 101, Office
+ CONTEXT: PL/pgSQL function inline_code_block line 6 at RAISE
NOTICE: 102, Conference
+ CONTEXT: PL/pgSQL function inline_code_block line 6 at RAISE
NOTICE: 103, Restroom
+ CONTEXT: PL/pgSQL function inline_code_block line 6 at RAISE
NOTICE: 104, Technical
+ CONTEXT: PL/pgSQL function inline_code_block line 6 at RAISE
NOTICE: 105, Office
+ CONTEXT: PL/pgSQL function inline_code_block line 6 at RAISE
NOTICE: 106, Office
+ CONTEXT: PL/pgSQL function inline_code_block line 6 at RAISE
-- these are to check syntax error reporting
DO LANGUAGE plpgsql $$begin return 1; end$$;
ERROR: RETURN cannot have a parameter in function returning void
***************
*** 4656,4664 **** begin
--- 4875,4887 ----
$$ language plpgsql;
select foreach_test(ARRAY[1,2,3,4]);
NOTICE: 1
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: 2
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: 3
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: 4
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
foreach_test
--------------
***************
*** 4666,4674 **** NOTICE: 4
--- 4889,4901 ----
select foreach_test(ARRAY[[1,2],[3,4]]);
NOTICE: 1
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: 2
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: 3
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: 4
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
foreach_test
--------------
***************
*** 4703,4708 **** begin
--- 4930,4936 ----
$$ language plpgsql;
select foreach_test(ARRAY[1,2,3,4]);
NOTICE: {1,2,3,4}
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
foreach_test
--------------
***************
*** 4710,4716 **** NOTICE: {1,2,3,4}
--- 4938,4946 ----
select foreach_test(ARRAY[[1,2],[3,4]]);
NOTICE: {1,2}
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: {3,4}
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
foreach_test
--------------
***************
*** 4734,4739 **** CONTEXT: PL/pgSQL function foreach_test(anyarray) line 4 at FOREACH over array
--- 4964,4970 ----
-- ok
select foreach_test(ARRAY[[1,2],[3,4]]);
NOTICE: {{1,2},{3,4}}
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
foreach_test
--------------
***************
*** 4741,4747 **** NOTICE: {{1,2},{3,4}}
--- 4972,4980 ----
select foreach_test(ARRAY[[[1,2]],[[3,4]]]);
NOTICE: {{1,2}}
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: {{3,4}}
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
foreach_test
--------------
***************
*** 4761,4768 **** begin
--- 4994,5004 ----
$$ language plpgsql;
select foreach_test(ARRAY[(10,20),(40,69),(35,78)]::xy_tuple[]);
NOTICE: (10,20)
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: (40,69)
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: (35,78)
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
foreach_test
--------------
***************
*** 4770,4778 **** NOTICE: (35,78)
--- 5006,5018 ----
select foreach_test(ARRAY[[(10,20),(40,69)],[(35,78),(88,76)]]::xy_tuple[]);
NOTICE: (10,20)
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: (40,69)
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: (35,78)
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: (88,76)
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
foreach_test
--------------
***************
*** 4790,4797 **** begin
--- 5030,5040 ----
$$ language plpgsql;
select foreach_test(ARRAY[(10,20),(40,69),(35,78)]::xy_tuple[]);
NOTICE: x = 10, y = 20
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: x = 40, y = 69
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: x = 35, y = 78
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
foreach_test
--------------
***************
*** 4799,4807 **** NOTICE: x = 35, y = 78
--- 5042,5054 ----
select foreach_test(ARRAY[[(10,20),(40,69)],[(35,78),(88,76)]]::xy_tuple[]);
NOTICE: x = 10, y = 20
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: x = 40, y = 69
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: x = 35, y = 78
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: x = 88, y = 76
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
foreach_test
--------------
***************
*** 4820,4825 **** begin
--- 5067,5073 ----
$$ language plpgsql;
select foreach_test(ARRAY[(10,20),(40,69),(35,78)]::xy_tuple[]);
NOTICE: {"(10,20)","(40,69)","(35,78)"}
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
foreach_test
--------------
***************
*** 4827,4833 **** NOTICE: {"(10,20)","(40,69)","(35,78)"}
--- 5075,5083 ----
select foreach_test(ARRAY[[(10,20),(40,69)],[(35,78),(88,76)]]::xy_tuple[]);
NOTICE: {"(10,20)","(40,69)"}
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
NOTICE: {"(35,78)","(88,76)"}
+ CONTEXT: PL/pgSQL function foreach_test(anyarray) line 6 at RAISE
foreach_test
--------------
***************
*** 4935,4958 **** end;
$$ language plpgsql;
select outer_outer_func(10);
NOTICE: calling down into outer_func()
NOTICE: calling down into inner_func()
! CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 4 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 7 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: lets make sure we didnt break anything
! CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: inner_func() done
! CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: outer_func() done
outer_outer_func
------------------
20
--- 5185,5215 ----
$$ language plpgsql;
select outer_outer_func(10);
NOTICE: calling down into outer_func()
+ CONTEXT: PL/pgSQL function outer_outer_func(integer) line 5 at RAISE
NOTICE: calling down into inner_func()
! CONTEXT: PL/pgSQL function outer_func(integer) line 5 at RAISE
! PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 4 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function inner_func(integer) line 5 at RAISE
! PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 7 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function inner_func(integer) line 8 at RAISE
! PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: lets make sure we didnt break anything
! CONTEXT: PL/pgSQL function inner_func(integer) line 9 at RAISE
! PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: inner_func() done
! CONTEXT: PL/pgSQL function outer_func(integer) line 7 at RAISE
! PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: outer_func() done
+ CONTEXT: PL/pgSQL function outer_outer_func(integer) line 7 at RAISE
outer_outer_func
------------------
20
***************
*** 4961,4984 **** NOTICE: outer_func() done
-- repeated call should to work
select outer_outer_func(20);
NOTICE: calling down into outer_func()
NOTICE: calling down into inner_func()
! CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 4 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 7 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: lets make sure we didnt break anything
! CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: inner_func() done
! CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: outer_func() done
outer_outer_func
------------------
40
--- 5218,5248 ----
-- repeated call should to work
select outer_outer_func(20);
NOTICE: calling down into outer_func()
+ CONTEXT: PL/pgSQL function outer_outer_func(integer) line 5 at RAISE
NOTICE: calling down into inner_func()
! CONTEXT: PL/pgSQL function outer_func(integer) line 5 at RAISE
! PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 4 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function inner_func(integer) line 5 at RAISE
! PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 7 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function inner_func(integer) line 8 at RAISE
! PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: lets make sure we didnt break anything
! CONTEXT: PL/pgSQL function inner_func(integer) line 9 at RAISE
! PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: inner_func() done
! CONTEXT: PL/pgSQL function outer_func(integer) line 7 at RAISE
! PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: outer_func() done
+ CONTEXT: PL/pgSQL function outer_outer_func(integer) line 7 at RAISE
outer_outer_func
------------------
40
***************
*** 5033,5056 **** end;
$$ language plpgsql;
select outer_outer_func(10);
NOTICE: calling down into outer_func()
NOTICE: calling down into inner_func()
! CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 10 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 15 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: lets make sure we didnt break anything
! CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: inner_func() done
! CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: outer_func() done
outer_outer_func
------------------
20
--- 5297,5327 ----
$$ language plpgsql;
select outer_outer_func(10);
NOTICE: calling down into outer_func()
+ CONTEXT: PL/pgSQL function outer_outer_func(integer) line 5 at RAISE
NOTICE: calling down into inner_func()
! CONTEXT: PL/pgSQL function outer_func(integer) line 5 at RAISE
! PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 10 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function inner_func(integer) line 11 at RAISE
! PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 15 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function inner_func(integer) line 16 at RAISE
! PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: lets make sure we didnt break anything
! CONTEXT: PL/pgSQL function inner_func(integer) line 17 at RAISE
! PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: inner_func() done
! CONTEXT: PL/pgSQL function outer_func(integer) line 7 at RAISE
! PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: outer_func() done
+ CONTEXT: PL/pgSQL function outer_outer_func(integer) line 7 at RAISE
outer_outer_func
------------------
20
***************
*** 5059,5082 **** NOTICE: outer_func() done
-- repeated call should to work
select outer_outer_func(20);
NOTICE: calling down into outer_func()
NOTICE: calling down into inner_func()
! CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 10 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 15 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: lets make sure we didnt break anything
! CONTEXT: PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: inner_func() done
! CONTEXT: PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: outer_func() done
outer_outer_func
------------------
40
--- 5330,5360 ----
-- repeated call should to work
select outer_outer_func(20);
NOTICE: calling down into outer_func()
+ CONTEXT: PL/pgSQL function outer_outer_func(integer) line 5 at RAISE
NOTICE: calling down into inner_func()
! CONTEXT: PL/pgSQL function outer_func(integer) line 5 at RAISE
! PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 10 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function inner_func(integer) line 11 at RAISE
! PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: ***PL/pgSQL function inner_func(integer) line 15 at GET DIAGNOSTICS
PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment***
! CONTEXT: PL/pgSQL function inner_func(integer) line 16 at RAISE
! PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: lets make sure we didnt break anything
! CONTEXT: PL/pgSQL function inner_func(integer) line 17 at RAISE
! PL/pgSQL function outer_func(integer) line 6 at assignment
PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: inner_func() done
! CONTEXT: PL/pgSQL function outer_func(integer) line 7 at RAISE
! PL/pgSQL function outer_outer_func(integer) line 6 at assignment
NOTICE: outer_func() done
+ CONTEXT: PL/pgSQL function outer_outer_func(integer) line 7 at RAISE
outer_outer_func
------------------
40
*** a/src/test/regress/expected/polymorphism.out
--- b/src/test/regress/expected/polymorphism.out
***************
*** 555,564 **** select case when $1 then $2 else $3 end $$ language sql;
--- 555,569 ----
-- if the CASE expression were not successfully inlined
select f1, sql_if(f1 > 0, bleat(f1), bleat(f1 + 1)) from int4_tbl;
NOTICE: bleat 1
+ CONTEXT: PL/pgSQL function bleat(integer) line 3 at RAISE
NOTICE: bleat 123456
+ CONTEXT: PL/pgSQL function bleat(integer) line 3 at RAISE
NOTICE: bleat -123455
+ CONTEXT: PL/pgSQL function bleat(integer) line 3 at RAISE
NOTICE: bleat 2147483647
+ CONTEXT: PL/pgSQL function bleat(integer) line 3 at RAISE
NOTICE: bleat -2147483646
+ CONTEXT: PL/pgSQL function bleat(integer) line 3 at RAISE
f1 | sql_if
-------------+-------------
0 | 1
*** a/src/test/regress/expected/rangefuncs.out
--- b/src/test/regress/expected/rangefuncs.out
***************
*** 1366,1374 **** create trigger tnoticetrigger after insert on tt for each row
execute procedure noticetrigger();
select insert_tt2('foolme','barme') limit 1;
NOTICE: noticetrigger 11 foolme
! CONTEXT: SQL function "insert_tt2" statement 1
NOTICE: noticetrigger 12 barme
! CONTEXT: SQL function "insert_tt2" statement 1
insert_tt2
------------
11
--- 1366,1376 ----
execute procedure noticetrigger();
select insert_tt2('foolme','barme') limit 1;
NOTICE: noticetrigger 11 foolme
! CONTEXT: PL/pgSQL function noticetrigger() line 3 at RAISE
! SQL function "insert_tt2" statement 1
NOTICE: noticetrigger 12 barme
! CONTEXT: PL/pgSQL function noticetrigger() line 3 at RAISE
! SQL function "insert_tt2" statement 1
insert_tt2
------------
11
***************
*** 1397,1405 **** create rule insert_tt_rule as on insert to tt do also
insert into tt_log values(new.*);
select insert_tt2('foollog','barlog') limit 1;
NOTICE: noticetrigger 13 foollog
! CONTEXT: SQL function "insert_tt2" statement 1
NOTICE: noticetrigger 14 barlog
! CONTEXT: SQL function "insert_tt2" statement 1
insert_tt2
------------
13
--- 1399,1409 ----
insert into tt_log values(new.*);
select insert_tt2('foollog','barlog') limit 1;
NOTICE: noticetrigger 13 foollog
! CONTEXT: PL/pgSQL function noticetrigger() line 3 at RAISE
! SQL function "insert_tt2" statement 1
NOTICE: noticetrigger 14 barlog
! CONTEXT: PL/pgSQL function noticetrigger() line 3 at RAISE
! SQL function "insert_tt2" statement 1
insert_tt2
------------
13
*** a/src/test/regress/expected/select_views.out
--- b/src/test/regress/expected/select_views.out
***************
*** 467,472 **** SELECT name, #thepath FROM iexit ORDER BY 1, 2;
--- 467,486 ----
I- 580 | 21
I- 580 | 22
I- 580 | 22
+ I- 580/I-680 Ramp | 2
+ I- 580/I-680 Ramp | 2
+ I- 580/I-680 Ramp | 2
+ I- 580/I-680 Ramp | 2
+ I- 580/I-680 Ramp | 2
+ I- 580/I-680 Ramp | 2
+ I- 580/I-680 Ramp | 4
+ I- 580/I-680 Ramp | 4
+ I- 580/I-680 Ramp | 4
+ I- 580/I-680 Ramp | 4
+ I- 580/I-680 Ramp | 5
+ I- 580/I-680 Ramp | 6
+ I- 580/I-680 Ramp | 6
+ I- 580/I-680 Ramp | 6
I- 580 Ramp | 2
I- 580 Ramp | 2
I- 580 Ramp | 2
***************
*** 717,736 **** SELECT name, #thepath FROM iexit ORDER BY 1, 2;
I- 580 Ramp | 8
I- 580 Ramp | 8
I- 580 Ramp | 8
- I- 580/I-680 Ramp | 2
- I- 580/I-680 Ramp | 2
- I- 580/I-680 Ramp | 2
- I- 580/I-680 Ramp | 2
- I- 580/I-680 Ramp | 2
- I- 580/I-680 Ramp | 2
- I- 580/I-680 Ramp | 4
- I- 580/I-680 Ramp | 4
- I- 580/I-680 Ramp | 4
- I- 580/I-680 Ramp | 4
- I- 580/I-680 Ramp | 5
- I- 580/I-680 Ramp | 6
- I- 580/I-680 Ramp | 6
- I- 580/I-680 Ramp | 6
I- 680 | 2
I- 680 | 2
I- 680 | 2
--- 731,736 ----
***************
*** 1318,1325 **** SET SESSION AUTHORIZATION regress_alice;
--- 1318,1328 ----
--
SELECT * FROM my_property_normal WHERE f_leak(passwd);
NOTICE: f_leak => passwd123
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
NOTICE: f_leak => beafsteak
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
NOTICE: f_leak => hamburger
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
cid | name | tel | passwd
-----+---------------+------------------+-----------
101 | regress_alice | +81-12-3456-7890 | passwd123
***************
*** 1334,1339 **** EXPLAIN (COSTS OFF) SELECT * FROM my_property_normal WHERE f_leak(passwd);
--- 1337,1343 ----
SELECT * FROM my_property_secure WHERE f_leak(passwd);
NOTICE: f_leak => passwd123
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
cid | name | tel | passwd
-----+---------------+------------------+-----------
101 | regress_alice | +81-12-3456-7890 | passwd123
***************
*** 1355,1362 **** EXPLAIN (COSTS OFF) SELECT * FROM my_property_secure WHERE f_leak(passwd);
--- 1359,1369 ----
--
SELECT * FROM my_credit_card_normal WHERE f_leak(cnum);
NOTICE: f_leak => 1111-2222-3333-4444
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
NOTICE: f_leak => 5555-6666-7777-8888
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
NOTICE: f_leak => 9801-2345-6789-0123
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
cid | name | tel | passwd | cnum | climit
-----+---------------+------------------+-----------+---------------------+--------
101 | regress_alice | +81-12-3456-7890 | passwd123 | 1111-2222-3333-4444 | 4000
***************
*** 1376,1381 **** EXPLAIN (COSTS OFF) SELECT * FROM my_credit_card_normal WHERE f_leak(cnum);
--- 1383,1389 ----
SELECT * FROM my_credit_card_secure WHERE f_leak(cnum);
NOTICE: f_leak => 1111-2222-3333-4444
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
cid | name | tel | passwd | cnum | climit
-----+---------------+------------------+-----------+---------------------+--------
101 | regress_alice | +81-12-3456-7890 | passwd123 | 1111-2222-3333-4444 | 4000
***************
*** 1402,1407 **** EXPLAIN (COSTS OFF) SELECT * FROM my_credit_card_secure WHERE f_leak(cnum);
--- 1410,1416 ----
SELECT * FROM my_credit_card_usage_normal
WHERE f_leak(cnum) AND ymd >= '2011-10-01' AND ymd < '2011-11-01';
NOTICE: f_leak => 1111-2222-3333-4444
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
cid | name | tel | passwd | cnum | climit | ymd | usage
-----+---------------+------------------+-----------+---------------------+--------+------------+-------
101 | regress_alice | +81-12-3456-7890 | passwd123 | 1111-2222-3333-4444 | 4000 | 10-05-2011 | 90
***************
*** 1431,1438 **** EXPLAIN (COSTS OFF) SELECT * FROM my_credit_card_usage_normal
--- 1440,1450 ----
SELECT * FROM my_credit_card_usage_secure
WHERE f_leak(cnum) AND ymd >= '2011-10-01' AND ymd < '2011-11-01';
NOTICE: f_leak => 1111-2222-3333-4444
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
NOTICE: f_leak => 1111-2222-3333-4444
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
NOTICE: f_leak => 1111-2222-3333-4444
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
cid | name | tel | passwd | cnum | climit | ymd | usage
-----+---------------+------------------+-----------+---------------------+--------+------------+-------
101 | regress_alice | +81-12-3456-7890 | passwd123 | 1111-2222-3333-4444 | 4000 | 10-05-2011 | 90
***************
*** 1467,1474 **** PREPARE p1 AS SELECT * FROM my_property_normal WHERE f_leak(passwd);
--- 1479,1489 ----
PREPARE p2 AS SELECT * FROM my_property_secure WHERE f_leak(passwd);
EXECUTE p1;
NOTICE: f_leak => passwd123
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
NOTICE: f_leak => beafsteak
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
NOTICE: f_leak => hamburger
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
cid | name | tel | passwd
-----+---------------+------------------+-----------
101 | regress_alice | +81-12-3456-7890 | passwd123
***************
*** 1476,1481 **** NOTICE: f_leak => hamburger
--- 1491,1497 ----
EXECUTE p2;
NOTICE: f_leak => passwd123
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
cid | name | tel | passwd
-----+---------------+------------------+-----------
101 | regress_alice | +81-12-3456-7890 | passwd123
***************
*** 1487,1492 **** ALTER VIEW my_property_secure SET (security_barrier=false);
--- 1503,1509 ----
SET SESSION AUTHORIZATION regress_alice;
EXECUTE p1; -- To be perform as a view with security-barrier
NOTICE: f_leak => passwd123
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
cid | name | tel | passwd
-----+---------------+------------------+-----------
101 | regress_alice | +81-12-3456-7890 | passwd123
***************
*** 1494,1501 **** NOTICE: f_leak => passwd123
--- 1511,1521 ----
EXECUTE p2; -- To be perform as a view without security-barrier
NOTICE: f_leak => passwd123
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
NOTICE: f_leak => beafsteak
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
NOTICE: f_leak => hamburger
+ CONTEXT: PL/pgSQL function f_leak(text) line 1 at RAISE
cid | name | tel | passwd
-----+---------------+------------------+-----------
101 | regress_alice | +81-12-3456-7890 | passwd123
*** a/src/test/regress/expected/triggers.out
--- b/src/test/regress/expected/triggers.out
***************
*** 295,314 **** CREATE TRIGGER after_upd_row_trig AFTER UPDATE ON main_table
--- 295,324 ----
FOR EACH ROW EXECUTE PROCEDURE trigger_func('after_upd_row');
INSERT INTO main_table DEFAULT VALUES;
NOTICE: trigger_func(before_ins_stmt) called: action = INSERT, when = BEFORE, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_ins_stmt) called: action = INSERT, when = AFTER, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
UPDATE main_table SET a = a + 1 WHERE b < 30;
NOTICE: trigger_func(after_upd_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
-- UPDATE that effects zero rows should still call per-statement trigger
UPDATE main_table SET a = a + 2 WHERE b > 100;
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
-- COPY should fire per-row and per-statement INSERT triggers
COPY main_table (a, b) FROM stdin;
NOTICE: trigger_func(before_ins_stmt) called: action = INSERT, when = BEFORE, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_ins_stmt) called: action = INSERT, when = AFTER, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
SELECT * FROM main_table ORDER BY a, b;
a | b
----+----
***************
*** 339,366 **** CREATE TRIGGER delete_when AFTER DELETE ON main_table
--- 349,396 ----
FOR EACH STATEMENT WHEN (true) EXECUTE PROCEDURE trigger_func('delete_when');
INSERT INTO main_table (a) VALUES (123), (456);
NOTICE: trigger_func(before_ins_stmt) called: action = INSERT, when = BEFORE, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(insert_when) called: action = INSERT, when = BEFORE, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(insert_a) called: action = INSERT, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_ins_stmt) called: action = INSERT, when = AFTER, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
COPY main_table FROM stdin;
NOTICE: trigger_func(before_ins_stmt) called: action = INSERT, when = BEFORE, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(insert_when) called: action = INSERT, when = BEFORE, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(insert_a) called: action = INSERT, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_ins_stmt) called: action = INSERT, when = AFTER, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
DELETE FROM main_table WHERE a IN (123, 456);
NOTICE: trigger_func(delete_a) called: action = DELETE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(delete_a) called: action = DELETE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(delete_when) called: action = DELETE, when = AFTER, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
UPDATE main_table SET a = 50, b = 60;
NOTICE: trigger_func(modified_any) called: action = UPDATE, when = BEFORE, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(modified_any) called: action = UPDATE, when = BEFORE, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(modified_a) called: action = UPDATE, when = BEFORE, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(modified_a) called: action = UPDATE, when = BEFORE, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(modified_a) called: action = UPDATE, when = BEFORE, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(modified_a) called: action = UPDATE, when = BEFORE, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(modified_a) called: action = UPDATE, when = BEFORE, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
SELECT * FROM main_table ORDER BY a, b;
a | b
----+----
***************
*** 418,451 **** SELECT pg_get_triggerdef(oid) FROM pg_trigger WHERE tgrelid = 'main_table'::regc
--- 448,509 ----
UPDATE main_table SET a = 50;
NOTICE: trigger_func(before_upd_a_stmt) called: action = UPDATE, when = BEFORE, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
UPDATE main_table SET b = 10;
NOTICE: trigger_func(after_upd_a_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_a_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_a_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_a_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_a_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_a_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_a_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_a_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_b_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
+ CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
--
-- Test case for bug with BEFORE trigger followed by AFTER trigger with WHEN
--
***************
*** 468,479 **** CREATE TRIGGER some_trig_afterb AFTER UPDATE ON some_t FOR EACH ROW
--- 526,542 ----
INSERT INTO some_t VALUES (TRUE);
UPDATE some_t SET some_col = TRUE;
NOTICE: dummy_update_func(before) called: action = UPDATE, old = (t), new = (t)
+ CONTEXT: PL/pgSQL function dummy_update_func() line 3 at RAISE
UPDATE some_t SET some_col = FALSE;
NOTICE: dummy_update_func(before) called: action = UPDATE, old = (t), new = (f)
+ CONTEXT: PL/pgSQL function dummy_update_func() line 3 at RAISE
NOTICE: dummy_update_func(afterb) called: action = UPDATE, old = (t), new = (f)
+ CONTEXT: PL/pgSQL function dummy_update_func() line 3 at RAISE
UPDATE some_t SET some_col = TRUE;
NOTICE: dummy_update_func(before) called: action = UPDATE, old = (f), new = (t)
+ CONTEXT: PL/pgSQL function dummy_update_func() line 3 at RAISE
NOTICE: dummy_update_func(aftera) called: action = UPDATE, old = (f), new = (t)
+ CONTEXT: PL/pgSQL function dummy_update_func() line 3 at RAISE
DROP TABLE some_t;
-- bogus cases
CREATE TRIGGER error_upd_and_col BEFORE UPDATE OR UPDATE OF a ON main_table
***************
*** 546,568 **** create trigger trigtest_a_stmt_tg after insert or update or delete on trigtest
--- 609,640 ----
for each statement execute procedure trigtest();
insert into trigtest default values;
NOTICE: trigtest INSERT BEFORE STATEMENT
+ CONTEXT: PL/pgSQL function trigtest() line 3 at RAISE
NOTICE: trigtest INSERT BEFORE ROW
+ CONTEXT: PL/pgSQL function trigtest() line 3 at RAISE
NOTICE: trigtest INSERT AFTER ROW
+ CONTEXT: PL/pgSQL function trigtest() line 3 at RAISE
NOTICE: trigtest INSERT AFTER STATEMENT
+ CONTEXT: PL/pgSQL function trigtest() line 3 at RAISE
alter table trigtest disable trigger trigtest_b_row_tg;
insert into trigtest default values;
NOTICE: trigtest INSERT BEFORE STATEMENT
+ CONTEXT: PL/pgSQL function trigtest() line 3 at RAISE
NOTICE: trigtest INSERT AFTER ROW
+ CONTEXT: PL/pgSQL function trigtest() line 3 at RAISE
NOTICE: trigtest INSERT AFTER STATEMENT
+ CONTEXT: PL/pgSQL function trigtest() line 3 at RAISE
alter table trigtest disable trigger user;
insert into trigtest default values;
alter table trigtest enable trigger trigtest_a_stmt_tg;
insert into trigtest default values;
NOTICE: trigtest INSERT AFTER STATEMENT
+ CONTEXT: PL/pgSQL function trigtest() line 3 at RAISE
insert into trigtest2 values(1);
insert into trigtest2 values(2);
delete from trigtest where i=2;
NOTICE: trigtest DELETE AFTER STATEMENT
+ CONTEXT: PL/pgSQL function trigtest() line 3 at RAISE
select * from trigtest2;
i
---
***************
*** 650,690 **** BEFORE INSERT OR UPDATE OR DELETE ON trigger_test
--- 722,796 ----
FOR EACH ROW EXECUTE PROCEDURE trigger_data(23,'skidoo');
insert into trigger_test values(1,'insert');
NOTICE: TG_NAME: show_trigger_data_trig
+ CONTEXT: PL/pgSQL function trigger_data() line 15 at RAISE
NOTICE: TG_WHEN: BEFORE
+ CONTEXT: PL/pgSQL function trigger_data() line 16 at RAISE
NOTICE: TG_LEVEL: ROW
+ CONTEXT: PL/pgSQL function trigger_data() line 17 at RAISE
NOTICE: TG_OP: INSERT
+ CONTEXT: PL/pgSQL function trigger_data() line 18 at RAISE
NOTICE: TG_RELID::regclass: trigger_test
+ CONTEXT: PL/pgSQL function trigger_data() line 19 at RAISE
NOTICE: TG_RELNAME: trigger_test
+ CONTEXT: PL/pgSQL function trigger_data() line 20 at RAISE
NOTICE: TG_TABLE_NAME: trigger_test
+ CONTEXT: PL/pgSQL function trigger_data() line 21 at RAISE
NOTICE: TG_TABLE_SCHEMA: public
+ CONTEXT: PL/pgSQL function trigger_data() line 22 at RAISE
NOTICE: TG_NARGS: 2
+ CONTEXT: PL/pgSQL function trigger_data() line 23 at RAISE
NOTICE: TG_ARGV: [23, skidoo]
+ CONTEXT: PL/pgSQL function trigger_data() line 33 at RAISE
NOTICE: NEW: (1,insert)
+ CONTEXT: PL/pgSQL function trigger_data() line 40 at RAISE
update trigger_test set v = 'update' where i = 1;
NOTICE: TG_NAME: show_trigger_data_trig
+ CONTEXT: PL/pgSQL function trigger_data() line 15 at RAISE
NOTICE: TG_WHEN: BEFORE
+ CONTEXT: PL/pgSQL function trigger_data() line 16 at RAISE
NOTICE: TG_LEVEL: ROW
+ CONTEXT: PL/pgSQL function trigger_data() line 17 at RAISE
NOTICE: TG_OP: UPDATE
+ CONTEXT: PL/pgSQL function trigger_data() line 18 at RAISE
NOTICE: TG_RELID::regclass: trigger_test
+ CONTEXT: PL/pgSQL function trigger_data() line 19 at RAISE
NOTICE: TG_RELNAME: trigger_test
+ CONTEXT: PL/pgSQL function trigger_data() line 20 at RAISE
NOTICE: TG_TABLE_NAME: trigger_test
+ CONTEXT: PL/pgSQL function trigger_data() line 21 at RAISE
NOTICE: TG_TABLE_SCHEMA: public
+ CONTEXT: PL/pgSQL function trigger_data() line 22 at RAISE
NOTICE: TG_NARGS: 2
+ CONTEXT: PL/pgSQL function trigger_data() line 23 at RAISE
NOTICE: TG_ARGV: [23, skidoo]
+ CONTEXT: PL/pgSQL function trigger_data() line 33 at RAISE
NOTICE: OLD: (1,insert)
+ CONTEXT: PL/pgSQL function trigger_data() line 36 at RAISE
NOTICE: NEW: (1,update)
+ CONTEXT: PL/pgSQL function trigger_data() line 40 at RAISE
delete from trigger_test;
NOTICE: TG_NAME: show_trigger_data_trig
+ CONTEXT: PL/pgSQL function trigger_data() line 15 at RAISE
NOTICE: TG_WHEN: BEFORE
+ CONTEXT: PL/pgSQL function trigger_data() line 16 at RAISE
NOTICE: TG_LEVEL: ROW
+ CONTEXT: PL/pgSQL function trigger_data() line 17 at RAISE
NOTICE: TG_OP: DELETE
+ CONTEXT: PL/pgSQL function trigger_data() line 18 at RAISE
NOTICE: TG_RELID::regclass: trigger_test
+ CONTEXT: PL/pgSQL function trigger_data() line 19 at RAISE
NOTICE: TG_RELNAME: trigger_test
+ CONTEXT: PL/pgSQL function trigger_data() line 20 at RAISE
NOTICE: TG_TABLE_NAME: trigger_test
+ CONTEXT: PL/pgSQL function trigger_data() line 21 at RAISE
NOTICE: TG_TABLE_SCHEMA: public
+ CONTEXT: PL/pgSQL function trigger_data() line 22 at RAISE
NOTICE: TG_NARGS: 2
+ CONTEXT: PL/pgSQL function trigger_data() line 23 at RAISE
NOTICE: TG_ARGV: [23, skidoo]
+ CONTEXT: PL/pgSQL function trigger_data() line 33 at RAISE
NOTICE: OLD: (1,update)
+ CONTEXT: PL/pgSQL function trigger_data() line 36 at RAISE
DROP TRIGGER show_trigger_data_trig on trigger_test;
DROP FUNCTION trigger_data();
DROP TABLE trigger_test;
***************
*** 709,722 **** INSERT INTO trigger_test VALUES(1, 'foo', 'bar');
--- 815,834 ----
INSERT INTO trigger_test VALUES(2, 'baz', 'quux');
UPDATE trigger_test SET f3 = 'bar';
NOTICE: row 1 not changed
+ CONTEXT: PL/pgSQL function mytrigger() line 4 at RAISE
NOTICE: row 2 changed
+ CONTEXT: PL/pgSQL function mytrigger() line 6 at RAISE
UPDATE trigger_test SET f3 = NULL;
NOTICE: row 1 changed
+ CONTEXT: PL/pgSQL function mytrigger() line 6 at RAISE
NOTICE: row 2 changed
+ CONTEXT: PL/pgSQL function mytrigger() line 6 at RAISE
-- this demonstrates that the above isn't really working as desired:
UPDATE trigger_test SET f3 = NULL;
NOTICE: row 1 changed
+ CONTEXT: PL/pgSQL function mytrigger() line 6 at RAISE
NOTICE: row 2 changed
+ CONTEXT: PL/pgSQL function mytrigger() line 6 at RAISE
-- the right way when considering nulls is
CREATE OR REPLACE FUNCTION mytrigger() RETURNS trigger LANGUAGE plpgsql as $$
begin
***************
*** 729,741 **** begin
--- 841,859 ----
end$$;
UPDATE trigger_test SET f3 = 'bar';
NOTICE: row 1 changed
+ CONTEXT: PL/pgSQL function mytrigger() line 4 at RAISE
NOTICE: row 2 changed
+ CONTEXT: PL/pgSQL function mytrigger() line 4 at RAISE
UPDATE trigger_test SET f3 = NULL;
NOTICE: row 1 changed
+ CONTEXT: PL/pgSQL function mytrigger() line 4 at RAISE
NOTICE: row 2 changed
+ CONTEXT: PL/pgSQL function mytrigger() line 4 at RAISE
UPDATE trigger_test SET f3 = NULL;
NOTICE: row 1 not changed
+ CONTEXT: PL/pgSQL function mytrigger() line 6 at RAISE
NOTICE: row 2 not changed
+ CONTEXT: PL/pgSQL function mytrigger() line 6 at RAISE
DROP TABLE trigger_test;
DROP FUNCTION mytrigger();
-- Test snapshot management in serializable transactions involving triggers
***************
*** 945,971 **** FOR EACH STATEMENT EXECUTE PROCEDURE view_trigger('after_view_del_stmt');
-- Insert into view using trigger
INSERT INTO main_view VALUES (20, 30);
NOTICE: main_view BEFORE INSERT STATEMENT (before_view_ins_stmt)
NOTICE: main_view INSTEAD OF INSERT ROW (instead_of_ins)
NOTICE: NEW: (20,30)
NOTICE: trigger_func(before_ins_stmt) called: action = INSERT, when = BEFORE, level = STATEMENT
! CONTEXT: SQL statement "INSERT INTO main_table VALUES (NEW.a, NEW.b)"
PL/pgSQL function view_trigger() line 17 at SQL statement
NOTICE: trigger_func(after_ins_stmt) called: action = INSERT, when = AFTER, level = STATEMENT
! CONTEXT: SQL statement "INSERT INTO main_table VALUES (NEW.a, NEW.b)"
PL/pgSQL function view_trigger() line 17 at SQL statement
NOTICE: main_view AFTER INSERT STATEMENT (after_view_ins_stmt)
INSERT 0 1
INSERT INTO main_view VALUES (21, 31) RETURNING a, b;
NOTICE: main_view BEFORE INSERT STATEMENT (before_view_ins_stmt)
NOTICE: main_view INSTEAD OF INSERT ROW (instead_of_ins)
NOTICE: NEW: (21,31)
NOTICE: trigger_func(before_ins_stmt) called: action = INSERT, when = BEFORE, level = STATEMENT
! CONTEXT: SQL statement "INSERT INTO main_table VALUES (NEW.a, NEW.b)"
PL/pgSQL function view_trigger() line 17 at SQL statement
NOTICE: trigger_func(after_ins_stmt) called: action = INSERT, when = AFTER, level = STATEMENT
! CONTEXT: SQL statement "INSERT INTO main_table VALUES (NEW.a, NEW.b)"
PL/pgSQL function view_trigger() line 17 at SQL statement
NOTICE: main_view AFTER INSERT STATEMENT (after_view_ins_stmt)
a | b
----+----
21 | 31
--- 1063,1101 ----
-- Insert into view using trigger
INSERT INTO main_view VALUES (20, 30);
NOTICE: main_view BEFORE INSERT STATEMENT (before_view_ins_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: main_view INSTEAD OF INSERT ROW (instead_of_ins)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: NEW: (20,30)
+ CONTEXT: PL/pgSQL function view_trigger() line 16 at RAISE
NOTICE: trigger_func(before_ins_stmt) called: action = INSERT, when = BEFORE, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "INSERT INTO main_table VALUES (NEW.a, NEW.b)"
PL/pgSQL function view_trigger() line 17 at SQL statement
NOTICE: trigger_func(after_ins_stmt) called: action = INSERT, when = AFTER, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "INSERT INTO main_table VALUES (NEW.a, NEW.b)"
PL/pgSQL function view_trigger() line 17 at SQL statement
NOTICE: main_view AFTER INSERT STATEMENT (after_view_ins_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
INSERT 0 1
INSERT INTO main_view VALUES (21, 31) RETURNING a, b;
NOTICE: main_view BEFORE INSERT STATEMENT (before_view_ins_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: main_view INSTEAD OF INSERT ROW (instead_of_ins)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: NEW: (21,31)
+ CONTEXT: PL/pgSQL function view_trigger() line 16 at RAISE
NOTICE: trigger_func(before_ins_stmt) called: action = INSERT, when = BEFORE, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "INSERT INTO main_table VALUES (NEW.a, NEW.b)"
PL/pgSQL function view_trigger() line 17 at SQL statement
NOTICE: trigger_func(after_ins_stmt) called: action = INSERT, when = AFTER, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "INSERT INTO main_table VALUES (NEW.a, NEW.b)"
PL/pgSQL function view_trigger() line 17 at SQL statement
NOTICE: main_view AFTER INSERT STATEMENT (after_view_ins_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
a | b
----+----
21 | 31
***************
*** 975,1013 **** INSERT 0 1
-- Table trigger will prevent updates
UPDATE main_view SET b = 31 WHERE a = 20;
NOTICE: main_view BEFORE UPDATE STATEMENT (before_view_upd_stmt)
NOTICE: main_view INSTEAD OF UPDATE ROW (instead_of_upd)
NOTICE: OLD: (20,30), NEW: (20,31)
NOTICE: trigger_func(before_upd_a_stmt) called: action = UPDATE, when = BEFORE, level = STATEMENT
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt)
UPDATE 0
UPDATE main_view SET b = 32 WHERE a = 21 AND b = 31 RETURNING a, b;
NOTICE: main_view BEFORE UPDATE STATEMENT (before_view_upd_stmt)
NOTICE: main_view INSTEAD OF UPDATE ROW (instead_of_upd)
NOTICE: OLD: (21,31), NEW: (21,32)
NOTICE: trigger_func(before_upd_a_stmt) called: action = UPDATE, when = BEFORE, level = STATEMENT
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt)
a | b
---+---
(0 rows)
--- 1105,1159 ----
-- Table trigger will prevent updates
UPDATE main_view SET b = 31 WHERE a = 20;
NOTICE: main_view BEFORE UPDATE STATEMENT (before_view_upd_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: main_view INSTEAD OF UPDATE ROW (instead_of_upd)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: OLD: (20,30), NEW: (20,31)
+ CONTEXT: PL/pgSQL function view_trigger() line 22 at RAISE
NOTICE: trigger_func(before_upd_a_stmt) called: action = UPDATE, when = BEFORE, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
UPDATE 0
UPDATE main_view SET b = 32 WHERE a = 21 AND b = 31 RETURNING a, b;
NOTICE: main_view BEFORE UPDATE STATEMENT (before_view_upd_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: main_view INSTEAD OF UPDATE ROW (instead_of_upd)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: OLD: (21,31), NEW: (21,32)
+ CONTEXT: PL/pgSQL function view_trigger() line 22 at RAISE
NOTICE: trigger_func(before_upd_a_stmt) called: action = UPDATE, when = BEFORE, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(before_upd_a_row) called: action = UPDATE, when = BEFORE, level = ROW
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
a | b
---+---
(0 rows)
***************
*** 1018,1062 **** DROP TRIGGER before_upd_a_row_trig ON main_table;
DROP TRIGGER
UPDATE main_view SET b = 31 WHERE a = 20;
NOTICE: main_view BEFORE UPDATE STATEMENT (before_view_upd_stmt)
NOTICE: main_view INSTEAD OF UPDATE ROW (instead_of_upd)
NOTICE: OLD: (20,30), NEW: (20,31)
NOTICE: trigger_func(before_upd_a_stmt) called: action = UPDATE, when = BEFORE, level = STATEMENT
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_a_b_row) called: action = UPDATE, when = AFTER, level = ROW
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt)
UPDATE 1
UPDATE main_view SET b = 32 WHERE a = 21 AND b = 31 RETURNING a, b;
NOTICE: main_view BEFORE UPDATE STATEMENT (before_view_upd_stmt)
NOTICE: main_view INSTEAD OF UPDATE ROW (instead_of_upd)
NOTICE: OLD: (21,31), NEW: (21,32)
NOTICE: trigger_func(before_upd_a_stmt) called: action = UPDATE, when = BEFORE, level = STATEMENT
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_a_b_row) called: action = UPDATE, when = AFTER, level = ROW
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt)
a | b
----+----
21 | 32
--- 1164,1226 ----
DROP TRIGGER
UPDATE main_view SET b = 31 WHERE a = 20;
NOTICE: main_view BEFORE UPDATE STATEMENT (before_view_upd_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: main_view INSTEAD OF UPDATE ROW (instead_of_upd)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: OLD: (20,30), NEW: (20,31)
+ CONTEXT: PL/pgSQL function view_trigger() line 22 at RAISE
NOTICE: trigger_func(before_upd_a_stmt) called: action = UPDATE, when = BEFORE, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_a_b_row) called: action = UPDATE, when = AFTER, level = ROW
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
UPDATE 1
UPDATE main_view SET b = 32 WHERE a = 21 AND b = 31 RETURNING a, b;
NOTICE: main_view BEFORE UPDATE STATEMENT (before_view_upd_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: main_view INSTEAD OF UPDATE ROW (instead_of_upd)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: OLD: (21,31), NEW: (21,32)
+ CONTEXT: PL/pgSQL function view_trigger() line 22 at RAISE
NOTICE: trigger_func(before_upd_a_stmt) called: action = UPDATE, when = BEFORE, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_a_b_row) called: action = UPDATE, when = AFTER, level = ROW
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_row) called: action = UPDATE, when = AFTER, level = ROW
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_b_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: trigger_func(after_upd_stmt) called: action = UPDATE, when = AFTER, level = STATEMENT
! CONTEXT: PL/pgSQL function trigger_func() line 3 at RAISE
! SQL statement "UPDATE main_table SET a = NEW.a, b = NEW.b WHERE a = OLD.a AND b = OLD.b"
PL/pgSQL function view_trigger() line 23 at SQL statement
NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
a | b
----+----
21 | 32
***************
*** 1066,1089 **** UPDATE 1
--- 1230,1267 ----
-- Before and after stmt triggers should fire even when no rows are affected
UPDATE main_view SET b = 0 WHERE false;
NOTICE: main_view BEFORE UPDATE STATEMENT (before_view_upd_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: main_view AFTER UPDATE STATEMENT (after_view_upd_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
UPDATE 0
-- Delete from view using trigger
DELETE FROM main_view WHERE a IN (20,21);
NOTICE: main_view BEFORE DELETE STATEMENT (before_view_del_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: main_view INSTEAD OF DELETE ROW (instead_of_del)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: OLD: (21,10)
+ CONTEXT: PL/pgSQL function view_trigger() line 29 at RAISE
NOTICE: main_view INSTEAD OF DELETE ROW (instead_of_del)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: OLD: (20,31)
+ CONTEXT: PL/pgSQL function view_trigger() line 29 at RAISE
NOTICE: main_view INSTEAD OF DELETE ROW (instead_of_del)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: OLD: (21,32)
+ CONTEXT: PL/pgSQL function view_trigger() line 29 at RAISE
NOTICE: main_view AFTER DELETE STATEMENT (after_view_del_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
DELETE 3
DELETE FROM main_view WHERE a = 31 RETURNING a, b;
NOTICE: main_view BEFORE DELETE STATEMENT (before_view_del_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: main_view INSTEAD OF DELETE ROW (instead_of_del)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
NOTICE: OLD: (31,10)
+ CONTEXT: PL/pgSQL function view_trigger() line 29 at RAISE
NOTICE: main_view AFTER DELETE STATEMENT (after_view_del_stmt)
+ CONTEXT: PL/pgSQL function view_trigger() line 12 at RAISE
a | b
----+----
31 | 10
***************
*** 1267,1272 **** INSERT 0 1
--- 1445,1451 ----
-- UPDATE .. RETURNING
UPDATE city_view SET country_name = 'Japon' WHERE city_name = 'Tokyo'; -- error
ERROR: No such country: "Japon"
+ CONTEXT: PL/pgSQL function city_update() line 9 at RAISE
UPDATE city_view SET country_name = 'Japan' WHERE city_name = 'Takyo'; -- no match
UPDATE 0
UPDATE city_view SET country_name = 'Japan' WHERE city_name = 'Tokyo' RETURNING *; -- OK
***************
*** 1478,1504 **** select pg_trigger_depth();
insert into depth_a values (1);
NOTICE: depth_a_tr: depth = 1
NOTICE: depth_b_tr: depth = 2
! CONTEXT: SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_c_tr: depth = 3
! CONTEXT: SQL statement "insert into depth_c values (1)"
PL/pgSQL function depth_b_tf() line 5 at EXECUTE statement
SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: SQLSTATE = U9999: depth = 2
! CONTEXT: SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_b_tr: depth = 2
! CONTEXT: SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_c_tr: depth = 3
! CONTEXT: SQL statement "insert into depth_c values (1)"
PL/pgSQL function depth_b_tf() line 12 at EXECUTE statement
SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
ERROR: U9999
! CONTEXT: SQL statement "insert into depth_c values (1)"
PL/pgSQL function depth_b_tf() line 12 at EXECUTE statement
SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
--- 1657,1690 ----
insert into depth_a values (1);
NOTICE: depth_a_tr: depth = 1
+ CONTEXT: PL/pgSQL function depth_a_tf() line 3 at RAISE
NOTICE: depth_b_tr: depth = 2
! CONTEXT: PL/pgSQL function depth_b_tf() line 3 at RAISE
! SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_c_tr: depth = 3
! CONTEXT: PL/pgSQL function depth_c_tf() line 3 at RAISE
! SQL statement "insert into depth_c values (1)"
PL/pgSQL function depth_b_tf() line 5 at EXECUTE statement
SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: SQLSTATE = U9999: depth = 2
! CONTEXT: PL/pgSQL function depth_b_tf() line 8 at RAISE
! SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_b_tr: depth = 2
! CONTEXT: PL/pgSQL function depth_b_tf() line 10 at RAISE
! SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_c_tr: depth = 3
! CONTEXT: PL/pgSQL function depth_c_tf() line 3 at RAISE
! SQL statement "insert into depth_c values (1)"
PL/pgSQL function depth_b_tf() line 12 at EXECUTE statement
SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
ERROR: U9999
! CONTEXT: PL/pgSQL function depth_c_tf() line 5 at RAISE
! SQL statement "insert into depth_c values (1)"
PL/pgSQL function depth_b_tf() line 12 at EXECUTE statement
SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
***************
*** 1510,1532 **** select pg_trigger_depth();
insert into depth_a values (2);
NOTICE: depth_a_tr: depth = 1
NOTICE: depth_b_tr: depth = 2
! CONTEXT: SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_c_tr: depth = 3
! CONTEXT: SQL statement "insert into depth_c values (2)"
PL/pgSQL function depth_b_tf() line 5 at EXECUTE statement
SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_c_tr: depth = 3
! CONTEXT: SQL statement "insert into depth_c values (2)"
PL/pgSQL function depth_b_tf() line 5 at EXECUTE statement
SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_b_tr: depth = 2
! CONTEXT: SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_a_tr: depth = 1
select pg_trigger_depth();
pg_trigger_depth
------------------
--- 1696,1724 ----
insert into depth_a values (2);
NOTICE: depth_a_tr: depth = 1
+ CONTEXT: PL/pgSQL function depth_a_tf() line 3 at RAISE
NOTICE: depth_b_tr: depth = 2
! CONTEXT: PL/pgSQL function depth_b_tf() line 3 at RAISE
! SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_c_tr: depth = 3
! CONTEXT: PL/pgSQL function depth_c_tf() line 3 at RAISE
! SQL statement "insert into depth_c values (2)"
PL/pgSQL function depth_b_tf() line 5 at EXECUTE statement
SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_c_tr: depth = 3
! CONTEXT: PL/pgSQL function depth_c_tf() line 7 at RAISE
! SQL statement "insert into depth_c values (2)"
PL/pgSQL function depth_b_tf() line 5 at EXECUTE statement
SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_b_tr: depth = 2
! CONTEXT: PL/pgSQL function depth_b_tf() line 10 at RAISE
! SQL statement "insert into depth_b values (new.id)"
PL/pgSQL function depth_a_tf() line 4 at SQL statement
NOTICE: depth_a_tr: depth = 1
+ CONTEXT: PL/pgSQL function depth_a_tf() line 5 at RAISE
select pg_trigger_depth();
pg_trigger_depth
------------------
*** a/src/test/regress/expected/with.out
--- b/src/test/regress/expected/with.out
***************
*** 1903,1910 **** WITH t AS (
--- 1903,1913 ----
)
SELECT * FROM t;
NOTICE: y_trigger: a = 21
+ CONTEXT: PL/pgSQL function y_trigger() line 3 at RAISE
NOTICE: y_trigger: a = 22
+ CONTEXT: PL/pgSQL function y_trigger() line 3 at RAISE
NOTICE: y_trigger: a = 23
+ CONTEXT: PL/pgSQL function y_trigger() line 3 at RAISE
a
----
21
***************
*** 1943,1950 **** WITH t AS (
--- 1946,1956 ----
)
SELECT * FROM t LIMIT 1;
NOTICE: y_trigger: a = 31
+ CONTEXT: PL/pgSQL function y_trigger() line 3 at RAISE
NOTICE: y_trigger: a = 32
+ CONTEXT: PL/pgSQL function y_trigger() line 3 at RAISE
NOTICE: y_trigger: a = 33
+ CONTEXT: PL/pgSQL function y_trigger() line 3 at RAISE
a
----
31
***************
*** 1990,1995 **** WITH t AS (
--- 1996,2002 ----
)
SELECT * FROM t;
NOTICE: y_trigger
+ CONTEXT: PL/pgSQL function y_trigger() line 3 at RAISE
a
----
41
*** a/src/test/regress/expected/xml_1.out
--- b/src/test/regress/expected/xml_1.out
***************
*** 773,778 **** HINT: You need to rebuild PostgreSQL using --with-libxml.
--- 773,779 ----
\set VERBOSITY terse
SELECT xpath('/*', '');
ERROR: unsupported XML feature at character 20
+ CONTEXT: 20
\set VERBOSITY default
-- Again, the XML isn't well-formed for namespace purposes
SELECT xpath('/*', '');