1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Error message editing in contrib (mostly by Joe Conway --- thanks Joe!)

This commit is contained in:
Tom Lane
2003-07-24 17:52:50 +00:00
parent f0c5384d4a
commit 8fd5b3ed67
75 changed files with 1459 additions and 658 deletions

View File

@ -8,7 +8,7 @@ SET search_path = public;
-- contents of dblink.sql.
\set ECHO none
CREATE TABLE foo(f1 int, f2 text, f3 text[], primary key (f1,f2));
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'foo_pkey' for table 'foo'
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for table "foo"
INSERT INTO foo VALUES (0,'a','{"a0","b0","c0"}');
INSERT INTO foo VALUES (1,'b','{"a1","b1","c1"}');
INSERT INTO foo VALUES (2,'c','{"a2","b2","c2"}');
@ -62,7 +62,7 @@ SELECT dblink_build_sql_delete('foo','1 2',2,'{"0", "a"}');
-- retest using a quoted and schema qualified table
CREATE SCHEMA "MySchema";
CREATE TABLE "MySchema"."Foo"(f1 int, f2 text, f3 text[], primary key (f1,f2));
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'Foo_pkey' for table 'Foo'
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "Foo_pkey" for table "Foo"
INSERT INTO "MySchema"."Foo" VALUES (0,'a','{"a0","b0","c0"}');
-- list the primary key fields
SELECT *
@ -110,7 +110,7 @@ WHERE t.a > 7;
SELECT *
FROM dblink('SELECT * FROM foo') AS t(a int, b text, c text[])
WHERE t.a > 7;
ERROR: dblink_record: connection not available
ERROR: connection not available
-- create a persistent connection
SELECT dblink_connect('dbname=regression');
dblink_connect
@ -172,10 +172,10 @@ SELECT dblink_close('rmt_foo_cursor');
OK
(1 row)
-- should generate "cursor not found: rmt_foo_cursor" error
-- should generate 'cursor "rmt_foo_cursor" not found' error
SELECT *
FROM dblink_fetch('rmt_foo_cursor',4) AS t(a int, b text, c text[]);
ERROR: dblink_fetch: cursor not found: rmt_foo_cursor
ERROR: cursor "rmt_foo_cursor" does not exist
-- close the persistent connection
SELECT dblink_disconnect();
dblink_disconnect
@ -187,7 +187,8 @@ SELECT dblink_disconnect();
SELECT *
FROM dblink('SELECT * FROM foo') AS t(a int, b text, c text[])
WHERE t.a > 7;
ERROR: dblink: sql error: no connection to the server
ERROR: sql error
DETAIL: no connection to the server
-- put more data into our slave table, first using arbitrary connection syntax
-- but truncate the actual return value so we can use diff to check for success
@ -276,7 +277,8 @@ SELECT dblink_disconnect();
SELECT *
FROM dblink('myconn','SELECT * FROM foo') AS t(a int, b text, c text[])
WHERE t.a > 7;
ERROR: dblink: connection error: missing "=" after "myconn" in connection info string
ERROR: could not establish connection
DETAIL: missing "=" after "myconn" in connection info string
-- create a named persistent connection
SELECT dblink_connect('myconn','dbname=regression');
@ -297,10 +299,9 @@ WHERE t.a > 7;
(3 rows)
-- create a second named persistent connection
-- should error with "cannot save named connection"
-- should error with "duplicate connection name"
SELECT dblink_connect('myconn','dbname=regression');
NOTICE: cannot use a connection name more than once
ERROR: dblink_connect: cannot save named connection
ERROR: duplicate connection name
-- create a second named persistent connection with a new name
SELECT dblink_connect('myconn2','dbname=regression');
dblink_connect
@ -371,10 +372,10 @@ SELECT dblink_close('myconn','rmt_foo_cursor');
OK
(1 row)
-- should generate "cursor not found: rmt_foo_cursor" error
-- should generate 'cursor "rmt_foo_cursor" not found' error
SELECT *
FROM dblink_fetch('myconn','rmt_foo_cursor',4) AS t(a int, b text, c text[]);
ERROR: dblink_fetch: cursor not found: rmt_foo_cursor
ERROR: cursor "rmt_foo_cursor" does not exist
-- close the named persistent connection
SELECT dblink_disconnect('myconn');
dblink_disconnect
@ -386,7 +387,8 @@ SELECT dblink_disconnect('myconn');
SELECT *
FROM dblink('myconn','SELECT * FROM foo') AS t(a int, b text, c text[])
WHERE t.a > 7;
ERROR: dblink: connection error: missing "=" after "myconn" in connection info string
ERROR: could not establish connection
DETAIL: missing "=" after "myconn" in connection info string
-- create a named persistent connection
SELECT dblink_connect('myconn','dbname=regression');
@ -461,6 +463,6 @@ SELECT dblink_disconnect('myconn');
(1 row)
-- close the named persistent connection again
-- should get "connection named "myconn" not found" error
-- should get 'connection "myconn" not available' error
SELECT dblink_disconnect('myconn');
ERROR: dblink_disconnect: connection named "myconn" not found
ERROR: connection "myconn" not available