@@ -109,6 +109,8 @@ CREATE FOREIGN DATA WRAPPER test_fdw HANDLER invalid_fdw_handler; -- ERROR
109109ERROR: function invalid_fdw_handler must return type fdw_handler
110110CREATE FOREIGN DATA WRAPPER test_fdw HANDLER test_fdw_handler HANDLER invalid_fdw_handler; -- ERROR
111111ERROR: conflicting or redundant options
112+ LINE 1: ...GN DATA WRAPPER test_fdw HANDLER test_fdw_handler HANDLER in...
113+ ^
112114CREATE FOREIGN DATA WRAPPER test_fdw HANDLER test_fdw_handler;
113115DROP FOREIGN DATA WRAPPER test_fdw;
114116-- ALTER FOREIGN DATA WRAPPER
@@ -215,6 +217,8 @@ ALTER FOREIGN DATA WRAPPER foo HANDLER invalid_fdw_handler; -- ERROR
215217ERROR: function invalid_fdw_handler must return type fdw_handler
216218ALTER FOREIGN DATA WRAPPER foo HANDLER test_fdw_handler HANDLER anything; -- ERROR
217219ERROR: conflicting or redundant options
220+ LINE 1: ...FOREIGN DATA WRAPPER foo HANDLER test_fdw_handler HANDLER an...
221+ ^
218222ALTER FOREIGN DATA WRAPPER foo HANDLER test_fdw_handler;
219223WARNING: changing the foreign-data wrapper handler can change behavior of existing foreign tables
220224DROP FUNCTION invalid_fdw_handler();
@@ -328,7 +332,6 @@ CREATE SERVER s6 VERSION '16.0' FOREIGN DATA WRAPPER foo OPTIONS (host 'a', dbna
328332CREATE SERVER s7 TYPE 'oracle' VERSION '17.0' FOREIGN DATA WRAPPER foo OPTIONS (host 'a', dbname 'b');
329333CREATE SERVER s8 FOREIGN DATA WRAPPER postgresql OPTIONS (foo '1'); -- ERROR
330334ERROR: invalid option "foo"
331- HINT: Valid options in this context are: authtype, service, connect_timeout, dbname, host, hostaddr, port, tty, options, requiressl, sslmode, gsslib
332335CREATE SERVER s8 FOREIGN DATA WRAPPER postgresql OPTIONS (host 'localhost', dbname 's8db');
333336\des+ :NO_BUILTINS
334337 List of foreign servers
@@ -439,11 +442,10 @@ ERROR: permission denied for foreign-data wrapper foo
439442RESET ROLE;
440443ALTER SERVER s8 OPTIONS (foo '1'); -- ERROR option validation
441444ERROR: invalid option "foo"
442- HINT: Valid options in this context are: authtype, service, connect_timeout, dbname, host, hostaddr, port, tty, options, requiressl, sslmode, gsslib
443445ALTER SERVER s8 OPTIONS (connect_timeout '30', SET dbname 'db1', DROP host);
444446SET ROLE regress_test_role;
445447ALTER SERVER s1 OWNER TO regress_test_indirect; -- ERROR
446- ERROR: must be member of role "regress_test_indirect"
448+ ERROR: must be able to SET ROLE "regress_test_indirect"
447449RESET ROLE;
448450GRANT regress_test_indirect TO regress_test_role;
449451SET ROLE regress_test_role;
@@ -596,7 +598,7 @@ ERROR: user mapping for "regress_foreign_data_user" already exists for server "
596598CREATE USER MAPPING FOR public SERVER s4 OPTIONS ("this mapping" 'is public');
597599CREATE USER MAPPING FOR user SERVER s8 OPTIONS (username 'test', password 'secret'); -- ERROR
598600ERROR: invalid option "username"
599- HINT: Valid options in this context are: user, password
601+ HINT: Perhaps you meant the option " user".
600602CREATE USER MAPPING FOR user SERVER s8 OPTIONS (user 'test', password 'secret');
601603ALTER SERVER s5 OWNER TO regress_test_role;
602604ALTER SERVER s6 OWNER TO regress_test_indirect;
@@ -635,7 +637,7 @@ ALTER USER MAPPING FOR public SERVER s5 OPTIONS (gotcha 'true'); -- E
635637ERROR: user mapping for "public" does not exist for server "s5"
636638ALTER USER MAPPING FOR current_user SERVER s8 OPTIONS (username 'test'); -- ERROR
637639ERROR: invalid option "username"
638- HINT: Valid options in this context are: user, password
640+ HINT: Perhaps you meant the option " user".
639641ALTER USER MAPPING FOR current_user SERVER s8 OPTIONS (DROP user, SET password 'public');
640642SET ROLE regress_test_role;
641643ALTER USER MAPPING FOR current_user SERVER s5 OPTIONS (ADD modified '1');
@@ -754,7 +756,8 @@ FDW options: (delimiter ',', quote '"', "be quoted" 'value')
754756(1 row)
755757
756758CREATE INDEX id_ft1_c2 ON ft1 (c2); -- ERROR
757- ERROR: cannot create index on foreign table "ft1"
759+ ERROR: cannot create index on relation "ft1"
760+ DETAIL: This operation is not supported for foreign tables.
758761SELECT * FROM ft1; -- ERROR
759762ERROR: foreign-data wrapper "dummy" has no handler
760763EXPLAIN SELECT * FROM ft1; -- ERROR
@@ -878,7 +881,8 @@ LINE 1: ALTER FOREIGN TABLE ft1 ADD PRIMARY KEY (c7);
878881 ^
879882ALTER FOREIGN TABLE ft1 ADD CONSTRAINT ft1_c9_check CHECK (c9 < 0) NOT VALID;
880883ALTER FOREIGN TABLE ft1 ALTER CONSTRAINT ft1_c9_check DEFERRABLE; -- ERROR
881- ERROR: "ft1" is not a table
884+ ERROR: ALTER action ALTER CONSTRAINT cannot be performed on relation "ft1"
885+ DETAIL: This operation is not supported for foreign tables.
882886ALTER FOREIGN TABLE ft1 DROP CONSTRAINT ft1_c9_check;
883887ALTER FOREIGN TABLE ft1 DROP CONSTRAINT no_const; -- ERROR
884888ERROR: constraint "no_const" of relation "ft1" does not exist
@@ -895,7 +899,8 @@ ALTER FOREIGN TABLE ft1 SET SCHEMA foreign_schema;
895899ALTER FOREIGN TABLE ft1 SET TABLESPACE ts; -- ERROR
896900ERROR: relation "ft1" does not exist
897901ALTER FOREIGN TABLE foreign_schema.ft1 SET TABLESPACE ts; -- ERROR
898- ERROR: "ft1" is not a table, materialized view, index, or partitioned index
902+ ERROR: ALTER action SET TABLESPACE cannot be performed on relation "ft1"
903+ DETAIL: This operation is not supported for foreign tables.
899904ALTER FOREIGN TABLE foreign_schema.ft1 RENAME c1 TO foreign_column_1;
900905ALTER FOREIGN TABLE foreign_schema.ft1 RENAME TO foreign_table_1;
901906\d foreign_schema.foreign_table_1
@@ -1411,7 +1416,7 @@ CREATE FOREIGN TABLE ft2 () INHERITS (fd_pt1)
14111416 c1 | integer | | not null | | plain | |
14121417 c2 | text | | | | extended | |
14131418 c3 | date | | | | plain | |
1414- Child tables: ft2
1419+ Child tables: ft2, FOREIGN
14151420
14161421\d+ ft2
14171422 Foreign table "public.ft2"
@@ -1456,7 +1461,7 @@ ALTER FOREIGN TABLE ft2 INHERIT fd_pt1;
14561461 c1 | integer | | not null | | plain | |
14571462 c2 | text | | | | extended | |
14581463 c3 | date | | | | plain | |
1459- Child tables: ft2
1464+ Child tables: ft2, FOREIGN
14601465
14611466\d+ ft2
14621467 Foreign table "public.ft2"
@@ -1491,7 +1496,7 @@ NOTICE: merging column "c3" with inherited definition
14911496Server: s0
14921497FDW options: (delimiter ',', quote '"', "be quoted" 'value')
14931498Inherits: fd_pt1
1494- Child tables: ft3
1499+ Child tables: ft3, FOREIGN
14951500
14961501-- start_ignore
14971502-- GPDB: ct3 is not created.
@@ -1525,7 +1530,7 @@ ALTER TABLE fd_pt1 ADD COLUMN c8 integer;
15251530 c6 | integer | | | | plain | |
15261531 c7 | integer | | not null | | plain | |
15271532 c8 | integer | | | | plain | |
1528- Child tables: ft2
1533+ Child tables: ft2, FOREIGN
15291534
15301535\d+ ft2
15311536 Foreign table "public.ft2"
@@ -1542,7 +1547,7 @@ Child tables: ft2
15421547Server: s0
15431548FDW options: (delimiter ',', quote '"', "be quoted" 'value')
15441549Inherits: fd_pt1
1545- Child tables: ft3
1550+ Child tables: ft3, FOREIGN
15461551
15471552-- start_ignore
15481553-- GPDB: ct3 is not created.
@@ -1588,7 +1593,7 @@ ALTER TABLE fd_pt1 ALTER COLUMN c8 SET STORAGE EXTERNAL;
15881593 c6 | integer | | not null | | plain | |
15891594 c7 | integer | | | | plain | |
15901595 c8 | text | | | | external | |
1591- Child tables: ft2
1596+ Child tables: ft2, FOREIGN
15921597
15931598\d+ ft2
15941599 Foreign table "public.ft2"
@@ -1605,7 +1610,7 @@ Child tables: ft2
16051610Server: s0
16061611FDW options: (delimiter ',', quote '"', "be quoted" 'value')
16071612Inherits: fd_pt1
1608- Child tables: ft3
1613+ Child tables: ft3, FOREIGN
16091614
16101615-- drop attributes recursively
16111616ALTER TABLE fd_pt1 DROP COLUMN c4;
@@ -1620,7 +1625,7 @@ ALTER TABLE fd_pt1 DROP COLUMN c8;
16201625 c1 | integer | | not null | | plain | 10000 |
16211626 c2 | text | | | | extended | |
16221627 c3 | date | | | | plain | |
1623- Child tables: ft2
1628+ Child tables: ft2, FOREIGN
16241629
16251630\d+ ft2
16261631 Foreign table "public.ft2"
@@ -1632,7 +1637,7 @@ Child tables: ft2
16321637Server: s0
16331638FDW options: (delimiter ',', quote '"', "be quoted" 'value')
16341639Inherits: fd_pt1
1635- Child tables: ft3
1640+ Child tables: ft3, FOREIGN
16361641
16371642-- add constraints recursively
16381643ALTER TABLE fd_pt1 ADD CONSTRAINT fd_pt1chk1 CHECK (c1 > 0) NO INHERIT;
@@ -1659,7 +1664,7 @@ SELECT relname, conname, contype, conislocal, coninhcount, connoinherit
16591664Check constraints:
16601665 "fd_pt1chk1" CHECK (c1 > 0) NO INHERIT
16611666 "fd_pt1chk2" CHECK (c2 <> ''::text)
1662- Child tables: ft2
1667+ Child tables: ft2, FOREIGN
16631668
16641669\d+ ft2
16651670 Foreign table "public.ft2"
@@ -1673,7 +1678,7 @@ Check constraints:
16731678Server: s0
16741679FDW options: (delimiter ',', quote '"', "be quoted" 'value')
16751680Inherits: fd_pt1
1676- Child tables: ft3
1681+ Child tables: ft3, FOREIGN
16771682
16781683DROP FOREIGN TABLE ft2; -- ERROR
16791684ERROR: cannot drop foreign table ft2 because other objects depend on it
@@ -1702,7 +1707,7 @@ ALTER FOREIGN TABLE ft2 INHERIT fd_pt1;
17021707Check constraints:
17031708 "fd_pt1chk1" CHECK (c1 > 0) NO INHERIT
17041709 "fd_pt1chk2" CHECK (c2 <> ''::text)
1705- Child tables: ft2
1710+ Child tables: ft2, FOREIGN
17061711
17071712\d+ ft2
17081713 Foreign table "public.ft2"
@@ -1733,7 +1738,7 @@ ALTER TABLE fd_pt1 ADD CONSTRAINT fd_pt1chk3 CHECK (c2 <> '') NOT VALID;
17331738 c3 | date | | | | plain | |
17341739Check constraints:
17351740 "fd_pt1chk3" CHECK (c2 <> ''::text) NOT VALID
1736- Child tables: ft2
1741+ Child tables: ft2, FOREIGN
17371742
17381743\d+ ft2
17391744 Foreign table "public.ft2"
@@ -1760,7 +1765,7 @@ ALTER TABLE fd_pt1 VALIDATE CONSTRAINT fd_pt1chk3;
17601765 c3 | date | | | | plain | |
17611766Check constraints:
17621767 "fd_pt1chk3" CHECK (c2 <> ''::text)
1763- Child tables: ft2
1768+ Child tables: ft2, FOREIGN
17641769
17651770\d+ ft2
17661771 Foreign table "public.ft2"
@@ -1791,7 +1796,7 @@ ALTER TABLE fd_pt1 RENAME CONSTRAINT fd_pt1chk3 TO f2_check;
17911796 f3 | date | | | | plain | |
17921797Check constraints:
17931798 "f2_check" CHECK (f2 <> ''::text)
1794- Child tables: ft2
1799+ Child tables: ft2, FOREIGN
17951800
17961801\d+ ft2
17971802 Foreign table "public.ft2"
@@ -1854,7 +1859,7 @@ CREATE FOREIGN TABLE fd_pt2_1 PARTITION OF fd_pt2 FOR VALUES IN (1)
18541859 c2 | text | | | | extended | |
18551860 c3 | date | | | | plain | |
18561861Partition key: LIST (c1)
1857- Partitions: fd_pt2_1 FOR VALUES IN (1)
1862+ Partitions: fd_pt2_1 FOR VALUES IN (1), FOREIGN
18581863
18591864\d+ fd_pt2_1
18601865 Foreign table "public.fd_pt2_1"
@@ -1926,7 +1931,7 @@ ALTER TABLE fd_pt2 ATTACH PARTITION fd_pt2_1 FOR VALUES IN (1);
19261931 c2 | text | | | | extended | |
19271932 c3 | date | | | | plain | |
19281933Partition key: LIST (c1)
1929- Partitions: fd_pt2_1 FOR VALUES IN (1)
1934+ Partitions: fd_pt2_1 FOR VALUES IN (1), FOREIGN
19301935
19311936\d+ fd_pt2_1
19321937 Foreign table "public.fd_pt2_1"
@@ -1954,7 +1959,7 @@ ALTER TABLE fd_pt2_1 ADD CONSTRAINT p21chk CHECK (c2 <> '');
19541959 c2 | text | | | | extended | |
19551960 c3 | date | | | | plain | |
19561961Partition key: LIST (c1)
1957- Partitions: fd_pt2_1 FOR VALUES IN (1)
1962+ Partitions: fd_pt2_1 FOR VALUES IN (1), FOREIGN
19581963
19591964\d+ fd_pt2_1
19601965 Foreign table "public.fd_pt2_1"
0 commit comments