diff options
Diffstat (limited to 'contrib/postgres_fdw/expected/postgres_fdw.out')
-rw-r--r-- | contrib/postgres_fdw/expected/postgres_fdw.out | 163 |
1 files changed, 25 insertions, 138 deletions
diff --git a/contrib/postgres_fdw/expected/postgres_fdw.out b/contrib/postgres_fdw/expected/postgres_fdw.out index eb4716bed81..4b6e49a5d95 100644 --- a/contrib/postgres_fdw/expected/postgres_fdw.out +++ b/contrib/postgres_fdw/expected/postgres_fdw.out @@ -710,12 +710,12 @@ EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = -c1; -- Op Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" = (- "C 1"))) (3 rows) -EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE (c1 IS NOT NULL) IS DISTINCT FROM (c1 IS NOT NULL); -- DistinctExpr - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------- +EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE (c3 IS NOT NULL) IS DISTINCT FROM (c3 IS NOT NULL); -- DistinctExpr + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------- Foreign Scan on public.ft1 t1 Output: c1, c2, c3, c4, c5, c6, c7, c8 - Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE ((("C 1" IS NOT NULL) IS DISTINCT FROM ("C 1" IS NOT NULL))) + Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (((c3 IS NOT NULL) IS DISTINCT FROM (c3 IS NOT NULL))) (3 rows) EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE c1 = ANY(ARRAY[c2, 1, c1 + 0]); -- ScalarArrayOpExpr @@ -1180,6 +1180,27 @@ SELECT * FROM ft1 WHERE CASE c3 COLLATE "C" WHEN c6 THEN true ELSE c3 < 'bar' EN Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" (4 rows) +-- Test array type conversion pushdown +SET plan_cache_mode = force_generic_plan; +PREPARE s(varchar[]) AS SELECT count(*) FROM ft2 WHERE c6 = ANY ($1); +EXPLAIN (VERBOSE, COSTS OFF) +EXECUTE s(ARRAY['1','2']); + QUERY PLAN +--------------------------------------------------------------------------------------------- + Foreign Scan + Output: (count(*)) + Relations: Aggregate on (public.ft2) + Remote SQL: SELECT count(*) FROM "S 1"."T 1" WHERE ((c6 = ANY ($1::character varying[]))) +(4 rows) + +EXECUTE s(ARRAY['1','2']); + count +------- + 200 +(1 row) + +DEALLOCATE s; +RESET plan_cache_mode; -- a regconfig constant referring to this text search configuration -- is initially unshippable CREATE TEXT SEARCH CONFIGURATION public.custom_search @@ -12384,140 +12405,6 @@ SELECT count(*) FROM remote_application_name DROP FOREIGN TABLE remote_application_name; DROP VIEW my_application_name; -- =================================================================== --- test read-only and/or deferrable transactions --- =================================================================== -CREATE TABLE loct (f1 int, f2 text); -CREATE FUNCTION locf() RETURNS SETOF loct LANGUAGE SQL AS - 'UPDATE public.loct SET f2 = f2 || f2 RETURNING *'; -CREATE VIEW locv AS SELECT t.* FROM locf() t; -CREATE FOREIGN TABLE remt (f1 int, f2 text) - SERVER loopback OPTIONS (table_name 'locv'); -CREATE FOREIGN TABLE remt2 (f1 int, f2 text) - SERVER loopback2 OPTIONS (table_name 'locv'); -INSERT INTO loct VALUES (1, 'foo'), (2, 'bar'); -START TRANSACTION READ ONLY; -SAVEPOINT s; -SELECT * FROM remt; -- should fail -ERROR: cannot execute UPDATE in a read-only transaction -CONTEXT: SQL function "locf" statement 1 -remote SQL command: SELECT f1, f2 FROM public.locv -ROLLBACK TO s; -RELEASE SAVEPOINT s; -SELECT * FROM remt; -- should fail -ERROR: cannot execute UPDATE in a read-only transaction -CONTEXT: SQL function "locf" statement 1 -remote SQL command: SELECT f1, f2 FROM public.locv -ROLLBACK; -START TRANSACTION; -SAVEPOINT s; -SET transaction_read_only = on; -SELECT * FROM remt; -- should fail -ERROR: cannot execute UPDATE in a read-only transaction -CONTEXT: SQL function "locf" statement 1 -remote SQL command: SELECT f1, f2 FROM public.locv -ROLLBACK TO s; -RELEASE SAVEPOINT s; -SET transaction_read_only = on; -SELECT * FROM remt; -- should fail -ERROR: cannot execute UPDATE in a read-only transaction -CONTEXT: SQL function "locf" statement 1 -remote SQL command: SELECT f1, f2 FROM public.locv -ROLLBACK; -START TRANSACTION; -SAVEPOINT s; -SELECT * FROM remt; -- should work - f1 | f2 -----+-------- - 1 | foofoo - 2 | barbar -(2 rows) - -SET transaction_read_only = on; -SELECT * FROM remt; -- should fail -ERROR: cannot execute UPDATE in a read-only transaction -CONTEXT: SQL function "locf" statement 1 -remote SQL command: SELECT f1, f2 FROM public.locv -ROLLBACK TO s; -RELEASE SAVEPOINT s; -SELECT * FROM remt; -- should work - f1 | f2 -----+-------- - 1 | foofoo - 2 | barbar -(2 rows) - -SET transaction_read_only = on; -SELECT * FROM remt; -- should fail -ERROR: cannot execute UPDATE in a read-only transaction -CONTEXT: SQL function "locf" statement 1 -remote SQL command: SELECT f1, f2 FROM public.locv -ROLLBACK; -START TRANSACTION; -SAVEPOINT s; -SELECT * FROM remt; -- should work - f1 | f2 -----+-------- - 1 | foofoo - 2 | barbar -(2 rows) - -SET transaction_read_only = on; -SELECT * FROM remt2; -- should fail -ERROR: cannot execute UPDATE in a read-only transaction -CONTEXT: SQL function "locf" statement 1 -remote SQL command: SELECT f1, f2 FROM public.locv -ROLLBACK TO s; -RELEASE SAVEPOINT s; -SELECT * FROM remt; -- should work - f1 | f2 -----+-------- - 1 | foofoo - 2 | barbar -(2 rows) - -SET transaction_read_only = on; -SELECT * FROM remt2; -- should fail -ERROR: cannot execute UPDATE in a read-only transaction -CONTEXT: SQL function "locf" statement 1 -remote SQL command: SELECT f1, f2 FROM public.locv -ROLLBACK; -DROP FOREIGN TABLE remt; -CREATE FOREIGN TABLE remt (f1 int, f2 text) - SERVER loopback OPTIONS (table_name 'loct'); -START TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY; -SELECT * FROM remt; - f1 | f2 -----+----- - 1 | foo - 2 | bar -(2 rows) - -COMMIT; -START TRANSACTION ISOLATION LEVEL SERIALIZABLE DEFERRABLE; -SELECT * FROM remt; - f1 | f2 -----+----- - 1 | foo - 2 | bar -(2 rows) - -COMMIT; -START TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE; -SELECT * FROM remt; - f1 | f2 -----+----- - 1 | foo - 2 | bar -(2 rows) - -COMMIT; --- Clean up -DROP FOREIGN TABLE remt; -DROP FOREIGN TABLE remt2; -DROP VIEW locv; -DROP FUNCTION locf(); -DROP TABLE loct; --- =================================================================== -- test parallel commit and parallel abort -- =================================================================== ALTER SERVER loopback OPTIONS (ADD parallel_commit 'true'); |