@@ -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"
@@ -1492,7 +1497,7 @@ NOTICE: merging column "c3" with inherited definition
14921497Server: s0
14931498FDW options: (delimiter ',', quote '"', "be quoted" 'value')
14941499Inherits: fd_pt1
1495- Child tables: ft3
1500+ Child tables: ft3, FOREIGN
14961501
14971502-- start_ignore
14981503-- GPDB: ct3 is not created.
@@ -1526,7 +1531,8 @@ ALTER TABLE fd_pt1 ADD COLUMN c8 integer;
15261531 c6 | integer | | | | plain | |
15271532 c7 | integer | | not null | | plain | |
15281533 c8 | integer | | | | plain | |
1529- Child tables: ft2
1534+ Child tables: ft2, FOREIGN
1535+ Distributed by: (c1)
15301536
15311537\d+ ft2
15321538 Foreign table "public.ft2"
@@ -1543,7 +1549,7 @@ Child tables: ft2
15431549Server: s0
15441550FDW options: (delimiter ',', quote '"', "be quoted" 'value')
15451551Inherits: fd_pt1
1546- Child tables: ft3
1552+ Child tables: ft3, FOREIGN
15471553
15481554-- start_ignore
15491555-- GPDB: ct3 is not created.
@@ -1589,7 +1595,8 @@ ALTER TABLE fd_pt1 ALTER COLUMN c8 SET STORAGE EXTERNAL;
15891595 c6 | integer | | not null | | plain | |
15901596 c7 | integer | | | | plain | |
15911597 c8 | text | | | | external | |
1592- Child tables: ft2
1598+ Child tables: ft2, FOREIGN
1599+ Distributed by: (c1)
15931600
15941601\d+ ft2
15951602 Foreign table "public.ft2"
@@ -1606,7 +1613,7 @@ Child tables: ft2
16061613Server: s0
16071614FDW options: (delimiter ',', quote '"', "be quoted" 'value')
16081615Inherits: fd_pt1
1609- Child tables: ft3
1616+ Child tables: ft3, FOREIGN
16101617
16111618-- drop attributes recursively
16121619ALTER TABLE fd_pt1 DROP COLUMN c4;
@@ -1621,7 +1628,8 @@ ALTER TABLE fd_pt1 DROP COLUMN c8;
16211628 c1 | integer | | not null | | plain | 10000 |
16221629 c2 | text | | | | extended | |
16231630 c3 | date | | | | plain | |
1624- Child tables: ft2
1631+ Child tables: ft2, FOREIGN
1632+ Distributed by: (c1)
16251633
16261634\d+ ft2
16271635 Foreign table "public.ft2"
@@ -1633,7 +1641,7 @@ Child tables: ft2
16331641Server: s0
16341642FDW options: (delimiter ',', quote '"', "be quoted" 'value')
16351643Inherits: fd_pt1
1636- Child tables: ft3
1644+ Child tables: ft3, FOREIGN
16371645
16381646-- add constraints recursively
16391647ALTER TABLE fd_pt1 ADD CONSTRAINT fd_pt1chk1 CHECK (c1 > 0) NO INHERIT;
@@ -1660,7 +1668,8 @@ SELECT relname, conname, contype, conislocal, coninhcount, connoinherit
16601668Check constraints:
16611669 "fd_pt1chk1" CHECK (c1 > 0) NO INHERIT
16621670 "fd_pt1chk2" CHECK (c2 <> ''::text)
1663- Child tables: ft2
1671+ Child tables: ft2, FOREIGN
1672+ Distributed by: (c1)
16641673
16651674\d+ ft2
16661675 Foreign table "public.ft2"
@@ -1674,7 +1683,7 @@ Check constraints:
16741683Server: s0
16751684FDW options: (delimiter ',', quote '"', "be quoted" 'value')
16761685Inherits: fd_pt1
1677- Child tables: ft3
1686+ Child tables: ft3, FOREIGN
16781687
16791688DROP FOREIGN TABLE ft2; -- ERROR
16801689ERROR: cannot drop foreign table ft2 because other objects depend on it
@@ -1703,7 +1712,8 @@ ALTER FOREIGN TABLE ft2 INHERIT fd_pt1;
17031712Check constraints:
17041713 "fd_pt1chk1" CHECK (c1 > 0) NO INHERIT
17051714 "fd_pt1chk2" CHECK (c2 <> ''::text)
1706- Child tables: ft2
1715+ Child tables: ft2, FOREIGN
1716+ Distributed by: (c1)
17071717
17081718\d+ ft2
17091719 Foreign table "public.ft2"
@@ -1734,7 +1744,8 @@ ALTER TABLE fd_pt1 ADD CONSTRAINT fd_pt1chk3 CHECK (c2 <> '') NOT VALID;
17341744 c3 | date | | | | plain | |
17351745Check constraints:
17361746 "fd_pt1chk3" CHECK (c2 <> ''::text) NOT VALID
1737- Child tables: ft2
1747+ Child tables: ft2, FOREIGN
1748+ Distributed by: (c1)
17381749
17391750\d+ ft2
17401751 Foreign table "public.ft2"
@@ -1761,7 +1772,8 @@ ALTER TABLE fd_pt1 VALIDATE CONSTRAINT fd_pt1chk3;
17611772 c3 | date | | | | plain | |
17621773Check constraints:
17631774 "fd_pt1chk3" CHECK (c2 <> ''::text)
1764- Child tables: ft2
1775+ Child tables: ft2, FOREIGN
1776+ Distributed by: (c1)
17651777
17661778\d+ ft2
17671779 Foreign table "public.ft2"
@@ -1792,7 +1804,8 @@ ALTER TABLE fd_pt1 RENAME CONSTRAINT fd_pt1chk3 TO f2_check;
17921804 f3 | date | | | | plain | |
17931805Check constraints:
17941806 "f2_check" CHECK (f2 <> ''::text)
1795- Child tables: ft2
1807+ Child tables: ft2, FOREIGN
1808+ Distributed by: (f1)
17961809
17971810\d+ ft2
17981811 Foreign table "public.ft2"
@@ -1854,7 +1867,8 @@ CREATE FOREIGN TABLE fd_pt2_1 PARTITION OF fd_pt2 FOR VALUES IN (1)
18541867 c2 | text | | | | extended | |
18551868 c3 | date | | | | plain | |
18561869Partition key: LIST (c1)
1857- Partitions: fd_pt2_1 FOR VALUES IN (1)
1870+ Partitions: fd_pt2_1 FOR VALUES IN (1), FOREIGN
1871+ Distributed by: (c1)
18581872
18591873\d+ fd_pt2_1
18601874 Foreign table "public.fd_pt2_1"
@@ -1926,7 +1940,8 @@ ALTER TABLE fd_pt2 ATTACH PARTITION fd_pt2_1 FOR VALUES IN (1);
19261940 c2 | text | | | | extended | |
19271941 c3 | date | | | | plain | |
19281942Partition key: LIST (c1)
1929- Partitions: fd_pt2_1 FOR VALUES IN (1)
1943+ Partitions: fd_pt2_1 FOR VALUES IN (1), FOREIGN
1944+ Distributed by: (c1)
19301945
19311946\d+ fd_pt2_1
19321947 Foreign table "public.fd_pt2_1"
@@ -1954,7 +1969,8 @@ ALTER TABLE fd_pt2_1 ADD CONSTRAINT p21chk CHECK (c2 <> '');
19541969 c2 | text | | | | extended | |
19551970 c3 | date | | | | plain | |
19561971Partition key: LIST (c1)
1957- Partitions: fd_pt2_1 FOR VALUES IN (1)
1972+ Partitions: fd_pt2_1 FOR VALUES IN (1), FOREIGN
1973+ Distributed by: (c1)
19581974
19591975\d+ fd_pt2_1
19601976 Foreign table "public.fd_pt2_1"
0 commit comments