summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorTom Lane2003-04-24 21:16:45 +0000
committerTom Lane2003-04-24 21:16:45 +0000
commitf690920a752fa8e59dc9536dd14194b2141163d2 (patch)
tree0fdd5e79110455c7857783e04f2d716c2a6a0c52 /src/test
parenta91c5be6a47349d87068680c80839aae76304285 (diff)
Infrastructure for upgraded error reporting mechanism. elog.c is
rewritten and the protocol is changed, but most elog calls are still elog calls. Also, we need to contemplate mechanisms for controlling all this functionality --- eg, how much stuff should appear in the postmaster log? And what API should libpq expose for it?
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/alter_table.out3
-rw-r--r--src/test/regress/expected/copy2.out12
-rw-r--r--src/test/regress/expected/domain.out9
-rw-r--r--src/test/regress/expected/plpgsql.out4
-rw-r--r--src/test/regress/output/constraints.source3
5 files changed, 22 insertions, 9 deletions
diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out
index 4d1458f8916..26c8c2ed423 100644
--- a/src/test/regress/expected/alter_table.out
+++ b/src/test/regress/expected/alter_table.out
@@ -994,7 +994,8 @@ ERROR: Relation "test" has no column "a"
copy test("........pg.dropped.1........") to stdout;
ERROR: Relation "test" has no column "........pg.dropped.1........"
copy test from stdin;
-ERROR: copy: line 1, Extra data after last expected column
+ERROR: Extra data after last expected column
+CONTEXT: COPY FROM, line 1
SET autocommit TO 'on';
select * from test;
b | c
diff --git a/src/test/regress/expected/copy2.out b/src/test/regress/expected/copy2.out
index 983e6bb4a41..2d69434b5b8 100644
--- a/src/test/regress/expected/copy2.out
+++ b/src/test/regress/expected/copy2.out
@@ -34,14 +34,18 @@ COPY x (a, b, c, d, e, d, c) from stdin;
ERROR: Attribute "d" specified more than once
-- missing data: should fail
COPY x from stdin;
-ERROR: copy: line 1, pg_atoi: zero-length string
+ERROR: pg_atoi: zero-length string
+CONTEXT: COPY FROM, line 1
COPY x from stdin;
-ERROR: copy: line 1, Missing data for column "e"
+ERROR: Missing data for column "e"
+CONTEXT: COPY FROM, line 1
COPY x from stdin;
-ERROR: copy: line 1, Missing data for column "e"
+ERROR: Missing data for column "e"
+CONTEXT: COPY FROM, line 1
-- extra data: should fail
COPY x from stdin;
-ERROR: copy: line 1, Extra data after last expected column
+ERROR: Extra data after last expected column
+CONTEXT: COPY FROM, line 1
SET autocommit TO 'on';
-- various COPY options: delimiters, oids, NULL string
COPY x (b, c, d, e) from stdin with oids delimiter ',' null 'x';
diff --git a/src/test/regress/expected/domain.out b/src/test/regress/expected/domain.out
index 13eb14cfa2f..299bae55f8a 100644
--- a/src/test/regress/expected/domain.out
+++ b/src/test/regress/expected/domain.out
@@ -39,7 +39,8 @@ ERROR: value too long for type character varying(5)
INSERT INTO basictest values ('88', 'haha', 'short', '123.1212'); -- Truncate numeric
-- Test copy
COPY basictest (testvarchar) FROM stdin; -- fail
-ERROR: copy: line 1, value too long for type character varying(5)
+ERROR: value too long for type character varying(5)
+CONTEXT: COPY FROM, line 1
SET autocommit TO 'on';
COPY basictest (testvarchar) FROM stdin;
select * from basictest;
@@ -126,11 +127,13 @@ ERROR: ExecInsert: Fail to add null value in not null attribute col3
INSERT INTO nulltest values ('a', 'b', 'c', NULL, 'd'); -- Good
-- Test copy
COPY nulltest FROM stdin; --fail
-ERROR: copy: line 1, Domain dcheck does not allow NULL values
+ERROR: Domain dcheck does not allow NULL values
+CONTEXT: COPY FROM, line 1
SET autocommit TO 'on';
-- Last row is bad
COPY nulltest FROM stdin;
-ERROR: copy: line 3, CopyFrom: rejected due to CHECK constraint "nulltest_col5" on "nulltest"
+ERROR: CopyFrom: rejected due to CHECK constraint "nulltest_col5" on "nulltest"
+CONTEXT: COPY FROM, line 3
select * from nulltest;
col1 | col2 | col3 | col4 | col5
------+------+------+------+------
diff --git a/src/test/regress/expected/plpgsql.out b/src/test/regress/expected/plpgsql.out
index b300b695d91..6ef512a218d 100644
--- a/src/test/regress/expected/plpgsql.out
+++ b/src/test/regress/expected/plpgsql.out
@@ -1518,12 +1518,16 @@ insert into PField values ('PF1_1', 'should fail due to unique index');
ERROR: Cannot insert a duplicate key into unique index pfield_name
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 16 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 16 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 16 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 16 at assignment
insert into HSlot values ('HS', 'base.hub1', 1, '');
ERROR: Cannot insert a duplicate key into unique index hslot_name
insert into HSlot values ('HS', 'base.hub1', 20, '');
diff --git a/src/test/regress/output/constraints.source b/src/test/regress/output/constraints.source
index 7df5e414e87..7a0e335509e 100644
--- a/src/test/regress/output/constraints.source
+++ b/src/test/regress/output/constraints.source
@@ -273,7 +273,8 @@ SELECT '' AS two, * FROM COPY_TBL;
(2 rows)
COPY COPY_TBL FROM '@abs_srcdir@/data/constrf.data';
-ERROR: copy: line 2, CopyFrom: rejected due to CHECK constraint "copy_con" on "copy_tbl"
+ERROR: CopyFrom: rejected due to CHECK constraint "copy_con" on "copy_tbl"
+CONTEXT: COPY FROM, line 2
SELECT * FROM COPY_TBL;
x | y | z
---+---------------+---