Accept changes in foreign_data test due to unsupported FDW
authorTomas Vondra <[email protected]>
Mon, 17 Jul 2017 23:22:26 +0000 (01:22 +0200)
committerTomas Vondra <[email protected]>
Mon, 17 Jul 2017 23:22:26 +0000 (01:22 +0200)
Postgres-XL does not support Foreign Data Wrappers, so accept failures
and output differences in the foreign_data regression test as expected.

src/test/regress/expected/foreign_data.out

index dc6a61b6d83457003e0031893200473af17f790f..3c93fbeed422c629f1e870fc68a67a6545953e6f 100644 (file)
@@ -217,9 +217,11 @@ CREATE USER MAPPING FOR current_user SERVER s1;
 ERROR:  Postgres-XL does not support USER MAPPING yet
 DETAIL:  The feature is not currently supported
 CREATE USER MAPPING FOR current_user SERVER s1;                                -- ERROR
-ERROR:  user mapping for "regress_foreign_data_user" already exists for server s1
+ERROR:  Postgres-XL does not support USER MAPPING yet
+DETAIL:  The feature is not currently supported
 CREATE USER MAPPING IF NOT EXISTS FOR current_user SERVER s1; -- NOTICE
-NOTICE:  user mapping for "regress_foreign_data_user" already exists for server s1, skipping
+ERROR:  Postgres-XL does not support USER MAPPING yet
+DETAIL:  The feature is not currently supported
 \dew+
                            List of foreign-data wrappers
  Name | Owner | Handler | Validator | Access privileges | FDW options | Description 
@@ -277,6 +279,9 @@ DETAIL:  The feature is not currently supported
 CREATE SERVER s1 FOREIGN DATA WRAPPER foo;                  -- ERROR
 ERROR:  Postgres-XL does not support SERVER yet
 DETAIL:  The feature is not currently supported
+CREATE SERVER IF NOT EXISTS s1 FOREIGN DATA WRAPPER foo;       -- No ERROR, just NOTICE
+ERROR:  Postgres-XL does not support SERVER yet
+DETAIL:  The feature is not currently supported
 CREATE SERVER s2 FOREIGN DATA WRAPPER foo OPTIONS (host 'a', dbname 'b');
 ERROR:  Postgres-XL does not support SERVER yet
 DETAIL:  The feature is not currently supported
@@ -306,6 +311,7 @@ DETAIL:  The feature is not currently supported
  Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | FDW options | Description 
 ------+-------+----------------------+-------------------+------+---------+-------------+-------------
 (0 rows)
+
 SET ROLE regress_test_role;
 CREATE SERVER t1 FOREIGN DATA WRAPPER foo;                 -- ERROR: no usage on FDW
 ERROR:  Postgres-XL does not support SERVER yet
@@ -1061,62 +1067,42 @@ ERROR:  Postgres-XL does not support USER MAPPING yet
 DETAIL:  The feature is not currently supported
 DROP SERVER s9 CASCADE;                                         -- ERROR
 ERROR:  server "s9" does not exist
-ERROR:  must be owner of foreign server s9
 -- Check visibility of user mapping data
 SET ROLE regress_test_role;
 CREATE SERVER s10 FOREIGN DATA WRAPPER foo;
+ERROR:  Postgres-XL does not support SERVER yet
+DETAIL:  The feature is not currently supported
 CREATE USER MAPPING FOR public SERVER s10 OPTIONS (user 'secret');
+ERROR:  Postgres-XL does not support USER MAPPING yet
+DETAIL:  The feature is not currently supported
 GRANT USAGE ON FOREIGN SERVER s10 TO regress_unprivileged_role;
+ERROR:  server "s10" does not exist
 -- owner of server can see option fields
 \deu+
-                 List of user mappings
- Server |         User name         |    FDW options    
---------+---------------------------+-------------------
- s10    | public                    | ("user" 'secret')
- s4     | regress_foreign_data_user | 
- s5     | regress_test_role         | (modified '1')
- s6     | regress_test_role         | 
- s8     | public                    | 
- s8     | regress_foreign_data_user | 
- s9     | regress_unprivileged_role | 
- t1     | public                    | (modified '1')
-(8 rows)
+      List of user mappings
+ Server | User name | FDW options 
+--------+-----------+-------------
+(0 rows)
 
 RESET ROLE;
 -- superuser can see option fields
 \deu+
-                  List of user mappings
- Server |         User name         |     FDW options     
---------+---------------------------+---------------------
- s10    | public                    | ("user" 'secret')
- s4     | regress_foreign_data_user | 
- s5     | regress_test_role         | (modified '1')
- s6     | regress_test_role         | 
- s8     | public                    | 
- s8     | regress_foreign_data_user | (password 'public')
- s9     | regress_unprivileged_role | 
- t1     | public                    | (modified '1')
-(8 rows)
+      List of user mappings
+ Server | User name | FDW options 
+--------+-----------+-------------
+(0 rows)
 
 -- unprivileged user cannot see option fields
 SET ROLE regress_unprivileged_role;
 \deu+
-              List of user mappings
- Server |         User name         | FDW options 
---------+---------------------------+-------------
- s10    | public                    | 
- s4     | regress_foreign_data_user | 
- s5     | regress_test_role         | 
- s6     | regress_test_role         | 
- s8     | public                    | 
- s8     | regress_foreign_data_user | 
- s9     | regress_unprivileged_role | 
- t1     | public                    | 
-(8 rows)
+      List of user mappings
+ Server | User name | FDW options 
+--------+-----------+-------------
+(0 rows)
 
 RESET ROLE;
 DROP SERVER s10 CASCADE;
-NOTICE:  drop cascades to user mapping for public on server s10
+ERROR:  server "s10" does not exist
 -- Triggers
 CREATE FUNCTION dummy_trigger() RETURNS TRIGGER AS $$
   BEGIN
@@ -1140,8 +1126,8 @@ ON foreign_schema.foreign_table_1
 REFERENCING NEW TABLE AS new_table
 FOR EACH STATEMENT
 EXECUTE PROCEDURE dummy_trigger();
-ERROR:  "foreign_table_1" is a foreign table
-DETAIL:  Triggers on foreign tables cannot have transition tables.
+ERROR:  Postgres-XL does not support TRIGGER yet
+DETAIL:  The feature is not currently supported
 CREATE TRIGGER trigtest_before_row BEFORE INSERT OR UPDATE OR DELETE
 ON foreign_schema.foreign_table_1
 FOR EACH ROW
@@ -1227,16 +1213,6 @@ Distribute By: HASH(c1)
 Location Nodes: ALL DATANODES
 
 \d+ ft2
-                                       Foreign table "public.ft2"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
-Server: s0
-FDW options: (delimiter ',', quote '"', "be quoted" 'value')
-Inherits: pt1
-
 CREATE TABLE ct3() INHERITS(ft2);
 ERROR:  relation "ft2" does not exist
 CREATE FOREIGN TABLE ft3 (
@@ -1490,7 +1466,6 @@ ERROR:  foreign table "foreign_table_1" does not exist
 REASSIGN OWNED BY regress_test_role TO regress_test_role2;
 DROP OWNED BY regress_test_role2;
 DROP OWNED BY regress_test_role2 CASCADE;
-NOTICE:  drop cascades to user mapping for regress_test_role on server s5
 -- Foreign partition DDL stuff
 CREATE TABLE pt2 (
        c1 integer NOT NULL,
@@ -1499,6 +1474,7 @@ CREATE TABLE pt2 (
 ) PARTITION BY LIST (c1);
 CREATE FOREIGN TABLE pt2_1 PARTITION OF pt2 FOR VALUES IN (1)
   SERVER s0 OPTIONS (delimiter ',', quote '"', "be quoted" 'value');
+ERROR:  server "s0" does not exist
 \d+ pt2
                                     Table "public.pt2"
  Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
@@ -1507,43 +1483,25 @@ CREATE FOREIGN TABLE pt2_1 PARTITION OF pt2 FOR VALUES IN (1)
  c2     | text    |           |          |         | extended |              | 
  c3     | date    |           |          |         | plain    |              | 
 Partition key: LIST (c1)
-Partitions: pt2_1 FOR VALUES IN (1)
+Distribute By: HASH(c1)
+Location Nodes: ALL DATANODES
 
 \d+ pt2_1
-                                      Foreign table "public.pt2_1"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
-Partition of: pt2 FOR VALUES IN (1)
-Partition constraint: ((c1 IS NOT NULL) AND (c1 = ANY (ARRAY[1])))
-Server: s0
-FDW options: (delimiter ',', quote '"', "be quoted" 'value')
-
 -- partition cannot have additional columns
 DROP FOREIGN TABLE pt2_1;
+ERROR:  foreign table "pt2_1" does not exist
 CREATE FOREIGN TABLE pt2_1 (
        c1 integer NOT NULL,
        c2 text,
        c3 date,
        c4 char
 ) SERVER s0 OPTIONS (delimiter ',', quote '"', "be quoted" 'value');
+ERROR:  server "s0" does not exist
 \d+ pt2_1
-                                         Foreign table "public.pt2_1"
- Column |     Type     | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+--------------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer      |           | not null |         |             | plain    |              | 
- c2     | text         |           |          |         |             | extended |              | 
- c3     | date         |           |          |         |             | plain    |              | 
- c4     | character(1) |           |          |         |             | extended |              | 
-Server: s0
-FDW options: (delimiter ',', quote '"', "be quoted" 'value')
-
 ALTER TABLE pt2 ATTACH PARTITION pt2_1 FOR VALUES IN (1);       -- ERROR
-ERROR:  table "pt2_1" contains column "c4" not found in parent "pt2"
-DETAIL:  New partition should contain only the columns present in parent.
+ERROR:  relation "pt2_1" does not exist
 DROP FOREIGN TABLE pt2_1;
+ERROR:  foreign table "pt2_1" does not exist
 \d+ pt2
                                     Table "public.pt2"
  Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
@@ -1552,24 +1510,19 @@ DROP FOREIGN TABLE pt2_1;
  c2     | text    |           |          |         | extended |              | 
  c3     | date    |           |          |         | plain    |              | 
 Partition key: LIST (c1)
+Distribute By: HASH(c1)
+Location Nodes: ALL DATANODES
 
 CREATE FOREIGN TABLE pt2_1 (
        c1 integer NOT NULL,
        c2 text,
        c3 date
 ) SERVER s0 OPTIONS (delimiter ',', quote '"', "be quoted" 'value');
+ERROR:  server "s0" does not exist
 \d+ pt2_1
-                                      Foreign table "public.pt2_1"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
-Server: s0
-FDW options: (delimiter ',', quote '"', "be quoted" 'value')
-
 -- no attach partition validation occurs for foreign tables
 ALTER TABLE pt2 ATTACH PARTITION pt2_1 FOR VALUES IN (1);
+ERROR:  relation "pt2_1" does not exist
 \d+ pt2
                                     Table "public.pt2"
  Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
@@ -1578,26 +1531,18 @@ ALTER TABLE pt2 ATTACH PARTITION pt2_1 FOR VALUES IN (1);
  c2     | text    |           |          |         | extended |              | 
  c3     | date    |           |          |         | plain    |              | 
 Partition key: LIST (c1)
-Partitions: pt2_1 FOR VALUES IN (1)
+Distribute By: HASH(c1)
+Location Nodes: ALL DATANODES
 
 \d+ pt2_1
-                                      Foreign table "public.pt2_1"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
-Partition of: pt2 FOR VALUES IN (1)
-Partition constraint: ((c1 IS NOT NULL) AND (c1 = ANY (ARRAY[1])))
-Server: s0
-FDW options: (delimiter ',', quote '"', "be quoted" 'value')
-
 -- cannot add column to a partition
 ALTER TABLE pt2_1 ADD c4 char;
-ERROR:  cannot add column to a partition
+ERROR:  relation "pt2_1" does not exist
 -- ok to have a partition's own constraints though
 ALTER TABLE pt2_1 ALTER c3 SET NOT NULL;
+ERROR:  relation "pt2_1" does not exist
 ALTER TABLE pt2_1 ADD CONSTRAINT p21chk CHECK (c2 <> '');
+ERROR:  relation "pt2_1" does not exist
 \d+ pt2
                                     Table "public.pt2"
  Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
@@ -1606,27 +1551,16 @@ ALTER TABLE pt2_1 ADD CONSTRAINT p21chk CHECK (c2 <> '');
  c2     | text    |           |          |         | extended |              | 
  c3     | date    |           |          |         | plain    |              | 
 Partition key: LIST (c1)
-Partitions: pt2_1 FOR VALUES IN (1)
+Distribute By: HASH(c1)
+Location Nodes: ALL DATANODES
 
 \d+ pt2_1
-                                      Foreign table "public.pt2_1"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           | not null |         |             | plain    |              | 
-Partition of: pt2 FOR VALUES IN (1)
-Partition constraint: ((c1 IS NOT NULL) AND (c1 = ANY (ARRAY[1])))
-Check constraints:
-    "p21chk" CHECK (c2 <> ''::text)
-Server: s0
-FDW options: (delimiter ',', quote '"', "be quoted" 'value')
-
 -- cannot drop inherited NOT NULL constraint from a partition
 ALTER TABLE pt2_1 ALTER c1 DROP NOT NULL;
-ERROR:  column "c1" is marked NOT NULL in parent table
+ERROR:  relation "pt2_1" does not exist
 -- partition must have parent's constraints
 ALTER TABLE pt2 DETACH PARTITION pt2_1;
+ERROR:  relation "pt2_1" does not exist
 ALTER TABLE pt2 ALTER c2 SET NOT NULL;
 \d+ pt2
                                     Table "public.pt2"
@@ -1636,24 +1570,18 @@ ALTER TABLE pt2 ALTER c2 SET NOT NULL;
  c2     | text    |           | not null |         | extended |              | 
  c3     | date    |           |          |         | plain    |              | 
 Partition key: LIST (c1)
+Distribute By: HASH(c1)
+Location Nodes: ALL DATANODES
 
 \d+ pt2_1
-                                      Foreign table "public.pt2_1"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           | not null |         |             | plain    |              | 
-Check constraints:
-    "p21chk" CHECK (c2 <> ''::text)
-Server: s0
-FDW options: (delimiter ',', quote '"', "be quoted" 'value')
-
 ALTER TABLE pt2 ATTACH PARTITION pt2_1 FOR VALUES IN (1);       -- ERROR
-ERROR:  column "c2" in child table must be marked NOT NULL
+ERROR:  relation "pt2_1" does not exist
 ALTER FOREIGN TABLE pt2_1 ALTER c2 SET NOT NULL;
+ERROR:  relation "pt2_1" does not exist
 ALTER TABLE pt2 ATTACH PARTITION pt2_1 FOR VALUES IN (1);
+ERROR:  relation "pt2_1" does not exist
 ALTER TABLE pt2 DETACH PARTITION pt2_1;
+ERROR:  relation "pt2_1" does not exist
 ALTER TABLE pt2 ADD CONSTRAINT pt2chk1 CHECK (c1 > 0);
 \d+ pt2
                                     Table "public.pt2"
@@ -1665,29 +1593,22 @@ ALTER TABLE pt2 ADD CONSTRAINT pt2chk1 CHECK (c1 > 0);
 Partition key: LIST (c1)
 Check constraints:
     "pt2chk1" CHECK (c1 > 0)
+Distribute By: HASH(c1)
+Location Nodes: ALL DATANODES
 
 \d+ pt2_1
-                                      Foreign table "public.pt2_1"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           | not null |         |             | extended |              | 
- c3     | date    |           | not null |         |             | plain    |              | 
-Check constraints:
-    "p21chk" CHECK (c2 <> ''::text)
-Server: s0
-FDW options: (delimiter ',', quote '"', "be quoted" 'value')
-
 ALTER TABLE pt2 ATTACH PARTITION pt2_1 FOR VALUES IN (1);       -- ERROR
-ERROR:  child table is missing constraint "pt2chk1"
+ERROR:  relation "pt2_1" does not exist
 ALTER FOREIGN TABLE pt2_1 ADD CONSTRAINT pt2chk1 CHECK (c1 > 0);
+ERROR:  relation "pt2_1" does not exist
 ALTER TABLE pt2 ATTACH PARTITION pt2_1 FOR VALUES IN (1);
+ERROR:  relation "pt2_1" does not exist
 -- TRUNCATE doesn't work on foreign tables, either directly or recursively
 TRUNCATE pt2_1;  -- ERROR
-ERROR:  "pt2_1" is not a table
+ERROR:  relation "pt2_1" does not exist
 TRUNCATE pt2;  -- ERROR
-ERROR:  "pt2_1" is not a table
 DROP FOREIGN TABLE pt2_1;
+ERROR:  foreign table "pt2_1" does not exist
 DROP TABLE pt2;
 -- Cleanup
 DROP SCHEMA foreign_schema CASCADE;