showing hashjoin batches/buckets in EXPLAIN (not ANALYZE)
Hi,
While working on the patches addressing hashjoin batch explosion [1]/messages/by-id/7bed6c08-72a0-4ab9-a79c-e01fcdd0940f@vondra.me, I
was reminded that we show the estimated nbatch/nbucket values in EXPLAIN
ANALYZE but not in plain EXPLAIN. That makes sense, because we don't
create the hash table until we actually have to (when we start fetching
tuples from the hash join), and explain doesn't get that far, and we
don't want to change that.
But we also calculate the parameters while costing the hashjoin - we
just need to pass the information through Path -> Hash -> HashState, so
that explain has access to that. The attached 0001 patch does that, and
it's pretty simple / non-invasive. Patch 0002 merely adjusts the output
for regression tests affected by 0001.
Paradoxically, this is not particularly helpful for the issues addressed
by [1]/messages/by-id/7bed6c08-72a0-4ab9-a79c-e01fcdd0940f@vondra.me, because those patches are about execution-time issues, e.g. when
we start adding more and more batches. Still, I think the information is
generally useful/interesting when investigating query plans.
I'm not sure if the batches/buckets should be displayed by default, or
only with VERBOSE or something like that (opinions?).
[1]: /messages/by-id/7bed6c08-72a0-4ab9-a79c-e01fcdd0940f@vondra.me
/messages/by-id/7bed6c08-72a0-4ab9-a79c-e01fcdd0940f@vondra.me
regards
--
Tomas Vondra
Attachments:
v20250206-0001-add-nbatch-nbucket-to-explain.patchtext/x-patch; charset=UTF-8; name=v20250206-0001-add-nbatch-nbucket-to-explain.patchDownload
From 2000e31c553a168fc93ca658e194e8a915916167 Mon Sep 17 00:00:00 2001
From: Tomas Vondra <tomas@vondra.me>
Date: Thu, 6 Feb 2025 22:43:05 +0100
Subject: [PATCH v20250206 1/2] add nbatch/nbucket to explain
---
src/backend/commands/explain.c | 18 ++++++++++++++++++
src/backend/executor/nodeHash.c | 3 +++
src/backend/optimizer/path/costsize.c | 1 +
src/backend/optimizer/plan/createplan.c | 3 +++
src/include/nodes/execnodes.h | 4 ++++
src/include/nodes/pathnodes.h | 1 +
src/include/nodes/plannodes.h | 4 ++++
7 files changed, 34 insertions(+)
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index c24e66f82e1..a3333d763b6 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -3490,6 +3490,24 @@ show_hash_info(HashState *hashstate, ExplainState *es)
spacePeakKb);
}
}
+ else
+ {
+ if (es->format != EXPLAIN_FORMAT_TEXT)
+ {
+ ExplainPropertyInteger("Hash Buckets", NULL,
+ hashstate->num_buckets, es);
+ ExplainPropertyInteger("Hash Batches", NULL,
+ hashstate->num_batches, es);
+ }
+ else
+ {
+ ExplainIndentText(es);
+ appendStringInfo(es->str,
+ "Buckets: %d Batches: %d\n",
+ hashstate->num_buckets,
+ hashstate->num_batches);
+ }
+ }
}
/*
diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c
index d34824097f8..f9b13285f5b 100644
--- a/src/backend/executor/nodeHash.c
+++ b/src/backend/executor/nodeHash.c
@@ -389,6 +389,9 @@ ExecInitHash(Hash *node, EState *estate, int eflags)
/* delay building hashtable until ExecHashTableCreate() in executor run */
hashstate->hashtable = NULL;
+ hashstate->num_batches = node->num_batches;
+ hashstate->num_buckets = node->num_buckets;
+
/*
* Miscellaneous initialization
*
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
index 73d78617009..f03c50a6e69 100644
--- a/src/backend/optimizer/path/costsize.c
+++ b/src/backend/optimizer/path/costsize.c
@@ -4315,6 +4315,7 @@ final_cost_hashjoin(PlannerInfo *root, HashPath *path,
/* mark the path with estimated # of batches */
path->num_batches = numbatches;
+ path->num_buckets = numbuckets;
/* store the total number of tuples (sum of partial row estimates) */
path->inner_rows_total = inner_path_rows_total;
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
index 816a2b2a576..b41c265686f 100644
--- a/src/backend/optimizer/plan/createplan.c
+++ b/src/backend/optimizer/plan/createplan.c
@@ -4929,6 +4929,9 @@ create_hashjoin_plan(PlannerInfo *root,
skewColumn,
skewInherit);
+ hash_plan->num_batches = best_path->num_batches;
+ hash_plan->num_buckets = best_path->num_buckets;
+
/*
* Set Hash node's startup & total costs equal to total cost of input
* plan; this only affects EXPLAIN display not decisions.
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index aca15f771a2..fbf64bfd42d 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -2799,6 +2799,10 @@ typedef struct HashState
FmgrInfo *skew_hashfunction; /* lookup data for skew hash function */
Oid skew_collation; /* collation to call skew_hashfunction with */
+ /* expected number of batches and buckets (for explain) */
+ int num_batches;
+ int num_buckets;
+
/*
* In a parallelized hash join, the leader retains a pointer to the
* shared-memory stats area in its shared_info field, and then copies the
diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h
index 52d44f43021..9d639558971 100644
--- a/src/include/nodes/pathnodes.h
+++ b/src/include/nodes/pathnodes.h
@@ -2169,6 +2169,7 @@ typedef struct HashPath
JoinPath jpath;
List *path_hashclauses; /* join clauses used for hashing */
int num_batches; /* number of batches expected */
+ int num_buckets; /* number of buckets expected */
Cardinality inner_rows_total; /* total inner rows expected */
} HashPath;
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h
index 06d9559ebb9..eeb665981f0 100644
--- a/src/include/nodes/plannodes.h
+++ b/src/include/nodes/plannodes.h
@@ -1222,6 +1222,10 @@ typedef struct Hash
bool skewInherit; /* is outer join rel an inheritance tree? */
/* all other info is in the parent HashJoin node */
Cardinality rows_total; /* estimate total rows if parallel_aware */
+
+ /* expected number of batches and buckets (for explain) */
+ int num_batches;
+ int num_buckets;
} Hash;
/* ----------------
--
2.47.1
v20250206-0002-update-regression-tests.patchtext/x-patch; charset=windows-1252; name=v20250206-0002-update-regression-tests.patchDownload
From 18086b7170cde170707e33c4303085556a9e4c4d Mon Sep 17 00:00:00 2001
From: Tomas Vondra <tomas@vondra.me>
Date: Thu, 6 Feb 2025 22:46:39 +0100
Subject: [PATCH v20250206 2/2] update regression tests
---
src/test/regress/expected/aggregates.out | 9 +-
.../regress/expected/collate.icu.utf8.out | 19 +-
.../expected/collate.windows.win1252.out | 995 ----------
src/test/regress/expected/compression.out | 186 +-
src/test/regress/expected/create_view.out | 3 +-
src/test/regress/expected/equivclass.out | 3 +-
.../regress/expected/incremental_sort.out | 4 +-
src/test/regress/expected/inherit.out | 3 +-
src/test/regress/expected/join.out | 195 +-
src/test/regress/expected/join_hash.out | 102 +-
src/test/regress/expected/merge.out | 30 +-
src/test/regress/expected/misc_functions.out | 6 +-
.../regress/expected/partition_aggregate.out | 39 +-
src/test/regress/expected/partition_join.out | 501 +++--
src/test/regress/expected/plpgsql.out | 1 +
src/test/regress/expected/predicate.out | 3 +-
src/test/regress/expected/privileges.out | 3 +-
src/test/regress/expected/returning.out | 8 +-
src/test/regress/expected/rowsecurity.out | 12 +-
src/test/regress/expected/select_parallel.out | 6 +-
src/test/regress/expected/select_views.out | 12 +-
src/test/regress/expected/subselect.out | 46 +-
src/test/regress/expected/sysviews.out | 4 +-
src/test/regress/expected/tidscan.out | 7 +-
src/test/regress/expected/updatable_views.out | 15 +-
src/test/regress/expected/window.out | 3 +-
src/test/regress/expected/with.out | 15 +-
src/test/regress/expected/xml.out | 1703 +++++++----------
src/test/regress/expected/xmlmap.out | 1310 +------------
29 files changed, 1562 insertions(+), 3681 deletions(-)
diff --git a/src/test/regress/expected/aggregates.out b/src/test/regress/expected/aggregates.out
index f2fb66388cc..e8f8112279c 100644
--- a/src/test/regress/expected/aggregates.out
+++ b/src/test/regress/expected/aggregates.out
@@ -1380,8 +1380,9 @@ group by t1.a,t1.b,t1.c,t1.d,t2.x,t2.y,t2.z;
Hash Cond: ((t2.x = t1.a) AND (t2.y = t1.b))
-> Seq Scan on t2
-> Hash
+ Buckets: 2048 Batches: 1
-> Seq Scan on t1
-(7 rows)
+(8 rows)
-- Test case where t1 can be optimized but not t2
explain (costs off) select t1.*,t2.x,t2.z
@@ -1395,8 +1396,9 @@ group by t1.a,t1.b,t1.c,t1.d,t2.x,t2.z;
Hash Cond: ((t2.x = t1.a) AND (t2.y = t1.b))
-> Seq Scan on t2
-> Hash
+ Buckets: 2048 Batches: 1
-> Seq Scan on t1
-(7 rows)
+(8 rows)
-- Cannot optimize when PK is deferrable
explain (costs off) select * from t3 group by a,b,c;
@@ -3338,10 +3340,11 @@ explain (costs off)
-> Seq Scan on tenk1
Filter: (hundred = thousand)
-> Hash
+ Buckets: 1024 Batches: 1
-> HashAggregate
Group Key: onek.twothousand, onek.twothousand
-> Seq Scan on onek
-(8 rows)
+(9 rows)
reset enable_memoize;
--
diff --git a/src/test/regress/expected/collate.icu.utf8.out b/src/test/regress/expected/collate.icu.utf8.out
index 910de9120f2..98400646e36 100644
--- a/src/test/regress/expected/collate.icu.utf8.out
+++ b/src/test/regress/expected/collate.icu.utf8.out
@@ -2334,10 +2334,11 @@ SELECT t1.c, count(t2.c) FROM pagg_tab3 t1 JOIN pagg_tab3 t2 ON t1.c = t2.c GROU
-> Seq Scan on pagg_tab3_p2 t1_1
-> Seq Scan on pagg_tab3_p1 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on pagg_tab3_p2 t2_1
-> Seq Scan on pagg_tab3_p1 t2_2
-(13 rows)
+(14 rows)
SELECT t1.c, count(t2.c) FROM pagg_tab3 t1 JOIN pagg_tab3 t2 ON t1.c = t2.c GROUP BY 1 ORDER BY t1.c COLLATE "C";
c | count
@@ -2361,10 +2362,11 @@ SELECT t1.c, count(t2.c) FROM pagg_tab3 t1 JOIN pagg_tab3 t2 ON t1.c = t2.c GROU
-> Seq Scan on pagg_tab3_p2 t1_1
-> Seq Scan on pagg_tab3_p1 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on pagg_tab3_p2 t2_1
-> Seq Scan on pagg_tab3_p1 t2_2
-(13 rows)
+(14 rows)
SELECT t1.c, count(t2.c) FROM pagg_tab3 t1 JOIN pagg_tab3 t2 ON t1.c = t2.c GROUP BY 1 ORDER BY t1.c COLLATE "C";
c | count
@@ -2387,6 +2389,7 @@ SELECT t1.c COLLATE "C", count(t2.c) FROM pagg_tab3 t1 JOIN pagg_tab3 t2 ON t1.c
Hash Cond: ((t1.c)::text = (t2.c)::text)
-> Seq Scan on pagg_tab3_p2 t1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab3_p2 t2
-> HashAggregate
Group Key: (t1_1.c)::text
@@ -2394,8 +2397,9 @@ SELECT t1.c COLLATE "C", count(t2.c) FROM pagg_tab3 t1 JOIN pagg_tab3 t2 ON t1.c
Hash Cond: ((t1_1.c)::text = (t2_1.c)::text)
-> Seq Scan on pagg_tab3_p1 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab3_p1 t2_1
-(17 rows)
+(19 rows)
SELECT t1.c COLLATE "C", count(t2.c) FROM pagg_tab3 t1 JOIN pagg_tab3 t2 ON t1.c = t2.c COLLATE "C" GROUP BY t1.c COLLATE "C" ORDER BY t1.c COLLATE "C";
c | count
@@ -2421,10 +2425,11 @@ SELECT t1.c COLLATE "C", count(t2.c) FROM pagg_tab3 t1 JOIN pagg_tab3 t2 ON t1.c
-> Seq Scan on pagg_tab3_p2 t1_1
-> Seq Scan on pagg_tab3_p1 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on pagg_tab3_p2 t2_1
-> Seq Scan on pagg_tab3_p1 t2_2
-(13 rows)
+(14 rows)
SELECT t1.c COLLATE "C", count(t2.c) FROM pagg_tab3 t1 JOIN pagg_tab3 t2 ON t1.c = t2.c COLLATE "C" GROUP BY t1.c COLLATE "C" ORDER BY t1.c COLLATE "C";
c | count
@@ -2458,12 +2463,13 @@ SELECT t1.c, count(t2.c) FROM pagg_tab3 t1 JOIN pagg_tab4 t2 ON t1.c = t2.c AND
-> Seq Scan on pagg_tab3_p2 t1_1
-> Seq Scan on pagg_tab3_p1 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on pagg_tab4_p2 t2_1
Filter: (c = b)
-> Seq Scan on pagg_tab4_p1 t2_2
Filter: (c = b)
-(15 rows)
+(16 rows)
SELECT t1.c, count(t2.c) FROM pagg_tab3 t1 JOIN pagg_tab4 t2 ON t1.c = t2.c AND t1.c = t2.b GROUP BY 1 ORDER BY t1.c COLLATE "C";
c | count
@@ -2532,12 +2538,13 @@ SELECT t1.c, count(t2.c) FROM pagg_tab5 t1 JOIN pagg_tab6 t2 ON t1.c = t2.c AND
-> Seq Scan on pagg_tab5_p1 t1_1
-> Seq Scan on pagg_tab5_p2 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on pagg_tab6_p1 t2_1
Filter: (c = b)
-> Seq Scan on pagg_tab6_p2 t2_2
Filter: (c = b)
-(15 rows)
+(16 rows)
SELECT t1.c, count(t2.c) FROM pagg_tab5 t1 JOIN pagg_tab6 t2 ON t1.c = t2.c AND t1.c = t2.b GROUP BY 1 ORDER BY t1.c COLLATE "C";
c | count
diff --git a/src/test/regress/expected/collate.windows.win1252.out b/src/test/regress/expected/collate.windows.win1252.out
index 4644f56b31d..879b12a4a0d 100644
--- a/src/test/regress/expected/collate.windows.win1252.out
+++ b/src/test/regress/expected/collate.windows.win1252.out
@@ -11,998 +11,3 @@ SELECT getdatabaseencoding() <> 'WIN1252' OR
AS skip_test \gset
\if :skip_test
\quit
-\endif
-SET client_encoding TO WIN1252;
-CREATE SCHEMA collate_tests;
-SET search_path = collate_tests;
-CREATE TABLE collate_test1 (
- a int,
- b text COLLATE "en_US" NOT NULL
-);
-\d collate_test1
- Table "collate_tests.collate_test1"
- Column | Type | Collation | Nullable | Default
---------+---------+-----------+----------+---------
- a | integer | | |
- b | text | en_US | not null |
-
-CREATE TABLE collate_test_fail (
- a int,
- b text COLLATE "ja_JP.eucjp"
-);
-ERROR: collation "ja_JP.eucjp" for encoding "WIN1252" does not exist
-LINE 3: b text COLLATE "ja_JP.eucjp"
- ^
-CREATE TABLE collate_test_fail (
- a int,
- b text COLLATE "foo"
-);
-ERROR: collation "foo" for encoding "WIN1252" does not exist
-LINE 3: b text COLLATE "foo"
- ^
-CREATE TABLE collate_test_fail (
- a int COLLATE "en_US",
- b text
-);
-ERROR: collations are not supported by type integer
-LINE 2: a int COLLATE "en_US",
- ^
-CREATE TABLE collate_test_like (
- LIKE collate_test1
-);
-\d collate_test_like
- Table "collate_tests.collate_test_like"
- Column | Type | Collation | Nullable | Default
---------+---------+-----------+----------+---------
- a | integer | | |
- b | text | en_US | not null |
-
-CREATE TABLE collate_test2 (
- a int,
- b text COLLATE "sv_SE"
-);
-CREATE TABLE collate_test3 (
- a int,
- b text COLLATE "C"
-);
-INSERT INTO collate_test1 VALUES (1, 'abc'), (2, 'äbc'), (3, 'bbc'), (4, 'ABC');
-INSERT INTO collate_test2 SELECT * FROM collate_test1;
-INSERT INTO collate_test3 SELECT * FROM collate_test1;
-SELECT * FROM collate_test1 WHERE b >= 'bbc';
- a | b
----+-----
- 3 | bbc
-(1 row)
-
-SELECT * FROM collate_test2 WHERE b >= 'bbc';
- a | b
----+-----
- 2 | äbc
- 3 | bbc
-(2 rows)
-
-SELECT * FROM collate_test3 WHERE b >= 'bbc';
- a | b
----+-----
- 2 | äbc
- 3 | bbc
-(2 rows)
-
-SELECT * FROM collate_test3 WHERE b >= 'BBC';
- a | b
----+-----
- 1 | abc
- 2 | äbc
- 3 | bbc
-(3 rows)
-
-SELECT * FROM collate_test1 WHERE b COLLATE "C" >= 'bbc';
- a | b
----+-----
- 2 | äbc
- 3 | bbc
-(2 rows)
-
-SELECT * FROM collate_test1 WHERE b >= 'bbc' COLLATE "C";
- a | b
----+-----
- 2 | äbc
- 3 | bbc
-(2 rows)
-
-SELECT * FROM collate_test1 WHERE b COLLATE "C" >= 'bbc' COLLATE "C";
- a | b
----+-----
- 2 | äbc
- 3 | bbc
-(2 rows)
-
-SELECT * FROM collate_test1 WHERE b COLLATE "C" >= 'bbc' COLLATE "en_US";
-ERROR: collation mismatch between explicit collations "C" and "en_US"
-LINE 1: ...* FROM collate_test1 WHERE b COLLATE "C" >= 'bbc' COLLATE "e...
- ^
-CREATE DOMAIN testdomain_sv AS text COLLATE "sv_SE";
-CREATE DOMAIN testdomain_i AS int COLLATE "sv_SE"; -- fails
-ERROR: collations are not supported by type integer
-LINE 1: CREATE DOMAIN testdomain_i AS int COLLATE "sv_SE";
- ^
-CREATE TABLE collate_test4 (
- a int,
- b testdomain_sv
-);
-INSERT INTO collate_test4 SELECT * FROM collate_test1;
-SELECT a, b FROM collate_test4 ORDER BY b;
- a | b
----+-----
- 1 | abc
- 4 | ABC
- 3 | bbc
- 2 | äbc
-(4 rows)
-
-CREATE TABLE collate_test5 (
- a int,
- b testdomain_sv COLLATE "en_US"
-);
-INSERT INTO collate_test5 SELECT * FROM collate_test1;
-SELECT a, b FROM collate_test5 ORDER BY b;
- a | b
----+-----
- 1 | abc
- 4 | ABC
- 2 | äbc
- 3 | bbc
-(4 rows)
-
-SELECT a, b FROM collate_test1 ORDER BY b;
- a | b
----+-----
- 1 | abc
- 4 | ABC
- 2 | äbc
- 3 | bbc
-(4 rows)
-
-SELECT a, b FROM collate_test2 ORDER BY b;
- a | b
----+-----
- 1 | abc
- 4 | ABC
- 3 | bbc
- 2 | äbc
-(4 rows)
-
-SELECT a, b FROM collate_test3 ORDER BY b;
- a | b
----+-----
- 4 | ABC
- 1 | abc
- 3 | bbc
- 2 | äbc
-(4 rows)
-
-SELECT a, b FROM collate_test1 ORDER BY b COLLATE "C";
- a | b
----+-----
- 4 | ABC
- 1 | abc
- 3 | bbc
- 2 | äbc
-(4 rows)
-
--- star expansion
-SELECT * FROM collate_test1 ORDER BY b;
- a | b
----+-----
- 1 | abc
- 4 | ABC
- 2 | äbc
- 3 | bbc
-(4 rows)
-
-SELECT * FROM collate_test2 ORDER BY b;
- a | b
----+-----
- 1 | abc
- 4 | ABC
- 3 | bbc
- 2 | äbc
-(4 rows)
-
-SELECT * FROM collate_test3 ORDER BY b;
- a | b
----+-----
- 4 | ABC
- 1 | abc
- 3 | bbc
- 2 | äbc
-(4 rows)
-
--- constant expression folding
-SELECT 'bbc' COLLATE "en_US" > 'äbc' COLLATE "en_US" AS "true";
- true
-------
- t
-(1 row)
-
-SELECT 'bbc' COLLATE "sv_SE" > 'äbc' COLLATE "sv_SE" AS "false";
- false
--------
- f
-(1 row)
-
--- LIKE/ILIKE
-SELECT * FROM collate_test1 WHERE b LIKE 'abc';
- a | b
----+-----
- 1 | abc
-(1 row)
-
-SELECT * FROM collate_test1 WHERE b LIKE 'abc%';
- a | b
----+-----
- 1 | abc
-(1 row)
-
-SELECT * FROM collate_test1 WHERE b LIKE '%bc%';
- a | b
----+-----
- 1 | abc
- 2 | äbc
- 3 | bbc
-(3 rows)
-
-SELECT * FROM collate_test1 WHERE b ILIKE 'abc';
- a | b
----+-----
- 1 | abc
- 4 | ABC
-(2 rows)
-
-SELECT * FROM collate_test1 WHERE b ILIKE 'abc%';
- a | b
----+-----
- 1 | abc
- 4 | ABC
-(2 rows)
-
-SELECT * FROM collate_test1 WHERE b ILIKE '%bc%';
- a | b
----+-----
- 1 | abc
- 2 | äbc
- 3 | bbc
- 4 | ABC
-(4 rows)
-
--- The following actually exercises the selectivity estimation for ILIKE.
-SELECT relname FROM pg_class WHERE relname ILIKE 'abc%';
- relname
----------
-(0 rows)
-
--- regular expressions
-SELECT * FROM collate_test1 WHERE b ~ '^abc$';
- a | b
----+-----
- 1 | abc
-(1 row)
-
-SELECT * FROM collate_test1 WHERE b ~ '^abc';
- a | b
----+-----
- 1 | abc
-(1 row)
-
-SELECT * FROM collate_test1 WHERE b ~ 'bc';
- a | b
----+-----
- 1 | abc
- 2 | äbc
- 3 | bbc
-(3 rows)
-
-SELECT * FROM collate_test1 WHERE b ~* '^abc$';
- a | b
----+-----
- 1 | abc
- 4 | ABC
-(2 rows)
-
-SELECT * FROM collate_test1 WHERE b ~* '^abc';
- a | b
----+-----
- 1 | abc
- 4 | ABC
-(2 rows)
-
-SELECT * FROM collate_test1 WHERE b ~* 'bc';
- a | b
----+-----
- 1 | abc
- 2 | äbc
- 3 | bbc
- 4 | ABC
-(4 rows)
-
-CREATE TABLE collate_test6 (
- a int,
- b text COLLATE "en_US"
-);
-INSERT INTO collate_test6 VALUES (1, 'abc'), (2, 'ABC'), (3, '123'), (4, 'ab1'),
- (5, 'a1!'), (6, 'a c'), (7, '!.;'), (8, ' '),
- (9, 'äbç'), (10, 'ÄBÇ');
-SELECT b,
- b ~ '^[[:alpha:]]+$' AS is_alpha,
- b ~ '^[[:upper:]]+$' AS is_upper,
- b ~ '^[[:lower:]]+$' AS is_lower,
- b ~ '^[[:digit:]]+$' AS is_digit,
- b ~ '^[[:alnum:]]+$' AS is_alnum,
- b ~ '^[[:graph:]]+$' AS is_graph,
- b ~ '^[[:print:]]+$' AS is_print,
- b ~ '^[[:punct:]]+$' AS is_punct,
- b ~ '^[[:space:]]+$' AS is_space
-FROM collate_test6;
- b | is_alpha | is_upper | is_lower | is_digit | is_alnum | is_graph | is_print | is_punct | is_space
------+----------+----------+----------+----------+----------+----------+----------+----------+----------
- abc | t | f | t | f | t | t | t | f | f
- ABC | t | t | f | f | t | t | t | f | f
- 123 | f | f | f | t | t | t | t | f | f
- ab1 | f | f | f | f | t | t | t | f | f
- a1! | f | f | f | f | f | t | t | f | f
- a c | f | f | f | f | f | f | t | f | f
- !.; | f | f | f | f | f | t | t | t | f
- | f | f | f | f | f | f | t | f | t
- äbç | t | f | t | f | t | t | t | f | f
- ÄBÇ | t | t | f | f | t | t | t | f | f
-(10 rows)
-
--- The following actually exercises the selectivity estimation for ~*.
-SELECT relname FROM pg_class WHERE relname ~* '^abc';
- relname
----------
-(0 rows)
-
--- backwards parsing
-CREATE VIEW collview1 AS SELECT * FROM collate_test1 WHERE b COLLATE "C" >= 'bbc';
-CREATE VIEW collview2 AS SELECT a, b FROM collate_test1 ORDER BY b COLLATE "C";
-SELECT table_name, view_definition FROM information_schema.views
- WHERE table_name LIKE 'collview%' ORDER BY 1;
- table_name | view_definition
-------------+-------------------------------------------
- collview1 | SELECT a, +
- | b +
- | FROM collate_test1 +
- | WHERE ((b COLLATE "C") >= 'bbc'::text);
- collview2 | SELECT a, +
- | b +
- | FROM collate_test1 +
- | ORDER BY (b COLLATE "C");
-(2 rows)
-
--- collation propagation in various expression types
-SELECT a, coalesce(b, 'foo') FROM collate_test1 ORDER BY 2;
- a | coalesce
----+----------
- 1 | abc
- 4 | ABC
- 2 | äbc
- 3 | bbc
-(4 rows)
-
-SELECT a, coalesce(b, 'foo') FROM collate_test2 ORDER BY 2;
- a | coalesce
----+----------
- 1 | abc
- 4 | ABC
- 3 | bbc
- 2 | äbc
-(4 rows)
-
-SELECT a, coalesce(b, 'foo') FROM collate_test3 ORDER BY 2;
- a | coalesce
----+----------
- 4 | ABC
- 1 | abc
- 3 | bbc
- 2 | äbc
-(4 rows)
-
-SELECT a, b, greatest(b, 'CCC') FROM collate_test1 ORDER BY 3;
- a | b | greatest
----+-----+----------
- 1 | abc | CCC
- 2 | äbc | CCC
- 3 | bbc | CCC
- 4 | ABC | CCC
-(4 rows)
-
-SELECT a, b, greatest(b, 'CCC') FROM collate_test2 ORDER BY 3;
- a | b | greatest
----+-----+----------
- 1 | abc | CCC
- 3 | bbc | CCC
- 4 | ABC | CCC
- 2 | äbc | äbc
-(4 rows)
-
-SELECT a, b, greatest(b, 'CCC') FROM collate_test3 ORDER BY 3;
- a | b | greatest
----+-----+----------
- 4 | ABC | CCC
- 1 | abc | abc
- 3 | bbc | bbc
- 2 | äbc | äbc
-(4 rows)
-
-SELECT a, nullif(b, 'abc') FROM collate_test1 ORDER BY 2;
- a | nullif
----+--------
- 4 | ABC
- 2 | äbc
- 3 | bbc
- 1 |
-(4 rows)
-
-SELECT a, nullif(b, 'abc') FROM collate_test2 ORDER BY 2;
- a | nullif
----+--------
- 4 | ABC
- 3 | bbc
- 2 | äbc
- 1 |
-(4 rows)
-
-SELECT a, nullif(b, 'abc') FROM collate_test3 ORDER BY 2;
- a | nullif
----+--------
- 4 | ABC
- 3 | bbc
- 2 | äbc
- 1 |
-(4 rows)
-
-SELECT a, CASE b WHEN 'abc' THEN 'abcd' ELSE b END FROM collate_test1 ORDER BY 2;
- a | b
----+------
- 4 | ABC
- 2 | äbc
- 1 | abcd
- 3 | bbc
-(4 rows)
-
-SELECT a, CASE b WHEN 'abc' THEN 'abcd' ELSE b END FROM collate_test2 ORDER BY 2;
- a | b
----+------
- 4 | ABC
- 1 | abcd
- 3 | bbc
- 2 | äbc
-(4 rows)
-
-SELECT a, CASE b WHEN 'abc' THEN 'abcd' ELSE b END FROM collate_test3 ORDER BY 2;
- a | b
----+------
- 4 | ABC
- 1 | abcd
- 3 | bbc
- 2 | äbc
-(4 rows)
-
-CREATE DOMAIN testdomain AS text;
-SELECT a, b::testdomain FROM collate_test1 ORDER BY 2;
- a | b
----+-----
- 1 | abc
- 4 | ABC
- 2 | äbc
- 3 | bbc
-(4 rows)
-
-SELECT a, b::testdomain FROM collate_test2 ORDER BY 2;
- a | b
----+-----
- 1 | abc
- 4 | ABC
- 3 | bbc
- 2 | äbc
-(4 rows)
-
-SELECT a, b::testdomain FROM collate_test3 ORDER BY 2;
- a | b
----+-----
- 4 | ABC
- 1 | abc
- 3 | bbc
- 2 | äbc
-(4 rows)
-
-SELECT a, b::testdomain_sv FROM collate_test3 ORDER BY 2;
- a | b
----+-----
- 1 | abc
- 4 | ABC
- 3 | bbc
- 2 | äbc
-(4 rows)
-
-SELECT min(b), max(b) FROM collate_test1;
- min | max
------+-----
- abc | bbc
-(1 row)
-
-SELECT min(b), max(b) FROM collate_test2;
- min | max
------+-----
- abc | äbc
-(1 row)
-
-SELECT min(b), max(b) FROM collate_test3;
- min | max
------+-----
- ABC | äbc
-(1 row)
-
-SELECT array_agg(b ORDER BY b) FROM collate_test1;
- array_agg
--------------------
- {abc,ABC,äbc,bbc}
-(1 row)
-
-SELECT array_agg(b ORDER BY b) FROM collate_test2;
- array_agg
--------------------
- {abc,ABC,bbc,äbc}
-(1 row)
-
-SELECT array_agg(b ORDER BY b) FROM collate_test3;
- array_agg
--------------------
- {ABC,abc,bbc,äbc}
-(1 row)
-
-SELECT a, b FROM collate_test1 UNION ALL SELECT a, b FROM collate_test1 ORDER BY 2;
- a | b
----+-----
- 1 | abc
- 1 | abc
- 4 | ABC
- 4 | ABC
- 2 | äbc
- 2 | äbc
- 3 | bbc
- 3 | bbc
-(8 rows)
-
-SELECT a, b FROM collate_test2 UNION SELECT a, b FROM collate_test2 ORDER BY 2;
- a | b
----+-----
- 1 | abc
- 4 | ABC
- 3 | bbc
- 2 | äbc
-(4 rows)
-
-SELECT a, b FROM collate_test3 WHERE a < 4 INTERSECT SELECT a, b FROM collate_test3 WHERE a > 1 ORDER BY 2;
- a | b
----+-----
- 3 | bbc
- 2 | äbc
-(2 rows)
-
-SELECT a, b FROM collate_test3 EXCEPT SELECT a, b FROM collate_test3 WHERE a < 2 ORDER BY 2;
- a | b
----+-----
- 4 | ABC
- 3 | bbc
- 2 | äbc
-(3 rows)
-
-SELECT a, b FROM collate_test1 UNION ALL SELECT a, b FROM collate_test3 ORDER BY 2; -- fail
-ERROR: could not determine which collation to use for string comparison
-HINT: Use the COLLATE clause to set the collation explicitly.
-SELECT a, b FROM collate_test1 UNION ALL SELECT a, b FROM collate_test3; -- ok
- a | b
----+-----
- 1 | abc
- 2 | äbc
- 3 | bbc
- 4 | ABC
- 1 | abc
- 2 | äbc
- 3 | bbc
- 4 | ABC
-(8 rows)
-
-SELECT a, b FROM collate_test1 UNION SELECT a, b FROM collate_test3 ORDER BY 2; -- fail
-ERROR: collation mismatch between implicit collations "en_US" and "C"
-LINE 1: SELECT a, b FROM collate_test1 UNION SELECT a, b FROM collat...
- ^
-HINT: You can choose the collation by applying the COLLATE clause to one or both expressions.
-SELECT a, b COLLATE "C" FROM collate_test1 UNION SELECT a, b FROM collate_test3 ORDER BY 2; -- ok
- a | b
----+-----
- 4 | ABC
- 1 | abc
- 3 | bbc
- 2 | äbc
-(4 rows)
-
-SELECT a, b FROM collate_test1 INTERSECT SELECT a, b FROM collate_test3 ORDER BY 2; -- fail
-ERROR: collation mismatch between implicit collations "en_US" and "C"
-LINE 1: ...ELECT a, b FROM collate_test1 INTERSECT SELECT a, b FROM col...
- ^
-HINT: You can choose the collation by applying the COLLATE clause to one or both expressions.
-SELECT a, b FROM collate_test1 EXCEPT SELECT a, b FROM collate_test3 ORDER BY 2; -- fail
-ERROR: collation mismatch between implicit collations "en_US" and "C"
-LINE 1: SELECT a, b FROM collate_test1 EXCEPT SELECT a, b FROM colla...
- ^
-HINT: You can choose the collation by applying the COLLATE clause to one or both expressions.
-CREATE TABLE test_u AS SELECT a, b FROM collate_test1 UNION ALL SELECT a, b FROM collate_test3; -- fail
-ERROR: no collation was derived for column "b" with collatable type text
-HINT: Use the COLLATE clause to set the collation explicitly.
--- collation mismatch between recursive and non-recursive term
-WITH RECURSIVE foo(x) AS
- (SELECT x FROM (VALUES('a' COLLATE "en_US"),('b')) t(x)
- UNION ALL
- SELECT (x || 'c') COLLATE "de_DE" FROM foo WHERE length(x) < 10)
-SELECT * FROM foo;
-ERROR: recursive query "foo" column 1 has collation "en_US" in non-recursive term but collation "de_DE" overall
-LINE 2: (SELECT x FROM (VALUES('a' COLLATE "en_US"),('b')) t(x)
- ^
-HINT: Use the COLLATE clause to set the collation of the non-recursive term.
--- casting
-SELECT CAST('42' AS text COLLATE "C");
-ERROR: syntax error at or near "COLLATE"
-LINE 1: SELECT CAST('42' AS text COLLATE "C");
- ^
-SELECT a, CAST(b AS varchar) FROM collate_test1 ORDER BY 2;
- a | b
----+-----
- 1 | abc
- 4 | ABC
- 2 | äbc
- 3 | bbc
-(4 rows)
-
-SELECT a, CAST(b AS varchar) FROM collate_test2 ORDER BY 2;
- a | b
----+-----
- 1 | abc
- 4 | ABC
- 3 | bbc
- 2 | äbc
-(4 rows)
-
-SELECT a, CAST(b AS varchar) FROM collate_test3 ORDER BY 2;
- a | b
----+-----
- 4 | ABC
- 1 | abc
- 3 | bbc
- 2 | äbc
-(4 rows)
-
--- propagation of collation in SQL functions (inlined and non-inlined cases)
--- and plpgsql functions too
-CREATE FUNCTION mylt (text, text) RETURNS boolean LANGUAGE sql
- AS $$ select $1 < $2 $$;
-CREATE FUNCTION mylt_noninline (text, text) RETURNS boolean LANGUAGE sql
- AS $$ select $1 < $2 limit 1 $$;
-CREATE FUNCTION mylt_plpgsql (text, text) RETURNS boolean LANGUAGE plpgsql
- AS $$ begin return $1 < $2; end $$;
-SELECT a.b AS a, b.b AS b, a.b < b.b AS lt,
- mylt(a.b, b.b), mylt_noninline(a.b, b.b), mylt_plpgsql(a.b, b.b)
-FROM collate_test1 a, collate_test1 b
-ORDER BY a.b, b.b;
- a | b | lt | mylt | mylt_noninline | mylt_plpgsql
------+-----+----+------+----------------+--------------
- abc | abc | f | f | f | f
- abc | ABC | t | t | t | t
- abc | äbc | t | t | t | t
- abc | bbc | t | t | t | t
- ABC | abc | f | f | f | f
- ABC | ABC | f | f | f | f
- ABC | äbc | t | t | t | t
- ABC | bbc | t | t | t | t
- äbc | abc | f | f | f | f
- äbc | ABC | f | f | f | f
- äbc | äbc | f | f | f | f
- äbc | bbc | t | t | t | t
- bbc | abc | f | f | f | f
- bbc | ABC | f | f | f | f
- bbc | äbc | f | f | f | f
- bbc | bbc | f | f | f | f
-(16 rows)
-
-SELECT a.b AS a, b.b AS b, a.b < b.b COLLATE "C" AS lt,
- mylt(a.b, b.b COLLATE "C"), mylt_noninline(a.b, b.b COLLATE "C"),
- mylt_plpgsql(a.b, b.b COLLATE "C")
-FROM collate_test1 a, collate_test1 b
-ORDER BY a.b, b.b;
- a | b | lt | mylt | mylt_noninline | mylt_plpgsql
------+-----+----+------+----------------+--------------
- abc | abc | f | f | f | f
- abc | ABC | f | f | f | f
- abc | äbc | t | t | t | t
- abc | bbc | t | t | t | t
- ABC | abc | t | t | t | t
- ABC | ABC | f | f | f | f
- ABC | äbc | t | t | t | t
- ABC | bbc | t | t | t | t
- äbc | abc | f | f | f | f
- äbc | ABC | f | f | f | f
- äbc | äbc | f | f | f | f
- äbc | bbc | f | f | f | f
- bbc | abc | f | f | f | f
- bbc | ABC | f | f | f | f
- bbc | äbc | t | t | t | t
- bbc | bbc | f | f | f | f
-(16 rows)
-
--- collation override in plpgsql
-CREATE FUNCTION mylt2 (x text, y text) RETURNS boolean LANGUAGE plpgsql AS $$
-declare
- xx text := x;
- yy text := y;
-begin
- return xx < yy;
-end
-$$;
-SELECT mylt2('a', 'B' collate "en_US") as t, mylt2('a', 'B' collate "C") as f;
- t | f
----+---
- t | f
-(1 row)
-
-CREATE OR REPLACE FUNCTION
- mylt2 (x text, y text) RETURNS boolean LANGUAGE plpgsql AS $$
-declare
- xx text COLLATE "POSIX" := x;
- yy text := y;
-begin
- return xx < yy;
-end
-$$;
-SELECT mylt2('a', 'B') as f;
- f
----
- f
-(1 row)
-
-SELECT mylt2('a', 'B' collate "C") as fail; -- conflicting collations
-ERROR: could not determine which collation to use for string comparison
-HINT: Use the COLLATE clause to set the collation explicitly.
-CONTEXT: PL/pgSQL function mylt2(text,text) line 6 at RETURN
-SELECT mylt2('a', 'B' collate "POSIX") as f;
- f
----
- f
-(1 row)
-
--- polymorphism
-SELECT * FROM unnest((SELECT array_agg(b ORDER BY b) FROM collate_test1)) ORDER BY 1;
- unnest
---------
- abc
- ABC
- äbc
- bbc
-(4 rows)
-
-SELECT * FROM unnest((SELECT array_agg(b ORDER BY b) FROM collate_test2)) ORDER BY 1;
- unnest
---------
- abc
- ABC
- bbc
- äbc
-(4 rows)
-
-SELECT * FROM unnest((SELECT array_agg(b ORDER BY b) FROM collate_test3)) ORDER BY 1;
- unnest
---------
- ABC
- abc
- bbc
- äbc
-(4 rows)
-
-CREATE FUNCTION dup (anyelement) RETURNS anyelement
- AS 'select $1' LANGUAGE sql;
-SELECT a, dup(b) FROM collate_test1 ORDER BY 2;
- a | dup
----+-----
- 1 | abc
- 4 | ABC
- 2 | äbc
- 3 | bbc
-(4 rows)
-
-SELECT a, dup(b) FROM collate_test2 ORDER BY 2;
- a | dup
----+-----
- 1 | abc
- 4 | ABC
- 3 | bbc
- 2 | äbc
-(4 rows)
-
-SELECT a, dup(b) FROM collate_test3 ORDER BY 2;
- a | dup
----+-----
- 4 | ABC
- 1 | abc
- 3 | bbc
- 2 | äbc
-(4 rows)
-
--- indexes
-CREATE INDEX collate_test1_idx1 ON collate_test1 (b);
-CREATE INDEX collate_test1_idx2 ON collate_test1 (b COLLATE "C");
-CREATE INDEX collate_test1_idx3 ON collate_test1 ((b COLLATE "C")); -- this is different grammatically
-CREATE INDEX collate_test1_idx4 ON collate_test1 (((b||'foo') COLLATE "POSIX"));
-CREATE INDEX collate_test1_idx5 ON collate_test1 (a COLLATE "C"); -- fail
-ERROR: collations are not supported by type integer
-CREATE INDEX collate_test1_idx6 ON collate_test1 ((a COLLATE "C")); -- fail
-ERROR: collations are not supported by type integer
-LINE 1: ...ATE INDEX collate_test1_idx6 ON collate_test1 ((a COLLATE "C...
- ^
-SELECT relname, pg_get_indexdef(oid) FROM pg_class WHERE relname LIKE 'collate_test%_idx%' ORDER BY 1;
- relname | pg_get_indexdef
---------------------+-------------------------------------------------------------------------------------------------------------------
- collate_test1_idx1 | CREATE INDEX collate_test1_idx1 ON collate_tests.collate_test1 USING btree (b)
- collate_test1_idx2 | CREATE INDEX collate_test1_idx2 ON collate_tests.collate_test1 USING btree (b COLLATE "C")
- collate_test1_idx3 | CREATE INDEX collate_test1_idx3 ON collate_tests.collate_test1 USING btree (b COLLATE "C")
- collate_test1_idx4 | CREATE INDEX collate_test1_idx4 ON collate_tests.collate_test1 USING btree (((b || 'foo'::text)) COLLATE "POSIX")
-(4 rows)
-
--- schema manipulation commands
-CREATE ROLE regress_test_role;
-CREATE SCHEMA test_schema;
--- We need to do this this way to cope with varying names for encodings:
-do $$
-BEGIN
- EXECUTE 'CREATE COLLATION test0 (locale = ' ||
- quote_literal((SELECT datcollate FROM pg_database WHERE datname = current_database())) || ');';
-END
-$$;
-CREATE COLLATION test0 FROM "C"; -- fail, duplicate name
-ERROR: collation "test0" already exists
-CREATE COLLATION IF NOT EXISTS test0 FROM "C"; -- ok, skipped
-NOTICE: collation "test0" already exists, skipping
-CREATE COLLATION IF NOT EXISTS test0 (locale = 'foo'); -- ok, skipped
-NOTICE: collation "test0" for encoding "WIN1252" already exists, skipping
-do $$
-BEGIN
- EXECUTE 'CREATE COLLATION test1 (lc_collate = ' ||
- quote_literal((SELECT datcollate FROM pg_database WHERE datname = current_database())) ||
- ', lc_ctype = ' ||
- quote_literal((SELECT datctype FROM pg_database WHERE datname = current_database())) || ');';
-END
-$$;
-CREATE COLLATION test3 (lc_collate = 'en_US.utf8'); -- fail, need lc_ctype
-ERROR: parameter "lc_ctype" must be specified
-CREATE COLLATION testx (locale = 'nonsense'); -- fail
-ERROR: could not create locale "nonsense": No such file or directory
-DETAIL: The operating system could not find any locale data for the locale name "nonsense".
-CREATE COLLATION test4 FROM nonsense;
-ERROR: collation "nonsense" for encoding "WIN1252" does not exist
-CREATE COLLATION test5 FROM test0;
-SELECT collname FROM pg_collation WHERE collname LIKE 'test%' ORDER BY 1;
- collname
-----------
- test0
- test1
- test5
-(3 rows)
-
-ALTER COLLATION test1 RENAME TO test11;
-ALTER COLLATION test0 RENAME TO test11; -- fail
-ERROR: collation "test11" for encoding "WIN1252" already exists in schema "collate_tests"
-ALTER COLLATION test1 RENAME TO test22; -- fail
-ERROR: collation "test1" for encoding "WIN1252" does not exist
-ALTER COLLATION test11 OWNER TO regress_test_role;
-ALTER COLLATION test11 OWNER TO nonsense;
-ERROR: role "nonsense" does not exist
-ALTER COLLATION test11 SET SCHEMA test_schema;
-COMMENT ON COLLATION test0 IS 'US English';
-SELECT collname, nspname, obj_description(pg_collation.oid, 'pg_collation')
- FROM pg_collation JOIN pg_namespace ON (collnamespace = pg_namespace.oid)
- WHERE collname LIKE 'test%'
- ORDER BY 1;
- collname | nspname | obj_description
-----------+---------------+-----------------
- test0 | collate_tests | US English
- test11 | test_schema |
- test5 | collate_tests |
-(3 rows)
-
-DROP COLLATION test0, test_schema.test11, test5;
-DROP COLLATION test0; -- fail
-ERROR: collation "test0" for encoding "WIN1252" does not exist
-DROP COLLATION IF EXISTS test0;
-NOTICE: collation "test0" does not exist, skipping
-SELECT collname FROM pg_collation WHERE collname LIKE 'test%';
- collname
-----------
-(0 rows)
-
-DROP SCHEMA test_schema;
-DROP ROLE regress_test_role;
--- ALTER
-ALTER COLLATION "en_US" REFRESH VERSION;
-NOTICE: version has not changed
--- also test for database while we are here
-SELECT current_database() AS datname \gset
-ALTER DATABASE :"datname" REFRESH COLLATION VERSION;
-NOTICE: version has not changed
--- dependencies
-CREATE COLLATION test0 FROM "C";
-CREATE TABLE collate_dep_test1 (a int, b text COLLATE test0);
-CREATE DOMAIN collate_dep_dom1 AS text COLLATE test0;
-CREATE TYPE collate_dep_test2 AS (x int, y text COLLATE test0);
-CREATE VIEW collate_dep_test3 AS SELECT text 'foo' COLLATE test0 AS foo;
-CREATE TABLE collate_dep_test4t (a int, b text);
-CREATE INDEX collate_dep_test4i ON collate_dep_test4t (b COLLATE test0);
-DROP COLLATION test0 RESTRICT; -- fail
-ERROR: cannot drop collation test0 because other objects depend on it
-DETAIL: column b of table collate_dep_test1 depends on collation test0
-type collate_dep_dom1 depends on collation test0
-column y of composite type collate_dep_test2 depends on collation test0
-view collate_dep_test3 depends on collation test0
-index collate_dep_test4i depends on collation test0
-HINT: Use DROP ... CASCADE to drop the dependent objects too.
-DROP COLLATION test0 CASCADE;
-NOTICE: drop cascades to 5 other objects
-DETAIL: drop cascades to column b of table collate_dep_test1
-drop cascades to type collate_dep_dom1
-drop cascades to column y of composite type collate_dep_test2
-drop cascades to view collate_dep_test3
-drop cascades to index collate_dep_test4i
-\d collate_dep_test1
- Table "collate_tests.collate_dep_test1"
- Column | Type | Collation | Nullable | Default
---------+---------+-----------+----------+---------
- a | integer | | |
-
-\d collate_dep_test2
- Composite type "collate_tests.collate_dep_test2"
- Column | Type | Collation | Nullable | Default
---------+---------+-----------+----------+---------
- x | integer | | |
-
-DROP TABLE collate_dep_test1, collate_dep_test4t;
-DROP TYPE collate_dep_test2;
--- test range types and collations
-create type textrange_c as range(subtype=text, collation="C");
-create type textrange_en_us as range(subtype=text, collation="en_US");
-select textrange_c('A','Z') @> 'b'::text;
- ?column?
-----------
- f
-(1 row)
-
-select textrange_en_us('A','Z') @> 'b'::text;
- ?column?
-----------
- t
-(1 row)
-
-drop type textrange_c;
-drop type textrange_en_us;
--- nondeterministic collations
--- (not supported with libc provider)
-do $$
-BEGIN
- EXECUTE 'CREATE COLLATION ctest_det (locale = ' ||
- quote_literal((SELECT collcollate FROM pg_collation WHERE
- collname = 'en_US')) || ', deterministic = true);';
- END
-$$;
-CREATE COLLATION ctest_nondet (locale = 'en_US', deterministic = false);
-ERROR: nondeterministic collations not supported with this provider
--- cleanup
-SET client_min_messages TO warning;
-DROP SCHEMA collate_tests CASCADE;
diff --git a/src/test/regress/expected/compression.out b/src/test/regress/expected/compression.out
index 4dd9ee7200d..7bd7642b4b9 100644
--- a/src/test/regress/expected/compression.out
+++ b/src/test/regress/expected/compression.out
@@ -14,13 +14,13 @@ Indexes:
"idx" btree (f1)
CREATE TABLE cmdata1(f1 TEXT COMPRESSION lz4);
+ERROR: compression method lz4 not supported
+DETAIL: This functionality requires the server to be built with lz4 support.
INSERT INTO cmdata1 VALUES(repeat('1234567890', 1004));
+ERROR: relation "cmdata1" does not exist
+LINE 1: INSERT INTO cmdata1 VALUES(repeat('1234567890', 1004));
+ ^
\d+ cmdata1
- Table "public.cmdata1"
- Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
---------+------+-----------+----------+---------+----------+-------------+--------------+-------------
- f1 | text | | | | extended | lz4 | |
-
-- verify stored compression method in the data
SELECT pg_column_compression(f1) FROM cmdata;
pg_column_compression
@@ -29,11 +29,9 @@ SELECT pg_column_compression(f1) FROM cmdata;
(1 row)
SELECT pg_column_compression(f1) FROM cmdata1;
- pg_column_compression
------------------------
- lz4
-(1 row)
-
+ERROR: relation "cmdata1" does not exist
+LINE 1: SELECT pg_column_compression(f1) FROM cmdata1;
+ ^
-- decompress data slice
SELECT SUBSTR(f1, 200, 5) FROM cmdata;
substr
@@ -42,11 +40,9 @@ SELECT SUBSTR(f1, 200, 5) FROM cmdata;
(1 row)
SELECT SUBSTR(f1, 2000, 50) FROM cmdata1;
- substr
-----------------------------------------------------
- 01234567890123456789012345678901234567890123456789
-(1 row)
-
+ERROR: relation "cmdata1" does not exist
+LINE 1: SELECT SUBSTR(f1, 2000, 50) FROM cmdata1;
+ ^
-- copy with table creation
SELECT * INTO cmmove1 FROM cmdata;
\d+ cmmove1
@@ -65,22 +61,23 @@ SELECT pg_column_compression(f1) FROM cmmove1;
CREATE TABLE cmmove3(f1 text COMPRESSION pglz);
INSERT INTO cmmove3 SELECT * FROM cmdata;
INSERT INTO cmmove3 SELECT * FROM cmdata1;
+ERROR: relation "cmdata1" does not exist
+LINE 1: INSERT INTO cmmove3 SELECT * FROM cmdata1;
+ ^
SELECT pg_column_compression(f1) FROM cmmove3;
pg_column_compression
-----------------------
pglz
- lz4
-(2 rows)
+(1 row)
-- test LIKE INCLUDING COMPRESSION
CREATE TABLE cmdata2 (LIKE cmdata1 INCLUDING COMPRESSION);
+ERROR: relation "cmdata1" does not exist
+LINE 1: CREATE TABLE cmdata2 (LIKE cmdata1 INCLUDING COMPRESSION);
+ ^
\d+ cmdata2
- Table "public.cmdata2"
- Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
---------+------+-----------+----------+---------+----------+-------------+--------------+-------------
- f1 | text | | | | extended | lz4 | |
-
DROP TABLE cmdata2;
+ERROR: table "cmdata2" does not exist
-- try setting compression for incompressible data type
CREATE TABLE cmdata2 (f1 int COMPRESSION pglz);
ERROR: column data type integer does not support compression
@@ -94,10 +91,13 @@ SELECT pg_column_compression(f1) FROM cmmove2;
(1 row)
UPDATE cmmove2 SET f1 = cmdata1.f1 FROM cmdata1;
+ERROR: relation "cmdata1" does not exist
+LINE 1: UPDATE cmmove2 SET f1 = cmdata1.f1 FROM cmdata1;
+ ^
SELECT pg_column_compression(f1) FROM cmmove2;
pg_column_compression
-----------------------
- lz4
+ pglz
(1 row)
-- test externally stored compressed data
@@ -112,20 +112,17 @@ SELECT pg_column_compression(f1) FROM cmdata2;
(1 row)
INSERT INTO cmdata1 SELECT large_val() || repeat('a', 4000);
+ERROR: relation "cmdata1" does not exist
+LINE 1: INSERT INTO cmdata1 SELECT large_val() || repeat('a', 4000);
+ ^
SELECT pg_column_compression(f1) FROM cmdata1;
- pg_column_compression
------------------------
- lz4
- lz4
-(2 rows)
-
+ERROR: relation "cmdata1" does not exist
+LINE 1: SELECT pg_column_compression(f1) FROM cmdata1;
+ ^
SELECT SUBSTR(f1, 200, 5) FROM cmdata1;
- substr
---------
- 01234
- 79026
-(2 rows)
-
+ERROR: relation "cmdata1" does not exist
+LINE 1: SELECT SUBSTR(f1, 200, 5) FROM cmdata1;
+ ^
SELECT SUBSTR(f1, 200, 5) FROM cmdata2;
substr
--------
@@ -181,53 +178,47 @@ SELECT pg_column_compression(f1) FROM cmdata2;
-- test compression with materialized view
CREATE MATERIALIZED VIEW compressmv(x) AS SELECT * FROM cmdata1;
+ERROR: relation "cmdata1" does not exist
+LINE 1: ...TE MATERIALIZED VIEW compressmv(x) AS SELECT * FROM cmdata1;
+ ^
\d+ compressmv
- Materialized view "public.compressmv"
- Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
---------+------+-----------+----------+---------+----------+-------------+--------------+-------------
- x | text | | | | extended | | |
-View definition:
- SELECT f1 AS x
- FROM cmdata1;
-
SELECT pg_column_compression(f1) FROM cmdata1;
- pg_column_compression
------------------------
- lz4
- lz4
-(2 rows)
-
+ERROR: relation "cmdata1" does not exist
+LINE 1: SELECT pg_column_compression(f1) FROM cmdata1;
+ ^
SELECT pg_column_compression(x) FROM compressmv;
- pg_column_compression
------------------------
- lz4
- lz4
-(2 rows)
-
+ERROR: relation "compressmv" does not exist
+LINE 1: SELECT pg_column_compression(x) FROM compressmv;
+ ^
-- test compression with partition
CREATE TABLE cmpart(f1 text COMPRESSION lz4) PARTITION BY HASH(f1);
+ERROR: compression method lz4 not supported
+DETAIL: This functionality requires the server to be built with lz4 support.
CREATE TABLE cmpart1 PARTITION OF cmpart FOR VALUES WITH (MODULUS 2, REMAINDER 0);
+ERROR: relation "cmpart" does not exist
CREATE TABLE cmpart2(f1 text COMPRESSION pglz);
ALTER TABLE cmpart ATTACH PARTITION cmpart2 FOR VALUES WITH (MODULUS 2, REMAINDER 1);
+ERROR: relation "cmpart" does not exist
INSERT INTO cmpart VALUES (repeat('123456789', 1004));
+ERROR: relation "cmpart" does not exist
+LINE 1: INSERT INTO cmpart VALUES (repeat('123456789', 1004));
+ ^
INSERT INTO cmpart VALUES (repeat('123456789', 4004));
+ERROR: relation "cmpart" does not exist
+LINE 1: INSERT INTO cmpart VALUES (repeat('123456789', 4004));
+ ^
SELECT pg_column_compression(f1) FROM cmpart1;
- pg_column_compression
------------------------
- lz4
-(1 row)
-
+ERROR: relation "cmpart1" does not exist
+LINE 1: SELECT pg_column_compression(f1) FROM cmpart1;
+ ^
SELECT pg_column_compression(f1) FROM cmpart2;
pg_column_compression
-----------------------
- pglz
-(1 row)
+(0 rows)
-- test compression with inheritance
CREATE TABLE cminh() INHERITS(cmdata, cmdata1); -- error
-NOTICE: merging multiple inherited definitions of column "f1"
-ERROR: column "f1" has a compression method conflict
-DETAIL: pglz versus lz4
+ERROR: relation "cmdata1" does not exist
CREATE TABLE cminh(f1 TEXT COMPRESSION lz4) INHERITS(cmdata); -- error
NOTICE: merging column "f1" with inherited definition
ERROR: column "f1" has a compression method conflict
@@ -238,20 +229,24 @@ NOTICE: merging multiple inherited definitions of column "f1"
-- test default_toast_compression GUC
SET default_toast_compression = '';
ERROR: invalid value for parameter "default_toast_compression": ""
-HINT: Available values: pglz, lz4.
+HINT: Available values: pglz.
SET default_toast_compression = 'I do not exist compression';
ERROR: invalid value for parameter "default_toast_compression": "I do not exist compression"
-HINT: Available values: pglz, lz4.
+HINT: Available values: pglz.
SET default_toast_compression = 'lz4';
+ERROR: invalid value for parameter "default_toast_compression": "lz4"
+HINT: Available values: pglz.
SET default_toast_compression = 'pglz';
-- test alter compression method
ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;
+ERROR: compression method lz4 not supported
+DETAIL: This functionality requires the server to be built with lz4 support.
INSERT INTO cmdata VALUES (repeat('123456789', 4004));
\d+ cmdata
Table "public.cmdata"
Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
--------+------+-----------+----------+---------+----------+-------------+--------------+-------------
- f1 | text | | | | extended | lz4 | |
+ f1 | text | | | | extended | pglz | |
Indexes:
"idx" btree (f1)
Child tables: cminh
@@ -260,7 +255,7 @@ SELECT pg_column_compression(f1) FROM cmdata;
pg_column_compression
-----------------------
pglz
- lz4
+ pglz
(2 rows)
ALTER TABLE cmdata2 ALTER COLUMN f1 SET COMPRESSION default;
@@ -272,41 +267,38 @@ ALTER TABLE cmdata2 ALTER COLUMN f1 SET COMPRESSION default;
-- test alter compression method for materialized views
ALTER MATERIALIZED VIEW compressmv ALTER COLUMN x SET COMPRESSION lz4;
+ERROR: relation "compressmv" does not exist
\d+ compressmv
- Materialized view "public.compressmv"
- Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description
---------+------+-----------+----------+---------+----------+-------------+--------------+-------------
- x | text | | | | extended | lz4 | |
-View definition:
- SELECT f1 AS x
- FROM cmdata1;
-
-- test alter compression method for partitioned tables
ALTER TABLE cmpart1 ALTER COLUMN f1 SET COMPRESSION pglz;
+ERROR: relation "cmpart1" does not exist
ALTER TABLE cmpart2 ALTER COLUMN f1 SET COMPRESSION lz4;
+ERROR: compression method lz4 not supported
+DETAIL: This functionality requires the server to be built with lz4 support.
-- new data should be compressed with the current compression method
INSERT INTO cmpart VALUES (repeat('123456789', 1004));
+ERROR: relation "cmpart" does not exist
+LINE 1: INSERT INTO cmpart VALUES (repeat('123456789', 1004));
+ ^
INSERT INTO cmpart VALUES (repeat('123456789', 4004));
+ERROR: relation "cmpart" does not exist
+LINE 1: INSERT INTO cmpart VALUES (repeat('123456789', 4004));
+ ^
SELECT pg_column_compression(f1) FROM cmpart1;
- pg_column_compression
------------------------
- lz4
- pglz
-(2 rows)
-
+ERROR: relation "cmpart1" does not exist
+LINE 1: SELECT pg_column_compression(f1) FROM cmpart1;
+ ^
SELECT pg_column_compression(f1) FROM cmpart2;
pg_column_compression
-----------------------
- pglz
- lz4
-(2 rows)
+(0 rows)
-- VACUUM FULL does not recompress
SELECT pg_column_compression(f1) FROM cmdata;
pg_column_compression
-----------------------
pglz
- lz4
+ pglz
(2 rows)
VACUUM FULL cmdata;
@@ -314,15 +306,21 @@ SELECT pg_column_compression(f1) FROM cmdata;
pg_column_compression
-----------------------
pglz
- lz4
+ pglz
(2 rows)
-- test expression index
DROP TABLE cmdata2;
CREATE TABLE cmdata2 (f1 TEXT COMPRESSION pglz, f2 TEXT COMPRESSION lz4);
+ERROR: compression method lz4 not supported
+DETAIL: This functionality requires the server to be built with lz4 support.
CREATE UNIQUE INDEX idx1 ON cmdata2 ((f1 || f2));
+ERROR: relation "cmdata2" does not exist
INSERT INTO cmdata2 VALUES((SELECT array_agg(fipshash(g::TEXT))::TEXT FROM
generate_series(1, 50) g), VERSION());
+ERROR: relation "cmdata2" does not exist
+LINE 1: INSERT INTO cmdata2 VALUES((SELECT array_agg(fipshash(g::TEX...
+ ^
-- check data is ok
SELECT length(f1) FROM cmdata;
length
@@ -332,12 +330,9 @@ SELECT length(f1) FROM cmdata;
(2 rows)
SELECT length(f1) FROM cmdata1;
- length
---------
- 10040
- 12449
-(2 rows)
-
+ERROR: relation "cmdata1" does not exist
+LINE 1: SELECT length(f1) FROM cmdata1;
+ ^
SELECT length(f1) FROM cmmove1;
length
--------
@@ -354,8 +349,7 @@ SELECT length(f1) FROM cmmove3;
length
--------
10000
- 10040
-(2 rows)
+(1 row)
CREATE TABLE badcompresstbl (a text COMPRESSION I_Do_Not_Exist_Compression); -- fails
ERROR: invalid compression method "i_do_not_exist_compression"
diff --git a/src/test/regress/expected/create_view.out b/src/test/regress/expected/create_view.out
index f551624afb3..41602523519 100644
--- a/src/test/regress/expected/create_view.out
+++ b/src/test/regress/expected/create_view.out
@@ -2201,11 +2201,12 @@ select * from tt24v;
Output: cte.r
-> Hash
Output: (ROW("*VALUES*".column1, "*VALUES*".column2))
+ Buckets: 1024 Batches: 1
-> Limit
Output: (ROW("*VALUES*".column1, "*VALUES*".column2))
-> Values Scan on "*VALUES*"
Output: ROW("*VALUES*".column1, "*VALUES*".column2)
-(14 rows)
+(15 rows)
explain (verbose, costs off)
select (r).column2 from (select r from (values(1,2),(3,4)) r limit 1) ss;
diff --git a/src/test/regress/expected/equivclass.out b/src/test/regress/expected/equivclass.out
index 56227505009..682890e6b88 100644
--- a/src/test/regress/expected/equivclass.out
+++ b/src/test/regress/expected/equivclass.out
@@ -499,7 +499,8 @@ select * from tbl_nocom t1 full join tbl_nocom t2 on t2.a = t1.b;
Hash Cond: (t2.a = t1.b)
-> Seq Scan on tbl_nocom t2
-> Hash
+ Buckets: 2048 Batches: 1
-> Seq Scan on tbl_nocom t1
-(5 rows)
+(6 rows)
abort;
diff --git a/src/test/regress/expected/incremental_sort.out b/src/test/regress/expected/incremental_sort.out
index d5975758409..517ff870dc2 100644
--- a/src/test/regress/expected/incremental_sort.out
+++ b/src/test/regress/expected/incremental_sort.out
@@ -1594,10 +1594,12 @@ order by count(*);
Hash Cond: (t1.unique1 = t2.unique2)
-> Parallel Index Only Scan using tenk1_unique1 on tenk1 t1
-> Parallel Hash
+ Buckets: 16384 Batches: 1
-> Parallel Index Scan using tenk1_unique2 on tenk1 t2
-> Parallel Hash
+ Buckets: 16384 Batches: 1
-> Parallel Index Only Scan using tenk1_unique1 on tenk1 t3
-(15 rows)
+(17 rows)
-- Parallel sort but with expression (correlated subquery) that
-- is prohibited in parallel plans.
diff --git a/src/test/regress/expected/inherit.out b/src/test/regress/expected/inherit.out
index dbf3835cb14..fdefc9ffd03 100644
--- a/src/test/regress/expected/inherit.out
+++ b/src/test/regress/expected/inherit.out
@@ -3535,9 +3535,10 @@ explain (costs off)
Hash Cond: (p2.a = p1.a)
-> Seq Scan on permtest_grandchild p2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on permtest_grandchild p1
Filter: ("left"(c, 3) ~ 'a1$'::text)
-(6 rows)
+(7 rows)
reset session authorization;
revoke all on permtest_parent from regress_no_child_access;
diff --git a/src/test/regress/expected/join.out b/src/test/regress/expected/join.out
index 3ffc066b1f8..5dcb50eb76a 100644
--- a/src/test/regress/expected/join.out
+++ b/src/test/regress/expected/join.out
@@ -1918,11 +1918,13 @@ where exists(select * from tenk1 c
Hash Cond: (b.tenthous = a.tenthous)
-> Seq Scan on tenk1 b
-> Hash
+ Buckets: 8192 Batches: 1
-> Seq Scan on tenk1 a
Filter: (tenthous < 5000)
-> Hash
+ Buckets: 16384 Batches: 1
-> Seq Scan on tenk1 c
-(11 rows)
+(13 rows)
--
-- More complicated constructs
@@ -2292,9 +2294,10 @@ order by 1, 2;
Hash Cond: (i1.q2 = i2.q2)
-> Seq Scan on int8_tbl i1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int8_tbl i2
Filter: (q1 = 123)
-(8 rows)
+(9 rows)
select * from int8_tbl i1 left join (int8_tbl i2 join
(select 123 as x) ss on i2.q1 = x) on i1.q2 = i2.q2
@@ -2380,6 +2383,7 @@ order by t1.unique1;
-> Bitmap Index Scan on tenk1_unique1
Index Cond: (unique1 < 10)
-> Hash
+ Buckets: 1024 Batches: 1
-> Bitmap Heap Scan on tenk1 t2
Recheck Cond: (unique1 < 10)
-> Bitmap Index Scan on tenk1_unique1
@@ -2390,7 +2394,7 @@ order by t1.unique1;
-> Limit
-> Index Only Scan using tenk1_unique1 on tenk1
Index Cond: ((unique1 IS NOT NULL) AND (unique1 = t2.unique1))
-(19 rows)
+(20 rows)
-- Ensure we get the expected result
select t1.unique1,t2.unique1 from tenk1 t1
@@ -2481,14 +2485,16 @@ select * from onek t1
Hash Cond: (t1.unique1 = t2.unique1)
-> Seq Scan on onek t1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on onek t2
-> Materialize
-> Hash Left Join
Hash Cond: (t3.unique1 = t4.unique1)
-> Seq Scan on onek t3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on onek t4
-(13 rows)
+(15 rows)
explain (costs off)
select * from int4_tbl t1
@@ -2508,12 +2514,14 @@ select * from int4_tbl t1
Hash Cond: (t2.f1 = t3.f1)
-> Seq Scan on int4_tbl t2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int4_tbl t3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int4_tbl t4
-> Materialize
-> Seq Scan on int4_tbl t5
-(15 rows)
+(17 rows)
explain (costs off)
select * from int4_tbl t1
@@ -2551,10 +2559,11 @@ select * from int4_tbl t1
Hash Cond: (t2.f1 = t3.f1)
-> Seq Scan on int4_tbl t2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int4_tbl t3
-> Materialize
-> Seq Scan on int4_tbl t4
-(12 rows)
+(13 rows)
explain (costs off)
select * from int4_tbl t1
@@ -2600,8 +2609,9 @@ select * from int4_tbl t1
-> Seq Scan on int4_tbl t3
-> Seq Scan on tenk1 t4
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int4_tbl t1
-(13 rows)
+(14 rows)
explain (costs off)
select * from int4_tbl t1
@@ -2623,10 +2633,11 @@ select * from int4_tbl t1
-> Materialize
-> Seq Scan on int4_tbl t3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int4_tbl t1
-> Materialize
-> Seq Scan on tenk1 t4
-(14 rows)
+(15 rows)
explain (costs off)
select * from onek t1
@@ -2643,12 +2654,15 @@ select * from onek t1
Hash Cond: (t1.unique1 = t2.unique1)
-> Seq Scan on onek t1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on onek t2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on onek t3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on onek t4
-(13 rows)
+(16 rows)
explain (costs off)
select * from int8_tbl t1 left join
@@ -3056,9 +3070,10 @@ select * from tbl_rs t1 join
Hash Cond: ((t1.a + t3.a) = t2.a)
-> Seq Scan on tbl_rs t3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on tbl_rs t2
Filter: (a < 5)
-(8 rows)
+(9 rows)
-- and check we get the expected results
select * from tbl_rs t1 join
@@ -3091,9 +3106,10 @@ select count(*) from tenk1 a, tenk1 b
Hash Cond: (a.hundred = b.thousand)
-> Index Only Scan using tenk1_hundred on tenk1 a
-> Hash
+ Buckets: 4096 Batches: 2
-> Seq Scan on tenk1 b
Filter: ((fivethous % 10) < 10)
-(7 rows)
+(8 rows)
select count(*) from tenk1 a, tenk1 b
where a.hundred = b.thousand and (b.fivethous % 10) < 10;
@@ -3125,8 +3141,8 @@ LEFT JOIN (
) AS d ON (a.f1 = d.f1)
WHERE COALESCE(d.f1, 0) = 0
ORDER BY 1;
- QUERY PLAN
------------------------------------------------
+ QUERY PLAN
+------------------------------------------------
Sort
Sort Key: a.f1
-> Hash Right Join
@@ -3137,10 +3153,12 @@ ORDER BY 1;
Filter: (COALESCE(c.f1, 0) = 0)
-> Seq Scan on tt3 b
-> Hash
+ Buckets: 16384 Batches: 1
-> Seq Scan on tt3 c
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on tt4 a
-(13 rows)
+(15 rows)
SELECT a.f1
FROM tt4 a
@@ -3171,8 +3189,9 @@ where unique1 in (select unique2 from tenk1 b);
Hash Cond: (a.unique1 = b.unique2)
-> Seq Scan on tenk1 a
-> Hash
+ Buckets: 16384 Batches: 1
-> Index Only Scan using tenk1_unique2 on tenk1 b
-(5 rows)
+(6 rows)
-- sadly, this is not an antijoin
explain (costs off)
@@ -3195,8 +3214,9 @@ where exists (select 1 from tenk1 b where a.unique1 = b.unique2);
Hash Cond: (a.unique1 = b.unique2)
-> Seq Scan on tenk1 a
-> Hash
+ Buckets: 16384 Batches: 1
-> Index Only Scan using tenk1_unique2 on tenk1 b
-(5 rows)
+(6 rows)
explain (costs off)
select a.* from tenk1 a
@@ -3207,8 +3227,9 @@ where not exists (select 1 from tenk1 b where a.unique1 = b.unique2);
Hash Cond: (a.unique1 = b.unique2)
-> Seq Scan on tenk1 a
-> Hash
+ Buckets: 16384 Batches: 1
-> Index Only Scan using tenk1_unique2 on tenk1 b
-(5 rows)
+(6 rows)
explain (costs off)
select a.* from tenk1 a left join tenk1 b on a.unique1 = b.unique2
@@ -3219,8 +3240,9 @@ where b.unique2 is null;
Hash Cond: (a.unique1 = b.unique2)
-> Seq Scan on tenk1 a
-> Hash
+ Buckets: 16384 Batches: 1
-> Index Only Scan using tenk1_unique2 on tenk1 b
-(5 rows)
+(6 rows)
--
-- regression test for bogus RTE_GROUP entries
@@ -3234,8 +3256,9 @@ where exists (select 1 from tenk1 b where a.unique1 = b.unique2 group by b.uniqu
Hash Cond: (a.unique1 = b.unique2)
-> Seq Scan on tenk1 a
-> Hash
+ Buckets: 16384 Batches: 1
-> Index Only Scan using tenk1_unique2 on tenk1 b
-(5 rows)
+(6 rows)
--
-- regression test for proper handling of outer joins within antijoins
@@ -3257,6 +3280,7 @@ where not exists (
Hash Cond: (t1.c1 = t2.c2)
-> Seq Scan on tt4x t1
-> Hash
+ Buckets: 262144 Batches: 16
-> Merge Right Join
Merge Cond: (t5.c1 = t3.c2)
-> Merge Join
@@ -3277,7 +3301,7 @@ where not exists (
-> Sort
Sort Key: t3.c1
-> Seq Scan on tt4x t3
-(24 rows)
+(25 rows)
--
-- regression test for problems of the sort depicted in bug #3494
@@ -3578,10 +3602,11 @@ SELECT qq, unique1
Hash Cond: ((COALESCE(a.q1, '0'::bigint)) = (COALESCE(b.q2, '-1'::bigint)))
-> Seq Scan on int8_tbl a
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int8_tbl b
-> Index Scan using tenk1_unique2 on tenk1 c
Index Cond: (unique2 = COALESCE((COALESCE(a.q1, '0'::bigint)), (COALESCE(b.q2, '-1'::bigint))))
-(8 rows)
+(9 rows)
SELECT qq, unique1
FROM
@@ -3688,13 +3713,14 @@ order by 1,2;
Filter: (1 = (SubPlan 1))
-> Seq Scan on int8_tbl t1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int8_tbl t2
SubPlan 1
-> Limit
-> Result
One-Time Filter: ((42) IS NOT NULL)
-> Seq Scan on int8_tbl t3
-(13 rows)
+(14 rows)
select * from
int8_tbl t1 left join
@@ -3852,8 +3878,9 @@ where q1 = thousand or q2 = thousand;
-> Bitmap Index Scan on tenk1_thous_tenthous
Index Cond: (thousand = ANY (ARRAY[q1.q1, q2.q2]))
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int4_tbl
-(12 rows)
+(13 rows)
explain (costs off)
select * from
@@ -3873,8 +3900,9 @@ where thousand = (q1 + q2);
-> Bitmap Index Scan on tenk1_thous_tenthous
Index Cond: (thousand = (q1.q1 + q2.q2))
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int4_tbl
-(12 rows)
+(13 rows)
--
-- test ability to generate a suitable plan for a star-schema query
@@ -4314,11 +4342,12 @@ select (t2.*).unique1, f_field_select(t2) from tenk1 t1
Output: t1.unique1
-> Hash
Output: t2.unique1, t2.unique2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.onek t2
Output: t2.unique1, t2.unique2
-> Materialize
-> Seq Scan on public.int8_tbl t3
-(13 rows)
+(14 rows)
drop function f_field_select(t onek);
--
@@ -4601,8 +4630,9 @@ left join unnest(v1ys) as u1(u1y) on u1y = v2y;
Filter: ("*VALUES*_1".column1 = "*VALUES*".column1)
-> Function Scan on unnest u1
-> Hash
+ Buckets: 1024 Batches: 1
-> Values Scan on "*VALUES*_1"
-(8 rows)
+(9 rows)
select * from
(values (1, array[10,20]), (2, array[20,30])) as v1(v1x,v1ys)
@@ -4699,9 +4729,10 @@ select * from int8_tbl t1 left join int8_tbl t2 on t1.q2 = t2.q1,
Filter: (t2.q1 = t2.q2)
-> Seq Scan on int8_tbl t1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int8_tbl t2
-> Seq Scan on int8_tbl t3
-(8 rows)
+(9 rows)
select * from int8_tbl t1 left join int8_tbl t2 on t1.q2 = t2.q1,
lateral (select * from int8_tbl t3 where t2.q1 = t2.q2) ss;
@@ -4803,9 +4834,10 @@ order by i0.f1, x;
Filter: (123 = i2.q2)
-> Hash
Output: i0.f1
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int4_tbl i0
Output: i0.f1
-(19 rows)
+(20 rows)
select * from
int4_tbl i0 left join
@@ -4861,17 +4893,20 @@ select t1.* from
Output: i8.q1, i8.q2
-> Hash
Output: i8b2.q1, (NULL::integer)
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl i8b2
Output: i8b2.q1, NULL::integer
-> Hash
Output: i8b1.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl i8b1
Output: i8b1.q2
-> Hash
Output: i4.f1
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int4_tbl i4
Output: i4.f1
-(30 rows)
+(33 rows)
select t1.* from
text_tbl t1
@@ -4926,17 +4961,20 @@ select t1.* from
-> Seq Scan on public.int4_tbl i4b2
-> Hash
Output: i8.q1, i8.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl i8
Output: i8.q1, i8.q2
-> Hash
Output: i8b1.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl i8b1
Output: i8b1.q2
-> Hash
Output: i4.f1
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int4_tbl i4
Output: i4.f1
-(34 rows)
+(37 rows)
select t1.* from
text_tbl t1
@@ -4991,21 +5029,25 @@ select t1.* from
Output: i8b2.q1, i8b2.q2
-> Hash
Output: i4b2.f1
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int4_tbl i4b2
Output: i4b2.f1
-> Hash
Output: i8.q1, i8.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl i8
Output: i8.q1, i8.q2
-> Hash
Output: i8b1.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl i8b1
Output: i8b1.q2
-> Hash
Output: i4.f1
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int4_tbl i4
Output: i4.f1
-(37 rows)
+(41 rows)
select t1.* from
text_tbl t1
@@ -5355,13 +5397,14 @@ where ss1.c2 = 0;
Output: i41.f1
-> Hash
Output: i42.f1
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int4_tbl i42
Output: i42.f1
-> Limit
Output: (i41.f1), (i8.q1), (i8.q2), (i42.f1), (i43.f1), ((42))
-> Seq Scan on public.text_tbl
Output: i41.f1, i8.q1, i8.q2, i42.f1, i43.f1, (42)
-(25 rows)
+(26 rows)
select ss2.* from
int4_tbl i41
@@ -5385,8 +5428,8 @@ select * from
left join
(tenk1 as a1 full join (select 1 as id) as yy on (a1.unique1 = yy.id))
on (xx.id = coalesce(yy.id));
- QUERY PLAN
----------------------------------------
+ QUERY PLAN
+-----------------------------------------
Nested Loop Left Join
-> Result
-> Hash Full Join
@@ -5394,8 +5437,9 @@ select * from
Filter: (1 = COALESCE((1)))
-> Seq Scan on tenk1 a1
-> Hash
+ Buckets: 1024 Batches: 1
-> Result
-(8 rows)
+(9 rows)
select * from
(select 1 as id) as xx
@@ -5497,8 +5541,9 @@ select a.unique1, b.unique2
-> Seq Scan on int8_tbl c
Filter: (q1 < b.unique1)
-> Hash
+ Buckets: 1024 Batches: 1
-> Index Only Scan using onek_unique1 on onek a
-(9 rows)
+(10 rows)
select a.unique1, b.unique2
from onek a left join onek b on a.unique1 = b.unique2
@@ -5651,14 +5696,15 @@ explain (costs off)
select id from a where id in (
select b.id from b left join c on b.id = c.id
);
- QUERY PLAN
-----------------------------
+ QUERY PLAN
+-----------------------------------
Hash Join
Hash Cond: (a.id = b.id)
-> Seq Scan on a
-> Hash
+ Buckets: 4096 Batches: 1
-> Seq Scan on b
-(5 rows)
+(6 rows)
-- check optimization with oddly-nested outer joins
explain (costs off)
@@ -5780,12 +5826,13 @@ from int8_tbl t1
Hash Cond: (t1.q2 = t2.q2)
-> Seq Scan on int8_tbl t1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int8_tbl t2
-> Materialize
-> Seq Scan on onek t3
-> Materialize
-> Seq Scan on onek t4
-(13 rows)
+(14 rows)
-- More tests of correct placement of pseudoconstant quals
-- simple constant-false condition
@@ -5800,9 +5847,10 @@ on t1.q1 = t2.q1;
Hash Cond: (t1.q1 = q1)
-> Seq Scan on int8_tbl t1
-> Hash
+ Buckets: 1024 Batches: 1
-> Result
One-Time Filter: false
-(6 rows)
+(7 rows)
-- deduce constant-false from an EquivalenceClass
explain (costs off)
@@ -5816,9 +5864,10 @@ on t1.q1 = t2.q1;
Hash Cond: (t1.q1 = q1)
-> Seq Scan on int8_tbl t1
-> Hash
+ Buckets: 1024 Batches: 1
-> Result
One-Time Filter: false
-(6 rows)
+(7 rows)
-- pseudoconstant based on an outer-level Param
explain (costs off)
@@ -5955,16 +6004,17 @@ explain (costs off)
select c.id, ss.a from c
left join (select d.a from onerow, d left join b on d.a = b.id) ss
on c.id = ss.a;
- QUERY PLAN
---------------------------------
+ QUERY PLAN
+-----------------------------------
Hash Right Join
Hash Cond: (d.a = c.id)
-> Nested Loop
-> Seq Scan on onerow
-> Seq Scan on d
-> Hash
+ Buckets: 4096 Batches: 1
-> Seq Scan on c
-(7 rows)
+(8 rows)
CREATE TEMP TABLE parted_b (id int PRIMARY KEY) partition by range(id);
CREATE TEMP TABLE parted_b1 partition of parted_b for values from (0) to (10);
@@ -6012,14 +6062,15 @@ explain (costs off)
select p.*, linked from parent p
left join (select c.*, true as linked from child c) as ss
on (p.k = ss.k);
- QUERY PLAN
----------------------------------
+ QUERY PLAN
+-----------------------------------
Hash Left Join
Hash Cond: (p.k = c.k)
-> Seq Scan on parent p
-> Hash
+ Buckets: 4096 Batches: 1
-> Seq Scan on child c
-(5 rows)
+(6 rows)
-- check for a 9.0rc1 bug: join removal breaks pseudoconstant qual handling
select p.* from
@@ -6656,8 +6707,9 @@ explain (costs off)
Hash Cond: (x.q2 = (a.q1))
-> Seq Scan on int8_tbl x
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int4_tbl y
-(9 rows)
+(10 rows)
select * from int8_tbl a,
int8_tbl x left join lateral (select a.q1 from int4_tbl y) ss(z)
@@ -7023,9 +7075,10 @@ select * from int4_tbl i left join
Output: i.f1
-> Hash
Output: j.f1
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int2_tbl j
Output: j.f1
-(9 rows)
+(10 rows)
select * from int4_tbl i left join
lateral (select * from int2_tbl j where i.f1 = j.f1) k on true;
@@ -7081,10 +7134,11 @@ select * from int4_tbl a,
Output: b.f1
-> Hash
Output: c.q1, c.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl c
Output: c.q1, c.q2
Filter: (a.f1 = c.q2)
-(14 rows)
+(15 rows)
select * from int4_tbl a,
lateral (
@@ -7218,17 +7272,19 @@ select * from
Output: a.q1, a.q2
-> Hash
Output: b.q1, (COALESCE(b.q2, '42'::bigint))
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl b
Output: b.q1, COALESCE(b.q2, '42'::bigint)
-> Seq Scan on public.int8_tbl d
Output: d.q1, COALESCE((COALESCE(b.q2, '42'::bigint)), d.q2)
-> Hash
Output: c.q1, c.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl c
Output: c.q1, c.q2
-> Result
Output: (COALESCE((COALESCE(b.q2, '42'::bigint)), d.q2))
-(24 rows)
+(26 rows)
-- another case requiring nested PlaceHolderVars
explain (verbose, costs off)
@@ -7293,19 +7349,21 @@ select c.*,a.*,ss1.q1,ss2.q1,ss3.* from
Output: b2.f1
-> Hash
Output: a.q1, a.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl a
Output: a.q1, a.q2
-> Seq Scan on public.int8_tbl d
Output: d.q1, COALESCE((COALESCE(b.q2, (b2.f1)::bigint)), d.q2)
-> Hash
Output: c.q1, c.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl c
Output: c.q1, c.q2
-> Materialize
Output: i.f1
-> Seq Scan on public.int4_tbl i
Output: i.f1
-(34 rows)
+(36 rows)
-- check processing of postponed quals (bug #9041)
explain (verbose, costs off)
@@ -7612,6 +7670,7 @@ select t1.b, ss.phv from join_ut1 t1 left join lateral
Output: t3.a, t3.b, t3.c
-> Hash
Output: t2.a
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on public.join_pt1p1p1 t2_1
Output: t2_1.a
@@ -7619,7 +7678,7 @@ select t1.b, ss.phv from join_ut1 t1 left join lateral
-> Seq Scan on public.join_pt1p2 t2_2
Output: t2_2.a
Filter: (t1.a = t2_2.a)
-(21 rows)
+(22 rows)
select t1.b, ss.phv from join_ut1 t1 left join lateral
(select t2.a as t2a, t3.a t3a, least(t1.a, t2.a, t3.a) phv
@@ -7654,11 +7713,12 @@ select * from fkest f1
-> Seq Scan on fkest f2
Filter: (x100 = 2)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on fkest f1
Filter: (x100 = 2)
-> Index Scan using fkest_x_x10_x100_idx on fkest f3
Index Cond: (x = f1.x)
-(10 rows)
+(11 rows)
alter table fkest add constraint fk
foreign key (x, x10b, x100) references fkest (x, x10, x100);
@@ -7675,12 +7735,14 @@ select * from fkest f1
Hash Cond: (f3.x = f2.x)
-> Seq Scan on fkest f3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on fkest f2
Filter: (x100 = 2)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on fkest f1
Filter: (x100 = 2)
-(11 rows)
+(13 rows)
rollback;
--
@@ -7743,9 +7805,10 @@ select * from j1 inner join j2 on j1.id = j2.id;
Output: j1.id
-> Hash
Output: j2.id
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.j2
Output: j2.id
-(10 rows)
+(11 rows)
-- ensure join is not unique when not an equi-join
explain (verbose, costs off)
@@ -7776,9 +7839,10 @@ select * from j1 inner join j3 on j1.id = j3.id;
Output: j3.id
-> Hash
Output: j1.id
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.j1
Output: j1.id
-(10 rows)
+(11 rows)
-- ensure left join is marked as unique
explain (verbose, costs off)
@@ -7793,9 +7857,10 @@ select * from j1 left join j2 on j1.id = j2.id;
Output: j1.id
-> Hash
Output: j2.id
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.j2
Output: j2.id
-(10 rows)
+(11 rows)
-- ensure right join is marked as unique
explain (verbose, costs off)
@@ -7810,9 +7875,10 @@ select * from j1 right join j2 on j1.id = j2.id;
Output: j2.id
-> Hash
Output: j1.id
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.j1
Output: j1.id
-(10 rows)
+(11 rows)
-- ensure full join is marked as unique
explain (verbose, costs off)
@@ -7827,9 +7893,10 @@ select * from j1 full join j2 on j1.id = j2.id;
Output: j1.id
-> Hash
Output: j2.id
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.j2
Output: j2.id
-(10 rows)
+(11 rows)
-- a clauseless (cross) join can't be unique
explain (verbose, costs off)
@@ -7859,9 +7926,10 @@ select * from j1 natural join j2;
Output: j1.id
-> Hash
Output: j2.id
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.j2
Output: j2.id
-(10 rows)
+(11 rows)
-- ensure a distinct clause allows the inner to become unique
explain (verbose, costs off)
@@ -8107,13 +8175,14 @@ where exists (select 1 from tenk1 t3
Output: t3.thousand, t3.tenthous
-> Hash
Output: t1.unique1
+ Buckets: 1024 Batches: 1
-> Index Only Scan using onek_unique1 on public.onek t1
Output: t1.unique1
Index Cond: (t1.unique1 < 1)
-> Index Only Scan using tenk1_hundred on public.tenk1 t2
Output: t2.hundred
Index Cond: (t2.hundred = t3.tenthous)
-(18 rows)
+(19 rows)
-- ... unless it actually is unique
create table j3 as select unique1, tenthous from onek;
diff --git a/src/test/regress/expected/join_hash.out b/src/test/regress/expected/join_hash.out
index 4fc34a0e72a..94d55648911 100644
--- a/src/test/regress/expected/join_hash.out
+++ b/src/test/regress/expected/join_hash.out
@@ -89,15 +89,16 @@ set local work_mem = '4MB';
set local hash_mem_multiplier = 1.0;
explain (costs off)
select count(*) from simple r join simple s using (id);
- QUERY PLAN
-----------------------------------------
+ QUERY PLAN
+------------------------------------------
Aggregate
-> Hash Join
Hash Cond: (r.id = s.id)
-> Seq Scan on simple r
-> Hash
+ Buckets: 32768 Batches: 1
-> Seq Scan on simple s
-(6 rows)
+(7 rows)
select count(*) from simple r join simple s using (id);
count
@@ -134,8 +135,9 @@ explain (costs off)
Hash Cond: (r.id = s.id)
-> Parallel Seq Scan on simple r
-> Hash
+ Buckets: 32768 Batches: 1
-> Seq Scan on simple s
-(9 rows)
+(10 rows)
select count(*) from simple r join simple s using (id);
count
@@ -172,8 +174,9 @@ explain (costs off)
Hash Cond: (r.id = s.id)
-> Parallel Seq Scan on simple r
-> Parallel Hash
+ Buckets: 32768 Batches: 1
-> Parallel Seq Scan on simple s
-(9 rows)
+(10 rows)
select count(*) from simple r join simple s using (id);
count
@@ -202,15 +205,16 @@ set local work_mem = '128kB';
set local hash_mem_multiplier = 1.0;
explain (costs off)
select count(*) from simple r join simple s using (id);
- QUERY PLAN
-----------------------------------------
+ QUERY PLAN
+------------------------------------------
Aggregate
-> Hash Join
Hash Cond: (r.id = s.id)
-> Seq Scan on simple r
-> Hash
+ Buckets: 4096 Batches: 16
-> Seq Scan on simple s
-(6 rows)
+(7 rows)
select count(*) from simple r join simple s using (id);
count
@@ -247,8 +251,9 @@ explain (costs off)
Hash Cond: (r.id = s.id)
-> Parallel Seq Scan on simple r
-> Hash
+ Buckets: 4096 Batches: 16
-> Seq Scan on simple s
-(9 rows)
+(10 rows)
select count(*) from simple r join simple s using (id);
count
@@ -285,8 +290,9 @@ explain (costs off)
Hash Cond: (r.id = s.id)
-> Parallel Seq Scan on simple r
-> Parallel Hash
+ Buckets: 4096 Batches: 8
-> Parallel Seq Scan on simple s
-(9 rows)
+(10 rows)
select count(*) from simple r join simple s using (id);
count
@@ -330,8 +336,9 @@ explain (costs off)
Hash Cond: (r.id = s.id)
-> Seq Scan on simple r
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on bigger_than_it_looks s
-(6 rows)
+(7 rows)
select count(*) FROM simple r JOIN bigger_than_it_looks s USING (id);
count
@@ -368,8 +375,9 @@ explain (costs off)
Hash Cond: (r.id = s.id)
-> Parallel Seq Scan on simple r
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on bigger_than_it_looks s
-(9 rows)
+(10 rows)
select count(*) from simple r join bigger_than_it_looks s using (id);
count
@@ -406,8 +414,9 @@ explain (costs off)
Hash Cond: (r.id = s.id)
-> Parallel Seq Scan on simple r
-> Parallel Hash
+ Buckets: 1024 Batches: 1
-> Parallel Seq Scan on bigger_than_it_looks s
-(9 rows)
+(10 rows)
select count(*) from simple r join bigger_than_it_looks s using (id);
count
@@ -445,8 +454,9 @@ explain (costs off)
Hash Cond: (r.id = s.id)
-> Seq Scan on simple r
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on extremely_skewed s
-(6 rows)
+(7 rows)
select count(*) from simple r join extremely_skewed s using (id);
count
@@ -481,8 +491,9 @@ explain (costs off)
Hash Cond: (r.id = s.id)
-> Parallel Seq Scan on simple r
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on extremely_skewed s
-(8 rows)
+(9 rows)
select count(*) from simple r join extremely_skewed s using (id);
count
@@ -517,8 +528,9 @@ explain (costs off)
Hash Cond: (r.id = s.id)
-> Parallel Seq Scan on simple r
-> Parallel Hash
+ Buckets: 1024 Batches: 1
-> Parallel Seq Scan on extremely_skewed s
-(8 rows)
+(9 rows)
select count(*) from simple r join extremely_skewed s using (id);
count
@@ -587,8 +599,9 @@ explain (costs off)
Hash Cond: (b1.id = b2.id)
-> Parallel Seq Scan on join_bar b1
-> Hash
+ Buckets: 2048 Batches: 8
-> Seq Scan on join_bar b2
-(11 rows)
+(12 rows)
select count(*) from join_foo
left join (select b1.id, b1.t from join_bar b1 join join_bar b2 using (id)) ss
@@ -639,8 +652,9 @@ explain (costs off)
Hash Cond: (b1.id = b2.id)
-> Parallel Seq Scan on join_bar b1
-> Hash
+ Buckets: 8192 Batches: 1
-> Seq Scan on join_bar b2
-(11 rows)
+(12 rows)
select count(*) from join_foo
left join (select b1.id, b1.t from join_bar b1 join join_bar b2 using (id)) ss
@@ -691,8 +705,9 @@ explain (costs off)
Hash Cond: (b1.id = b2.id)
-> Parallel Seq Scan on join_bar b1
-> Parallel Hash
+ Buckets: 2048 Batches: 8
-> Parallel Seq Scan on join_bar b2
-(11 rows)
+(12 rows)
select count(*) from join_foo
left join (select b1.id, b1.t from join_bar b1 join join_bar b2 using (id)) ss
@@ -743,8 +758,9 @@ explain (costs off)
Hash Cond: (b1.id = b2.id)
-> Parallel Seq Scan on join_bar b1
-> Parallel Hash
+ Buckets: 8192 Batches: 1
-> Parallel Seq Scan on join_bar b2
-(11 rows)
+(12 rows)
select count(*) from join_foo
left join (select b1.id, b1.t from join_bar b1 join join_bar b2 using (id)) ss
@@ -773,15 +789,16 @@ savepoint settings;
set local max_parallel_workers_per_gather = 0;
explain (costs off)
select count(*) from simple r full outer join simple s using (id);
- QUERY PLAN
-----------------------------------------
+ QUERY PLAN
+------------------------------------------
Aggregate
-> Hash Full Join
Hash Cond: (r.id = s.id)
-> Seq Scan on simple r
-> Hash
+ Buckets: 32768 Batches: 1
-> Seq Scan on simple s
-(6 rows)
+(7 rows)
select count(*) from simple r full outer join simple s using (id);
count
@@ -796,15 +813,16 @@ set enable_parallel_hash = off;
set local max_parallel_workers_per_gather = 2;
explain (costs off)
select count(*) from simple r full outer join simple s using (id);
- QUERY PLAN
-----------------------------------------
+ QUERY PLAN
+------------------------------------------
Aggregate
-> Hash Full Join
Hash Cond: (r.id = s.id)
-> Seq Scan on simple r
-> Hash
+ Buckets: 32768 Batches: 1
-> Seq Scan on simple s
-(6 rows)
+(7 rows)
select count(*) from simple r full outer join simple s using (id);
count
@@ -828,8 +846,9 @@ explain (costs off)
Hash Cond: (r.id = s.id)
-> Parallel Seq Scan on simple r
-> Parallel Hash
+ Buckets: 32768 Batches: 1
-> Parallel Seq Scan on simple s
-(9 rows)
+(10 rows)
select count(*) from simple r full outer join simple s using (id);
count
@@ -844,15 +863,16 @@ savepoint settings;
set local max_parallel_workers_per_gather = 0;
explain (costs off)
select count(*) from simple r full outer join simple s on (r.id = 0 - s.id);
- QUERY PLAN
-----------------------------------------
+ QUERY PLAN
+------------------------------------------
Aggregate
-> Hash Full Join
Hash Cond: ((0 - s.id) = r.id)
-> Seq Scan on simple s
-> Hash
+ Buckets: 32768 Batches: 1
-> Seq Scan on simple r
-(6 rows)
+(7 rows)
select count(*) from simple r full outer join simple s on (r.id = 0 - s.id);
count
@@ -867,15 +887,16 @@ set enable_parallel_hash = off;
set local max_parallel_workers_per_gather = 2;
explain (costs off)
select count(*) from simple r full outer join simple s on (r.id = 0 - s.id);
- QUERY PLAN
-----------------------------------------
+ QUERY PLAN
+------------------------------------------
Aggregate
-> Hash Full Join
Hash Cond: ((0 - s.id) = r.id)
-> Seq Scan on simple s
-> Hash
+ Buckets: 32768 Batches: 1
-> Seq Scan on simple r
-(6 rows)
+(7 rows)
select count(*) from simple r full outer join simple s on (r.id = 0 - s.id);
count
@@ -899,8 +920,9 @@ explain (costs off)
Hash Cond: ((0 - s.id) = r.id)
-> Parallel Seq Scan on simple s
-> Parallel Hash
+ Buckets: 32768 Batches: 1
-> Parallel Seq Scan on simple r
-(9 rows)
+(10 rows)
select count(*) from simple r full outer join simple s on (r.id = 0 - s.id);
count
@@ -932,8 +954,9 @@ explain (costs off)
Hash Cond: (wide.id = wide_1.id)
-> Parallel Seq Scan on wide
-> Parallel Hash
+ Buckets: 2048 Batches: 1
-> Parallel Seq Scan on wide wide_1
-(9 rows)
+(10 rows)
select length(max(s.t))
from wide left join (select id, coalesce(t, '') || '' as t from wide) s using (id);
@@ -1041,6 +1064,7 @@ WHERE
Output: (hjtest_1.b * 5)
-> Hash
Output: hjtest_2.a, hjtest_2.tableoid, hjtest_2.id, hjtest_2.c, hjtest_2.b
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.hjtest_2
Output: hjtest_2.a, hjtest_2.tableoid, hjtest_2.id, hjtest_2.c, hjtest_2.b
Filter: ((SubPlan 5) < 55)
@@ -1057,7 +1081,7 @@ WHERE
SubPlan 2
-> Result
Output: (hjtest_1.b * 5)
-(28 rows)
+(29 rows)
SELECT hjtest_1.a a1, hjtest_2.a a2,hjtest_1.tableoid::regclass t1, hjtest_2.tableoid::regclass t2
FROM hjtest_1, hjtest_2
@@ -1095,6 +1119,7 @@ WHERE
Output: (hjtest_2.c * 5)
-> Hash
Output: hjtest_1.a, hjtest_1.tableoid, hjtest_1.id, hjtest_1.b
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.hjtest_1
Output: hjtest_1.a, hjtest_1.tableoid, hjtest_1.id, hjtest_1.b
Filter: ((SubPlan 4) < 50)
@@ -1111,7 +1136,7 @@ WHERE
SubPlan 3
-> Result
Output: (hjtest_2.c * 5)
-(28 rows)
+(29 rows)
SELECT hjtest_1.a a1, hjtest_2.a a2,hjtest_1.tableoid::regclass t1, hjtest_2.tableoid::regclass t2
FROM hjtest_2, hjtest_1
@@ -1147,8 +1172,9 @@ lateral (select t1.fivethous, i4.f1 from tenk1 t1 join int4_tbl i4
Hash Cond: (t1.fivethous = (i4.f1 + i8.q2))
-> Seq Scan on tenk1 t1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int4_tbl i4
-(9 rows)
+(10 rows)
select i8.q2, ss.* from
int8_tbl i8,
diff --git a/src/test/regress/expected/merge.out b/src/test/regress/expected/merge.out
index 05314ad4397..6962aa0652d 100644
--- a/src/test/regress/expected/merge.out
+++ b/src/test/regress/expected/merge.out
@@ -323,15 +323,16 @@ USING source AS s
ON t.tid = s.sid
WHEN MATCHED THEN
UPDATE SET balance = 0;
- QUERY PLAN
-----------------------------------------
+ QUERY PLAN
+-----------------------------------------
Merge on target t
-> Hash Join
Hash Cond: (s.sid = t.tid)
-> Seq Scan on source s
-> Hash
+ Buckets: 2048 Batches: 1
-> Seq Scan on target t
-(6 rows)
+(7 rows)
EXPLAIN (COSTS OFF)
MERGE INTO target t
@@ -339,15 +340,16 @@ USING source AS s
ON t.tid = s.sid
WHEN MATCHED THEN
DELETE;
- QUERY PLAN
-----------------------------------------
+ QUERY PLAN
+-----------------------------------------
Merge on target t
-> Hash Join
Hash Cond: (s.sid = t.tid)
-> Seq Scan on source s
-> Hash
+ Buckets: 2048 Batches: 1
-> Seq Scan on target t
-(6 rows)
+(7 rows)
EXPLAIN (COSTS OFF)
MERGE INTO target t
@@ -355,15 +357,16 @@ USING source AS s
ON t.tid = s.sid
WHEN NOT MATCHED THEN
INSERT VALUES (4, NULL);
- QUERY PLAN
-----------------------------------------
+ QUERY PLAN
+-----------------------------------------
Merge on target t
-> Hash Left Join
Hash Cond: (s.sid = t.tid)
-> Seq Scan on source s
-> Hash
+ Buckets: 2048 Batches: 1
-> Seq Scan on target t
-(6 rows)
+(7 rows)
DELETE FROM target WHERE tid > 100;
ANALYZE target;
@@ -1833,6 +1836,7 @@ WHEN MATCHED AND t.c > s.cnt THEN
Output: t.ctid, t.a, t.b
-> Hash
Output: s.a, s.b, s.c, s.d, s.ctid
+ Buckets: 2048 Batches: 1
-> Seq Scan on public.src s
Output: s.a, s.b, s.c, s.d, s.ctid
SubPlan 1
@@ -1856,7 +1860,7 @@ WHEN MATCHED AND t.c > s.cnt THEN
-> Seq Scan on public.ref r_1
Output: r_1.ab, r_1.cd
Filter: ((r_1.ab = (s.a + s.b)) AND (r_1.cd = (s.c - s.d)))
-(32 rows)
+(33 rows)
DROP TABLE src, tgt, ref;
-- Subqueries
@@ -2377,9 +2381,10 @@ MERGE INTO pa_target t USING pa_source s ON t.tid = s.sid
Output: s.sid, s.ctid
-> Hash
Output: t_1.tid, t_1.tableoid, t_1.ctid
+ Buckets: 4096 Batches: 1
-> Seq Scan on public.pa_targetp t_1
Output: t_1.tid, t_1.tableoid, t_1.ctid
-(12 rows)
+(13 rows)
MERGE INTO pa_target t USING pa_source s ON t.tid = s.sid
WHEN NOT MATCHED THEN INSERT VALUES (s.sid);
@@ -2407,10 +2412,11 @@ MERGE INTO pa_target t USING pa_source s ON t.tid = s.sid
Output: s.sid, s.ctid
-> Hash
Output: t.tid, t.ctid
+ Buckets: 1024 Batches: 1
-> Result
Output: t.tid, t.ctid
One-Time Filter: false
-(12 rows)
+(13 rows)
MERGE INTO pa_target t USING pa_source s ON t.tid = s.sid
WHEN NOT MATCHED THEN INSERT VALUES (s.sid);
diff --git a/src/test/regress/expected/misc_functions.out b/src/test/regress/expected/misc_functions.out
index 106dedb519a..5461569411c 100644
--- a/src/test/regress/expected/misc_functions.out
+++ b/src/test/regress/expected/misc_functions.out
@@ -592,9 +592,10 @@ WHERE my_int_eq(a.unique2, 42);
Hash Cond: (b.unique1 = a.unique1)
-> Seq Scan on tenk1 b
-> Hash
+ Buckets: 4096 Batches: 1
-> Seq Scan on tenk1 a
Filter: my_int_eq(unique2, 42)
-(6 rows)
+(7 rows)
-- With support function that knows it's int4eq, we get a different plan
CREATE FUNCTION test_support_func(internal)
@@ -627,8 +628,9 @@ SELECT * FROM tenk1 a JOIN my_gen_series(1,1000) g ON a.unique1 = g;
Hash Cond: (g.g = a.unique1)
-> Function Scan on my_gen_series g
-> Hash
+ Buckets: 16384 Batches: 1
-> Seq Scan on tenk1 a
-(5 rows)
+(6 rows)
EXPLAIN (COSTS OFF)
SELECT * FROM tenk1 a JOIN my_gen_series(1,10) g ON a.unique1 = g;
diff --git a/src/test/regress/expected/partition_aggregate.out b/src/test/regress/expected/partition_aggregate.out
index 5f2c0cf5786..1fb6008ec4b 100644
--- a/src/test/regress/expected/partition_aggregate.out
+++ b/src/test/regress/expected/partition_aggregate.out
@@ -426,6 +426,7 @@ SELECT t1.x, sum(t1.y), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2
Hash Cond: (t1.x = t2.y)
-> Seq Scan on pagg_tab1_p1 t1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab2_p1 t2
-> HashAggregate
Group Key: t1_1.x
@@ -433,6 +434,7 @@ SELECT t1.x, sum(t1.y), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2
Hash Cond: (t1_1.x = t2_1.y)
-> Seq Scan on pagg_tab1_p2 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab2_p2 t2_1
-> HashAggregate
Group Key: t1_2.x
@@ -440,8 +442,9 @@ SELECT t1.x, sum(t1.y), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2
Hash Cond: (t2_2.y = t1_2.x)
-> Seq Scan on pagg_tab2_p3 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab1_p3 t1_2
-(24 rows)
+(27 rows)
SELECT t1.x, sum(t1.y), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2.y GROUP BY t1.x ORDER BY 1, 2, 3;
x | sum | count
@@ -469,11 +472,12 @@ SELECT t1.x, sum(t1.y), count(t1) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t
-> Seq Scan on pagg_tab1_p2 t1_2
-> Seq Scan on pagg_tab1_p3 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on pagg_tab2_p1 t2_1
-> Seq Scan on pagg_tab2_p2 t2_2
-> Seq Scan on pagg_tab2_p3 t2_3
-(15 rows)
+(16 rows)
SELECT t1.x, sum(t1.y), count(t1) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2.y GROUP BY t1.x ORDER BY 1, 2, 3;
x | sum | count
@@ -499,6 +503,7 @@ SELECT t2.y, sum(t1.y), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2
Hash Cond: (t1.x = t2.y)
-> Seq Scan on pagg_tab1_p1 t1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab2_p1 t2
-> HashAggregate
Group Key: t2_1.y
@@ -506,6 +511,7 @@ SELECT t2.y, sum(t1.y), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2
Hash Cond: (t1_1.x = t2_1.y)
-> Seq Scan on pagg_tab1_p2 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab2_p2 t2_1
-> HashAggregate
Group Key: t2_2.y
@@ -513,8 +519,9 @@ SELECT t2.y, sum(t1.y), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2
Hash Cond: (t2_2.y = t1_2.x)
-> Seq Scan on pagg_tab2_p3 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab1_p3 t1_2
-(24 rows)
+(27 rows)
-- When GROUP BY clause does not match; partial aggregation is performed for each partition.
-- Also test GroupAggregate paths by disabling hash aggregates.
@@ -538,6 +545,7 @@ SELECT t1.y, sum(t1.x), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2
Hash Cond: (t1.x = t2.y)
-> Seq Scan on pagg_tab1_p1 t1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab2_p1 t2
-> Partial GroupAggregate
Group Key: t1_1.y
@@ -547,6 +555,7 @@ SELECT t1.y, sum(t1.x), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2
Hash Cond: (t1_1.x = t2_1.y)
-> Seq Scan on pagg_tab1_p2 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab2_p2 t2_1
-> Partial GroupAggregate
Group Key: t1_2.y
@@ -556,8 +565,9 @@ SELECT t1.y, sum(t1.x), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2
Hash Cond: (t2_2.y = t1_2.x)
-> Seq Scan on pagg_tab2_p3 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab1_p3 t1_2
-(34 rows)
+(37 rows)
SELECT t1.y, sum(t1.x), count(*) FROM pagg_tab1 t1, pagg_tab2 t2 WHERE t1.x = t2.y GROUP BY t1.y HAVING avg(t1.x) > 10 ORDER BY 1, 2, 3;
y | sum | count
@@ -590,6 +600,7 @@ SELECT b.y, sum(a.y) FROM pagg_tab1 a LEFT JOIN pagg_tab2 b ON a.x = b.y GROUP B
Hash Cond: (a.x = b.y)
-> Seq Scan on pagg_tab1_p1 a
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab2_p1 b
-> Partial HashAggregate
Group Key: b_1.y
@@ -597,6 +608,7 @@ SELECT b.y, sum(a.y) FROM pagg_tab1 a LEFT JOIN pagg_tab2 b ON a.x = b.y GROUP B
Hash Cond: (a_1.x = b_1.y)
-> Seq Scan on pagg_tab1_p2 a_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab2_p2 b_1
-> Partial HashAggregate
Group Key: b_2.y
@@ -604,8 +616,9 @@ SELECT b.y, sum(a.y) FROM pagg_tab1 a LEFT JOIN pagg_tab2 b ON a.x = b.y GROUP B
Hash Cond: (b_2.y = a_2.x)
-> Seq Scan on pagg_tab2_p3 b_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab1_p3 a_2
-(26 rows)
+(29 rows)
SELECT b.y, sum(a.y) FROM pagg_tab1 a LEFT JOIN pagg_tab2 b ON a.x = b.y GROUP BY b.y ORDER BY 1 NULLS LAST;
y | sum
@@ -633,6 +646,7 @@ SELECT b.y, sum(a.y) FROM pagg_tab1 a RIGHT JOIN pagg_tab2 b ON a.x = b.y GROUP
Hash Cond: (a.x = b.y)
-> Seq Scan on pagg_tab1_p1 a
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab2_p1 b
-> HashAggregate
Group Key: b_1.y
@@ -640,6 +654,7 @@ SELECT b.y, sum(a.y) FROM pagg_tab1 a RIGHT JOIN pagg_tab2 b ON a.x = b.y GROUP
Hash Cond: (a_1.x = b_1.y)
-> Seq Scan on pagg_tab1_p2 a_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab2_p2 b_1
-> HashAggregate
Group Key: b_2.y
@@ -647,8 +662,9 @@ SELECT b.y, sum(a.y) FROM pagg_tab1 a RIGHT JOIN pagg_tab2 b ON a.x = b.y GROUP
Hash Cond: (b_2.y = a_2.x)
-> Seq Scan on pagg_tab2_p3 b_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab1_p3 a_2
-(24 rows)
+(27 rows)
SELECT b.y, sum(a.y) FROM pagg_tab1 a RIGHT JOIN pagg_tab2 b ON a.x = b.y GROUP BY b.y ORDER BY 1 NULLS LAST;
y | sum
@@ -682,6 +698,7 @@ SELECT a.x, sum(b.x) FROM pagg_tab1 a FULL OUTER JOIN pagg_tab2 b ON a.x = b.y G
Hash Cond: (a.x = b.y)
-> Seq Scan on pagg_tab1_p1 a
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab2_p1 b
-> Partial HashAggregate
Group Key: a_1.x
@@ -689,6 +706,7 @@ SELECT a.x, sum(b.x) FROM pagg_tab1 a FULL OUTER JOIN pagg_tab2 b ON a.x = b.y G
Hash Cond: (a_1.x = b_1.y)
-> Seq Scan on pagg_tab1_p2 a_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab2_p2 b_1
-> Partial HashAggregate
Group Key: a_2.x
@@ -696,8 +714,9 @@ SELECT a.x, sum(b.x) FROM pagg_tab1 a FULL OUTER JOIN pagg_tab2 b ON a.x = b.y G
Hash Cond: (b_2.y = a_2.x)
-> Seq Scan on pagg_tab2_p3 b_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pagg_tab1_p3 a_2
-(26 rows)
+(29 rows)
SELECT a.x, sum(b.x) FROM pagg_tab1 a FULL OUTER JOIN pagg_tab2 b ON a.x = b.y GROUP BY a.x ORDER BY 1 NULLS LAST;
x | sum
@@ -741,12 +760,13 @@ SELECT a.x, b.y, count(*) FROM (SELECT * FROM pagg_tab1 WHERE x < 20) a LEFT JOI
-> Seq Scan on pagg_tab1_p2 pagg_tab1_2
Filter: (x < 20)
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on pagg_tab2_p2 pagg_tab2_1
Filter: (y > 10)
-> Seq Scan on pagg_tab2_p3 pagg_tab2_2
Filter: (y > 10)
-(18 rows)
+(19 rows)
SELECT a.x, b.y, count(*) FROM (SELECT * FROM pagg_tab1 WHERE x < 20) a LEFT JOIN (SELECT * FROM pagg_tab2 WHERE y > 10) b ON a.x = b.y WHERE a.x > 5 or b.y < 20 GROUP BY a.x, b.y ORDER BY 1, 2;
x | y | count
@@ -781,12 +801,13 @@ SELECT a.x, b.y, count(*) FROM (SELECT * FROM pagg_tab1 WHERE x < 20) a FULL JOI
-> Seq Scan on pagg_tab1_p2 pagg_tab1_2
Filter: (x < 20)
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on pagg_tab2_p2 pagg_tab2_1
Filter: (y > 10)
-> Seq Scan on pagg_tab2_p3 pagg_tab2_2
Filter: (y > 10)
-(18 rows)
+(19 rows)
SELECT a.x, b.y, count(*) FROM (SELECT * FROM pagg_tab1 WHERE x < 20) a FULL JOIN (SELECT * FROM pagg_tab2 WHERE y > 10) b ON a.x = b.y WHERE a.x > 5 or b.y < 20 GROUP BY a.x, b.y ORDER BY 1, 2;
x | y | count
diff --git a/src/test/regress/expected/partition_join.out b/src/test/regress/expected/partition_join.out
index af468682a2d..6ab311cab12 100644
--- a/src/test/regress/expected/partition_join.out
+++ b/src/test/regress/expected/partition_join.out
@@ -37,21 +37,24 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1, prt2 t2 WHERE t1.a = t2.b AND t1.b =
Hash Cond: (t2_1.b = t1_1.a)
-> Seq Scan on prt2_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p1 t1_1
Filter: (b = 0)
-> Hash Join
Hash Cond: (t2_2.b = t1_2.a)
-> Seq Scan on prt2_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p2 t1_2
Filter: (b = 0)
-> Hash Join
Hash Cond: (t2_3.b = t1_3.a)
-> Seq Scan on prt2_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p3 t1_3
Filter: (b = 0)
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1, prt2 t2 WHERE t1.a = t2.b AND t1.b = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -81,15 +84,17 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1, prt2 t2 WHERE t1.a = t2.a AND t1.a =
Hash Cond: (t1_2.a = t2_2.a)
-> Seq Scan on prt1_p2 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p2 t2_2
Filter: (a = b)
-> Hash Join
Hash Cond: (t1_3.a = t2_3.a)
-> Seq Scan on prt1_p3 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p3 t2_3
Filter: (a = b)
-(22 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1, prt2 t2 WHERE t1.a = t2.a AND t1.a = t2.b ORDER BY t1.a, t2.b;
a | c | b | c
@@ -116,8 +121,10 @@ SELECT COUNT(*) FROM prt1 t1
Hash Cond: (t1_1.a = t2_1.a)
-> Seq Scan on prt1_p1 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p1 t3_1
-> Hash Left Join
Hash Cond: (t2_2.a = t3_2.a)
@@ -125,8 +132,10 @@ SELECT COUNT(*) FROM prt1 t1
Hash Cond: (t1_2.a = t2_2.a)
-> Seq Scan on prt1_p2 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p2 t3_2
-> Hash Left Join
Hash Cond: (t2_3.a = t3_3.a)
@@ -134,10 +143,12 @@ SELECT COUNT(*) FROM prt1 t1
Hash Cond: (t1_3.a = t2_3.a)
-> Seq Scan on prt1_p3 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p3 t3_3
-(29 rows)
+(35 rows)
SELECT COUNT(*) FROM prt1 t1
LEFT JOIN prt1 t2 ON t1.a = t2.a
@@ -161,6 +172,7 @@ SELECT t1, t2 FROM prt1 t1 LEFT JOIN prt2 t2 ON t1.a = t2.b WHERE t1.b = 0 ORDER
-> Seq Scan on prt2_p2 t2_2
-> Seq Scan on prt2_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_p1 t1_1
Filter: (b = 0)
@@ -168,7 +180,7 @@ SELECT t1, t2 FROM prt1 t1 LEFT JOIN prt2 t2 ON t1.a = t2.b WHERE t1.b = 0 ORDER
Filter: (b = 0)
-> Seq Scan on prt1_p3 t1_3
Filter: (b = 0)
-(16 rows)
+(17 rows)
SELECT t1, t2 FROM prt1 t1 LEFT JOIN prt2 t2 ON t1.a = t2.b WHERE t1.b = 0 ORDER BY t1.a, t2.b;
t1 | t2
@@ -199,12 +211,14 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1 RIGHT JOIN prt2 t2 ON t1.a = t2.b WHE
Hash Cond: (t1_1.a = t2_1.b)
-> Seq Scan on prt1_p1 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p1 t2_1
Filter: (a = 0)
-> Hash Right Join
Hash Cond: (t1_2.a = t2_2.b)
-> Seq Scan on prt1_p2 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p2 t2_2
Filter: (a = 0)
-> Nested Loop Left Join
@@ -212,7 +226,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1 RIGHT JOIN prt2 t2 ON t1.a = t2.b WHE
Filter: (a = 0)
-> Index Scan using iprt1_p3_a on prt1_p3 t1_3
Index Cond: (a = t2_3.b)
-(20 rows)
+(22 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1 RIGHT JOIN prt2 t2 ON t1.a = t2.b WHERE t2.a = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -241,6 +255,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT 50 phv, * FROM prt1 WHERE prt1.b = 0)
-> Seq Scan on prt1_p1 prt1_1
Filter: (b = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p1 prt2_1
Filter: (a = 0)
-> Hash Full Join
@@ -249,6 +264,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT 50 phv, * FROM prt1 WHERE prt1.b = 0)
-> Seq Scan on prt1_p2 prt1_2
Filter: (b = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p2 prt2_2
Filter: (a = 0)
-> Hash Full Join
@@ -257,9 +273,10 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT 50 phv, * FROM prt1 WHERE prt1.b = 0)
-> Seq Scan on prt1_p3 prt1_3
Filter: (b = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p3 prt2_3
Filter: (a = 0)
-(27 rows)
+(30 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT 50 phv, * FROM prt1 WHERE prt1.b = 0) t1 FULL JOIN (SELECT 75 phv, * FROM prt2 WHERE prt2.a = 0) t2 ON (t1.a = t2.b) WHERE t1.phv = t1.a OR t2.phv = t2.b ORDER BY t1.a, t2.b;
a | c | b | c
@@ -280,9 +297,10 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1, prt2 t2 WHERE t1.a = t2.b AND t1.a <
-> Seq Scan on prt2_p2 t2
Filter: (b > 250)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p2 t1
Filter: ((a < 450) AND (b = 0))
-(9 rows)
+(10 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1, prt2 t2 WHERE t1.a = t2.b AND t1.a < 450 AND t2.b > 250 AND t1.b = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -305,12 +323,13 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1 WHERE a < 450) t1 LEFT JO
-> Seq Scan on prt2_p3 prt2_2
Filter: (b > 250)
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_p1 prt1_1
Filter: ((a < 450) AND (b = 0))
-> Seq Scan on prt1_p2 prt1_2
Filter: ((a < 450) AND (b = 0))
-(15 rows)
+(16 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1 WHERE a < 450) t1 LEFT JOIN (SELECT * FROM prt2 WHERE b > 250) t2 ON t1.a = t2.b WHERE t1.b = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -342,12 +361,13 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1 WHERE a < 450) t1 FULL JO
-> Seq Scan on prt1_p2 prt1_2
Filter: (a < 450)
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt2_p2 prt2_1
Filter: (b > 250)
-> Seq Scan on prt2_p3 prt2_2
Filter: (b > 250)
-(16 rows)
+(17 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1 WHERE a < 450) t1 FULL JOIN (SELECT * FROM prt2 WHERE b > 250) t2 ON t1.a = t2.b WHERE t1.b = 0 OR t2.a = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -379,6 +399,7 @@ SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t2.b FROM prt2 t2 WHERE t2.a = 0)
-> Seq Scan on prt1_p1 t1_1
Filter: (b = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p1 t2_1
Filter: (a = 0)
-> Hash Semi Join
@@ -386,6 +407,7 @@ SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t2.b FROM prt2 t2 WHERE t2.a = 0)
-> Seq Scan on prt1_p2 t1_2
Filter: (b = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p2 t2_2
Filter: (a = 0)
-> Nested Loop Semi Join
@@ -395,7 +417,7 @@ SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t2.b FROM prt2 t2 WHERE t2.a = 0)
-> Materialize
-> Seq Scan on prt2_p3 t2_3
Filter: (a = 0)
-(24 rows)
+(26 rows)
SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t2.b FROM prt2 t2 WHERE t2.a = 0) AND t1.b = 0 ORDER BY t1.a;
a | b | c
@@ -417,18 +439,21 @@ SELECT sum(t1.a), avg(t1.a), sum(t1.b), avg(t1.b) FROM prt1 t1 WHERE NOT EXISTS
Hash Cond: (t1_1.a = t2_1.b)
-> Seq Scan on prt1_p1 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p1 t2_1
-> Hash Anti Join
Hash Cond: (t1_2.a = t2_2.b)
-> Seq Scan on prt1_p2 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p2 t2_2
-> Hash Anti Join
Hash Cond: (t1_3.a = t2_3.b)
-> Seq Scan on prt1_p3 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p3 t2_3
-(17 rows)
+(20 rows)
SELECT sum(t1.a), avg(t1.a), sum(t1.b), avg(t1.b) FROM prt1 t1 WHERE NOT EXISTS (SELECT 1 FROM prt2 t2 WHERE t1.a = t2.b);
sum | avg | sum | avg
@@ -507,23 +532,27 @@ SELECT t1.a, ss.t2a, ss.t2c FROM prt1 t1 LEFT JOIN LATERAL
-> Seq Scan on prt1_p2 t1_2
-> Seq Scan on prt1_p3 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Hash Join
Hash Cond: (t2_1.a = t3_1.b)
-> Seq Scan on prt1_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p1 t3_1
-> Hash Join
Hash Cond: (t2_2.a = t3_2.b)
-> Seq Scan on prt1_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p2 t3_2
-> Hash Join
Hash Cond: (t2_3.a = t3_3.b)
-> Seq Scan on prt1_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p3 t3_3
-(26 rows)
+(30 rows)
SELECT t1.a, ss.t2a, ss.t2c FROM prt1 t1 LEFT JOIN LATERAL
(SELECT t2.a AS t2a, t3.a AS t3a, t2.b t2b, t2.c t2c, least(t1.a,t2.a,t3.a) FROM prt1 t2 JOIN prt2 t3 ON (t2.a = t3.b)) ss
@@ -742,21 +771,24 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_e t1, prt2_e t2 WHERE (t1.a + t1.b)/2 =
Hash Cond: (((t2_1.b + t2_1.a) / 2) = ((t1_1.a + t1_1.b) / 2))
-> Seq Scan on prt2_e_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_e_p1 t1_1
Filter: (c = 0)
-> Hash Join
Hash Cond: (((t2_2.b + t2_2.a) / 2) = ((t1_2.a + t1_2.b) / 2))
-> Seq Scan on prt2_e_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_e_p2 t1_2
Filter: (c = 0)
-> Hash Join
Hash Cond: (((t2_3.b + t2_3.a) / 2) = ((t1_3.a + t1_3.b) / 2))
-> Seq Scan on prt2_e_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_e_p3 t1_3
Filter: (c = 0)
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_e t1, prt2_e t2 WHERE (t1.a + t1.b)/2 = (t2.b + t2.a)/2 AND t1.c = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -783,6 +815,7 @@ SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM prt1 t1, prt2 t2, prt1_e t
Hash Cond: (t2_1.b = t1_1.a)
-> Seq Scan on prt2_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p1 t1_1
Filter: (b = 0)
-> Index Scan using iprt1_e_p1_ab2 on prt1_e_p1 t3_1
@@ -793,6 +826,7 @@ SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM prt1 t1, prt2 t2, prt1_e t
Hash Cond: (t2_2.b = t1_2.a)
-> Seq Scan on prt2_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p2 t1_2
Filter: (b = 0)
-> Index Scan using iprt1_e_p2_ab2 on prt1_e_p2 t3_2
@@ -803,11 +837,12 @@ SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM prt1 t1, prt2 t2, prt1_e t
Hash Cond: (t2_3.b = t1_3.a)
-> Seq Scan on prt2_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p3 t1_3
Filter: (b = 0)
-> Index Scan using iprt1_e_p3_ab2 on prt1_e_p3 t3_3
Index Cond: (((a + b) / 2) = t2_3.b)
-(33 rows)
+(36 rows)
SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM prt1 t1, prt2 t2, prt1_e t3 WHERE t1.a = t2.b AND t1.a = (t3.a + t3.b)/2 AND t1.b = 0 ORDER BY t1.a, t2.b;
a | c | b | c | ?column? | c
@@ -829,33 +864,39 @@ SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM (prt1 t1 LEFT JOIN prt2 t2
Hash Cond: (((t3_1.a + t3_1.b) / 2) = t1_1.a)
-> Seq Scan on prt1_e_p1 t3_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Hash Right Join
Hash Cond: (t2_1.b = t1_1.a)
-> Seq Scan on prt2_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p1 t1_1
Filter: (b = 0)
-> Hash Right Join
Hash Cond: (((t3_2.a + t3_2.b) / 2) = t1_2.a)
-> Seq Scan on prt1_e_p2 t3_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Hash Right Join
Hash Cond: (t2_2.b = t1_2.a)
-> Seq Scan on prt2_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p2 t1_2
Filter: (b = 0)
-> Hash Right Join
Hash Cond: (((t3_3.a + t3_3.b) / 2) = t1_3.a)
-> Seq Scan on prt1_e_p3 t3_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Hash Right Join
Hash Cond: (t2_3.b = t1_3.a)
-> Seq Scan on prt2_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p3 t1_3
Filter: (b = 0)
-(33 rows)
+(39 rows)
SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM (prt1 t1 LEFT JOIN prt2 t2 ON t1.a = t2.b) LEFT JOIN prt1_e t3 ON (t1.a = (t3.a + t3.b)/2) WHERE t1.b = 0 ORDER BY t1.a, t2.b, t3.a + t3.b;
a | c | b | c | ?column? | c
@@ -886,6 +927,7 @@ SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM (prt1 t1 LEFT JOIN prt2 t2
Hash Cond: (t1_1.a = ((t3_1.a + t3_1.b) / 2))
-> Seq Scan on prt1_p1 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_e_p1 t3_1
Filter: (c = 0)
-> Index Scan using iprt2_p1_b on prt2_p1 t2_1
@@ -895,6 +937,7 @@ SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM (prt1 t1 LEFT JOIN prt2 t2
Hash Cond: (t1_2.a = ((t3_2.a + t3_2.b) / 2))
-> Seq Scan on prt1_p2 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_e_p2 t3_2
Filter: (c = 0)
-> Index Scan using iprt2_p2_b on prt2_p2 t2_2
@@ -904,11 +947,12 @@ SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM (prt1 t1 LEFT JOIN prt2 t2
Hash Cond: (t1_3.a = ((t3_3.a + t3_3.b) / 2))
-> Seq Scan on prt1_p3 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_e_p3 t3_3
Filter: (c = 0)
-> Index Scan using iprt2_p3_b on prt2_p3 t2_3
Index Cond: (b = t1_3.a)
-(30 rows)
+(33 rows)
SELECT t1.a, t1.c, t2.b, t2.c, t3.a + t3.b, t3.c FROM (prt1 t1 LEFT JOIN prt2 t2 ON t1.a = t2.b) RIGHT JOIN prt1_e t3 ON (t1.a = (t3.a + t3.b)/2) WHERE t3.c = 0 ORDER BY t1.a, t2.b, t3.a + t3.b;
a | c | b | c | ?column? | c
@@ -944,8 +988,10 @@ SELECT COUNT(*) FROM prt1 FULL JOIN prt2 p2(b,a,c) USING(a,b) FULL JOIN prt2 p3(
Hash Cond: ((prt1_1.a = p2_1.a) AND (prt1_1.b = p2_1.b))
-> Seq Scan on prt1_p1 prt1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p1 p2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p1 p3_1
-> Hash Full Join
Hash Cond: ((COALESCE(prt1_2.a, p2_2.a) = p3_2.a) AND (COALESCE(prt1_2.b, p2_2.b) = p3_2.b))
@@ -954,8 +1000,10 @@ SELECT COUNT(*) FROM prt1 FULL JOIN prt2 p2(b,a,c) USING(a,b) FULL JOIN prt2 p3(
Hash Cond: ((prt1_2.a = p2_2.a) AND (prt1_2.b = p2_2.b))
-> Seq Scan on prt1_p2 prt1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p2 p2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p2 p3_2
-> Hash Full Join
Hash Cond: ((COALESCE(prt1_3.a, p2_3.a) = p3_3.a) AND (COALESCE(prt1_3.b, p2_3.b) = p3_3.b))
@@ -964,10 +1012,12 @@ SELECT COUNT(*) FROM prt1 FULL JOIN prt2 p2(b,a,c) USING(a,b) FULL JOIN prt2 p3(
Hash Cond: ((prt1_3.a = p2_3.a) AND (prt1_3.b = p2_3.b))
-> Seq Scan on prt1_p3 prt1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p3 p2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p3 p3_3
-(32 rows)
+(38 rows)
SELECT COUNT(*) FROM prt1 FULL JOIN prt2 p2(b,a,c) USING(a,b) FULL JOIN prt2 p3(b,a,c) USING (a, b)
WHERE a BETWEEN 490 AND 510;
@@ -995,10 +1045,13 @@ SELECT COUNT(*) FROM prt1 FULL JOIN prt2 p2(b,a,c) USING(a,b) FULL JOIN prt2 p3(
Hash Cond: ((prt1_1.a = p2_1.a) AND (prt1_1.b = p2_1.b))
-> Seq Scan on prt1_p1 prt1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p1 p2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p1 p3_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p1 p4_1
-> Hash Full Join
Hash Cond: ((COALESCE(COALESCE(prt1_2.a, p2_2.a), p3_2.a) = p4_2.a) AND (COALESCE(COALESCE(prt1_2.b, p2_2.b), p3_2.b) = p4_2.b))
@@ -1009,10 +1062,13 @@ SELECT COUNT(*) FROM prt1 FULL JOIN prt2 p2(b,a,c) USING(a,b) FULL JOIN prt2 p3(
Hash Cond: ((prt1_2.a = p2_2.a) AND (prt1_2.b = p2_2.b))
-> Seq Scan on prt1_p2 prt1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p2 p2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p2 p3_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p2 p4_2
-> Hash Full Join
Hash Cond: ((COALESCE(COALESCE(prt1_3.a, p2_3.a), p3_3.a) = p4_3.a) AND (COALESCE(COALESCE(prt1_3.b, p2_3.b), p3_3.b) = p4_3.b))
@@ -1023,12 +1079,15 @@ SELECT COUNT(*) FROM prt1 FULL JOIN prt2 p2(b,a,c) USING(a,b) FULL JOIN prt2 p3(
Hash Cond: ((prt1_3.a = p2_3.a) AND (prt1_3.b = p2_3.b))
-> Seq Scan on prt1_p3 prt1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p3 p2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p3 p3_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p3 p4_3
-(44 rows)
+(53 rows)
SELECT COUNT(*) FROM prt1 FULL JOIN prt2 p2(b,a,c) USING(a,b) FULL JOIN prt2 p3(b,a,c) USING (a, b) FULL JOIN prt1 p4 (a,b,c) USING (a, b)
WHERE a BETWEEN 490 AND 510;
@@ -1054,9 +1113,11 @@ SELECT t1.a, t1.phv, t2.b, t2.phv, t3.a + t3.b, t3.phv FROM ((SELECT 50 phv, * F
-> Seq Scan on prt1_p1 prt1_1
Filter: (b = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p1 prt2_1
Filter: (a = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_e_p1 prt1_e_1
Filter: (c = 0)
-> Hash Full Join
@@ -1067,9 +1128,11 @@ SELECT t1.a, t1.phv, t2.b, t2.phv, t3.a + t3.b, t3.phv FROM ((SELECT 50 phv, * F
-> Seq Scan on prt1_p2 prt1_2
Filter: (b = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p2 prt2_2
Filter: (a = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_e_p2 prt1_e_2
Filter: (c = 0)
-> Hash Full Join
@@ -1080,12 +1143,14 @@ SELECT t1.a, t1.phv, t2.b, t2.phv, t3.a + t3.b, t3.phv FROM ((SELECT 50 phv, * F
-> Seq Scan on prt1_p3 prt1_3
Filter: (b = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p3 prt2_3
Filter: (a = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_e_p3 prt1_e_3
Filter: (c = 0)
-(42 rows)
+(48 rows)
SELECT t1.a, t1.phv, t2.b, t2.phv, t3.a + t3.b, t3.phv FROM ((SELECT 50 phv, * FROM prt1 WHERE prt1.b = 0) t1 FULL JOIN (SELECT 75 phv, * FROM prt2 WHERE prt2.a = 0) t2 ON (t1.a = t2.b)) FULL JOIN (SELECT 50 phv, * FROM prt1_e WHERE prt1_e.c = 0) t3 ON (t1.a = (t3.a + t3.b)/2) WHERE t1.a = t1.phv OR t2.b = t2.phv OR (t3.a + t3.b)/2 = t3.phv ORDER BY t1.a, t2.b, t3.a + t3.b;
a | phv | b | phv | ?column? | phv
@@ -1110,6 +1175,7 @@ SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t1.b FROM prt2 t1, prt1_e t2 WHER
Hash Cond: (((t2_1.a + t2_1.b) / 2) = t1_5.b)
-> Seq Scan on prt1_e_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p1 t1_5
Filter: (a = 0)
-> Index Scan using iprt1_p1_a on prt1_p1 t1_2
@@ -1123,6 +1189,7 @@ SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t1.b FROM prt2 t1, prt1_e t2 WHER
Hash Cond: (((t2_2.a + t2_2.b) / 2) = t1_6.b)
-> Seq Scan on prt1_e_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p2 t1_6
Filter: (a = 0)
-> Index Scan using iprt1_p2_a on prt1_p2 t1_3
@@ -1140,7 +1207,7 @@ SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t1.b FROM prt2 t1, prt1_e t2 WHER
-> Index Scan using iprt1_p3_a on prt1_p3 t1_4
Index Cond: (a = ((t2_3.a + t2_3.b) / 2))
Filter: (b = 0)
-(41 rows)
+(43 rows)
SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t1.b FROM prt2 t1, prt1_e t2 WHERE t1.a = 0 AND t1.b = (t2.a + t2.b)/2) AND t1.b = 0 ORDER BY t1.a;
a | b | c
@@ -1165,6 +1232,7 @@ SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t1.b FROM prt2 t1 WHERE t1.b IN (
Hash Cond: (t1_6.b = ((t1_9.a + t1_9.b) / 2))
-> Seq Scan on prt2_p1 t1_6
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_e_p1 t1_9
Filter: (c = 0)
-> Index Scan using iprt1_p1_a on prt1_p1 t1_3
@@ -1177,6 +1245,7 @@ SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t1.b FROM prt2 t1 WHERE t1.b IN (
Hash Cond: (t1_7.b = ((t1_10.a + t1_10.b) / 2))
-> Seq Scan on prt2_p2 t1_7
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_e_p2 t1_10
Filter: (c = 0)
-> Index Scan using iprt1_p2_a on prt1_p2 t1_4
@@ -1189,12 +1258,13 @@ SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t1.b FROM prt2 t1 WHERE t1.b IN (
Hash Cond: (t1_8.b = ((t1_11.a + t1_11.b) / 2))
-> Seq Scan on prt2_p3 t1_8
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_e_p3 t1_11
Filter: (c = 0)
-> Index Scan using iprt1_p3_a on prt1_p3 t1_5
Index Cond: (a = t1_8.b)
Filter: (b = 0)
-(39 rows)
+(42 rows)
SELECT t1.* FROM prt1 t1 WHERE t1.a IN (SELECT t1.b FROM prt2 t1 WHERE t1.b IN (SELECT (t1.a + t1.b)/2 FROM prt1_e t1 WHERE t1.c = 0)) AND t1.b = 0 ORDER BY t1.a;
a | b | c
@@ -1448,6 +1518,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1_m WHERE prt1_m.c = 0) t1
-> Seq Scan on prt1_m_p1 prt1_m_1
Filter: (c = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_m_p1 prt2_m_1
Filter: (c = 0)
-> Hash Full Join
@@ -1455,6 +1526,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1_m WHERE prt1_m.c = 0) t1
-> Seq Scan on prt1_m_p2 prt1_m_2
Filter: (c = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_m_p2 prt2_m_2
Filter: (c = 0)
-> Hash Full Join
@@ -1462,9 +1534,10 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1_m WHERE prt1_m.c = 0) t1
-> Seq Scan on prt1_m_p3 prt1_m_3
Filter: (c = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_m_p3 prt2_m_3
Filter: (c = 0)
-(24 rows)
+(27 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1_m WHERE prt1_m.c = 0) t1 FULL JOIN (SELECT * FROM prt2_m WHERE prt2_m.c = 0) t2 ON (t1.a = (t2.b + t2.a)/2 AND t2.b = (t1.a + t1.b)/2) ORDER BY t1.a, t2.b;
a | c | b | c
@@ -1527,8 +1600,10 @@ SELECT avg(t1.a), avg(t2.b), avg(t3.a + t3.b), t1.c, t2.c, t3.c FROM plt1 t1, pl
Hash Cond: ((t1_1.b = t2_1.b) AND (t1_1.c = t2_1.c))
-> Seq Scan on plt1_p1 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt2_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_e_p1 t3_1
-> Hash Join
Hash Cond: (t1_2.c = ltrim(t3_2.c, 'A'::text))
@@ -1536,8 +1611,10 @@ SELECT avg(t1.a), avg(t2.b), avg(t3.a + t3.b), t1.c, t2.c, t3.c FROM plt1 t1, pl
Hash Cond: ((t1_2.b = t2_2.b) AND (t1_2.c = t2_2.c))
-> Seq Scan on plt1_p2 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt2_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_e_p2 t3_2
-> Hash Join
Hash Cond: (t1_3.c = ltrim(t3_3.c, 'A'::text))
@@ -1545,10 +1622,12 @@ SELECT avg(t1.a), avg(t2.b), avg(t3.a + t3.b), t1.c, t2.c, t3.c FROM plt1 t1, pl
Hash Cond: ((t1_3.b = t2_3.b) AND (t1_3.c = t2_3.c))
-> Seq Scan on plt1_p3 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt2_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_e_p3 t3_3
-(32 rows)
+(38 rows)
SELECT avg(t1.a), avg(t2.b), avg(t3.a + t3.b), t1.c, t2.c, t3.c FROM plt1 t1, plt2 t2, plt1_e t3 WHERE t1.b = t2.b AND t1.c = t2.c AND ltrim(t3.c, 'A') = t1.c GROUP BY t1.c, t2.c, t3.c ORDER BY t1.c, t2.c, t3.c;
avg | avg | avg | c | c | c
@@ -1595,21 +1674,25 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1 WHERE a = 1 AND a = 2) t1
Hash Cond: (t3_1.a = t2_1.b)
-> Seq Scan on prt1_p1 t3_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p1 t2_1
-> Hash Join
Hash Cond: (t3_2.a = t2_2.b)
-> Seq Scan on prt1_p2 t3_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p2 t2_2
-> Hash Join
Hash Cond: (t3_3.a = t2_3.b)
-> Seq Scan on prt1_p3 t3_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Result
One-Time Filter: false
-(21 rows)
+(25 rows)
EXPLAIN (COSTS OFF)
SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1 WHERE a = 1 AND a = 2) t1 FULL JOIN prt2 t2 ON t1.a = t2.b WHERE t2.a = 0 ORDER BY t1.a, t2.b;
@@ -1627,9 +1710,10 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1 WHERE a = 1 AND a = 2) t1
-> Seq Scan on prt2_p3 t2_3
Filter: (a = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Result
One-Time Filter: false
-(14 rows)
+(15 rows)
--
-- tests for hash partitioned tables.
@@ -1671,8 +1755,10 @@ SELECT avg(t1.a), avg(t2.b), avg(t3.a + t3.b), t1.c, t2.c, t3.c FROM pht1 t1, ph
Hash Cond: ((t1_1.b = t2_1.b) AND (t1_1.c = t2_1.c))
-> Seq Scan on pht1_p1 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pht2_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pht1_e_p1 t3_1
-> Hash Join
Hash Cond: (t1_2.c = ltrim(t3_2.c, 'A'::text))
@@ -1680,8 +1766,10 @@ SELECT avg(t1.a), avg(t2.b), avg(t3.a + t3.b), t1.c, t2.c, t3.c FROM pht1 t1, ph
Hash Cond: ((t1_2.b = t2_2.b) AND (t1_2.c = t2_2.c))
-> Seq Scan on pht1_p2 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pht2_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pht1_e_p2 t3_2
-> Hash Join
Hash Cond: (t1_3.c = ltrim(t3_3.c, 'A'::text))
@@ -1689,10 +1777,12 @@ SELECT avg(t1.a), avg(t2.b), avg(t3.a + t3.b), t1.c, t2.c, t3.c FROM pht1 t1, ph
Hash Cond: ((t1_3.b = t2_3.b) AND (t1_3.c = t2_3.c))
-> Seq Scan on pht1_p3 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pht2_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pht1_e_p3 t3_3
-(32 rows)
+(38 rows)
SELECT avg(t1.a), avg(t2.b), avg(t3.a + t3.b), t1.c, t2.c, t3.c FROM pht1 t1, pht2 t2, pht1_e t3 WHERE t1.b = t2.b AND t1.c = t2.c AND ltrim(t3.c, 'A') = t1.c GROUP BY t1.c, t2.c, t3.c ORDER BY t1.c, t2.c, t3.c;
avg | avg | avg | c | c | c
@@ -1723,21 +1813,24 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1, prt2 t2 WHERE t1.a = t2.b AND t1.b =
Hash Cond: (t2_1.b = t1_1.a)
-> Seq Scan on prt2_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p1 t1_1
Filter: (b = 0)
-> Hash Join
Hash Cond: (t2_2.b = t1_2.a)
-> Seq Scan on prt2_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p2 t1_2
Filter: (b = 0)
-> Hash Join
Hash Cond: (t2_3.b = t1_3.a)
-> Seq Scan on prt2_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_p3 t1_3
Filter: (b = 0)
-(21 rows)
+(24 rows)
-- test default partition behavior for list
ALTER TABLE plt1 DETACH PARTITION plt1_p3;
@@ -1759,21 +1852,24 @@ SELECT avg(t1.a), avg(t2.b), t1.c, t2.c FROM plt1 t1 RIGHT JOIN plt2 t2 ON t1.c
Hash Cond: (t2_1.c = t1_1.c)
-> Seq Scan on plt2_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_p1 t1_1
Filter: ((a % 25) = 0)
-> Hash Join
Hash Cond: (t2_2.c = t1_2.c)
-> Seq Scan on plt2_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_p2 t1_2
Filter: ((a % 25) = 0)
-> Hash Join
Hash Cond: (t2_3.c = t1_3.c)
-> Seq Scan on plt2_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_p3 t1_3
Filter: ((a % 25) = 0)
-(23 rows)
+(26 rows)
--
-- multiple levels of partitioning
@@ -1810,6 +1906,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1, prt2_l t2 WHERE t1.a = t2.b AND t1
Hash Cond: (t2_1.b = t1_1.a)
-> Seq Scan on prt2_l_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_l_p1 t1_1
Filter: (b = 0)
-> Hash Join
@@ -1818,6 +1915,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1, prt2_l t2 WHERE t1.a = t2.b AND t1
-> Seq Scan on prt2_l_p2_p1 t2_3
-> Seq Scan on prt2_l_p2_p2 t2_4
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_l_p2_p1 t1_3
Filter: (b = 0)
@@ -1829,9 +1927,10 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1, prt2_l t2 WHERE t1.a = t2.b AND t1
-> Seq Scan on prt2_l_p3_p1 t2_6
-> Seq Scan on prt2_l_p3_p2 t2_7
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_l_p3_p1 t1_5
Filter: (b = 0)
-(28 rows)
+(31 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1, prt2_l t2 WHERE t1.a = t2.b AND t1.b = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -1854,18 +1953,21 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1, prt2_l t2 WHERE t1.a = t2.a AND t1
Hash Cond: ((t1_1.a = t2_1.a) AND ((t1_1.c)::text = (t2_1.c)::text))
-> Seq Scan on prt1_l_p1 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_l_p1 t2_1
Filter: (a = b)
-> Hash Join
Hash Cond: ((t1_2.a = t2_2.a) AND ((t1_2.c)::text = (t2_2.c)::text))
-> Seq Scan on prt1_l_p2_p1 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_l_p2_p1 t2_2
Filter: (a = b)
-> Hash Join
Hash Cond: ((t1_3.a = t2_3.a) AND ((t1_3.c)::text = (t2_3.c)::text))
-> Seq Scan on prt1_l_p2_p2 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_l_p2_p2 t2_3
Filter: (a = b)
-> Hash Join
@@ -1874,12 +1976,13 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1, prt2_l t2 WHERE t1.a = t2.a AND t1
-> Seq Scan on prt1_l_p3_p1 t1_5
-> Seq Scan on prt1_l_p3_p2 t1_6
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt2_l_p3_p1 t2_5
Filter: (a = b)
-> Seq Scan on prt2_l_p3_p2 t2_6
Filter: (a = b)
-(32 rows)
+(36 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1, prt2_l t2 WHERE t1.a = t2.a AND t1.a = t2.b AND t1.c = t2.c ORDER BY t1.a, t2.b;
a | c | b | c
@@ -1903,18 +2006,21 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1 LEFT JOIN prt2_l t2 ON t1.a = t2.b
Hash Cond: ((t2_1.b = t1_1.a) AND ((t2_1.c)::text = (t1_1.c)::text))
-> Seq Scan on prt2_l_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_l_p1 t1_1
Filter: (b = 0)
-> Hash Right Join
Hash Cond: ((t2_2.b = t1_2.a) AND ((t2_2.c)::text = (t1_2.c)::text))
-> Seq Scan on prt2_l_p2_p1 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_l_p2_p1 t1_2
Filter: (b = 0)
-> Hash Right Join
Hash Cond: ((t2_3.b = t1_3.a) AND ((t2_3.c)::text = (t1_3.c)::text))
-> Seq Scan on prt2_l_p2_p2 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_l_p2_p2 t1_3
Filter: (b = 0)
-> Hash Right Join
@@ -1923,9 +2029,10 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1 LEFT JOIN prt2_l t2 ON t1.a = t2.b
-> Seq Scan on prt2_l_p3_p1 t2_5
-> Seq Scan on prt2_l_p3_p2 t2_6
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_l_p3_p1 t1_4
Filter: (b = 0)
-(29 rows)
+(33 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1 LEFT JOIN prt2_l t2 ON t1.a = t2.b AND t1.c = t2.c WHERE t1.b = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -1956,18 +2063,21 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1 RIGHT JOIN prt2_l t2 ON t1.a = t2.b
Hash Cond: ((t1_1.a = t2_1.b) AND ((t1_1.c)::text = (t2_1.c)::text))
-> Seq Scan on prt1_l_p1 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_l_p1 t2_1
Filter: (a = 0)
-> Hash Right Join
Hash Cond: ((t1_2.a = t2_2.b) AND ((t1_2.c)::text = (t2_2.c)::text))
-> Seq Scan on prt1_l_p2_p1 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_l_p2_p1 t2_2
Filter: (a = 0)
-> Hash Right Join
Hash Cond: ((t1_3.a = t2_3.b) AND ((t1_3.c)::text = (t2_3.c)::text))
-> Seq Scan on prt1_l_p2_p2 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_l_p2_p2 t2_3
Filter: (a = 0)
-> Hash Right Join
@@ -1976,9 +2086,10 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1 RIGHT JOIN prt2_l t2 ON t1.a = t2.b
-> Seq Scan on prt1_l_p3_p1 t1_5
-> Seq Scan on prt1_l_p3_p2 t1_6
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_l_p3_p1 t2_4
Filter: (a = 0)
-(29 rows)
+(33 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_l t1 RIGHT JOIN prt2_l t2 ON t1.a = t2.b AND t1.c = t2.c WHERE t2.a = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -2006,6 +2117,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1_l WHERE prt1_l.b = 0) t1
-> Seq Scan on prt1_l_p1 prt1_l_1
Filter: (b = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_l_p1 prt2_l_1
Filter: (a = 0)
-> Hash Full Join
@@ -2013,6 +2125,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1_l WHERE prt1_l.b = 0) t1
-> Seq Scan on prt1_l_p2_p1 prt1_l_2
Filter: (b = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_l_p2_p1 prt2_l_2
Filter: (a = 0)
-> Hash Full Join
@@ -2020,6 +2133,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1_l WHERE prt1_l.b = 0) t1
-> Seq Scan on prt1_l_p2_p2 prt1_l_3
Filter: (b = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_l_p2_p2 prt2_l_3
Filter: (a = 0)
-> Hash Full Join
@@ -2027,9 +2141,10 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1_l WHERE prt1_l.b = 0) t1
-> Seq Scan on prt1_l_p3_p1 prt1_l_4
Filter: (b = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_l_p3_p1 prt2_l_4
Filter: (a = 0)
-(31 rows)
+(35 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1_l WHERE prt1_l.b = 0) t1 FULL JOIN (SELECT * FROM prt2_l WHERE prt2_l.a = 0) t2 ON (t1.a = t2.b AND t1.c = t2.c) ORDER BY t1.a, t2.b;
a | c | b | c
@@ -2069,6 +2184,7 @@ SELECT * FROM prt1_l t1 LEFT JOIN LATERAL
Hash Cond: ((t3_1.b = t2_1.a) AND ((t3_1.c)::text = (t2_1.c)::text))
-> Seq Scan on prt2_l_p1 t3_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_l_p1 t2_1
Filter: ((t1_1.a = a) AND ((t1_1.c)::text = (c)::text))
-> Nested Loop Left Join
@@ -2078,6 +2194,7 @@ SELECT * FROM prt1_l t1 LEFT JOIN LATERAL
Hash Cond: ((t3_2.b = t2_2.a) AND ((t3_2.c)::text = (t2_2.c)::text))
-> Seq Scan on prt2_l_p2_p1 t3_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_l_p2_p1 t2_2
Filter: ((t1_2.a = a) AND ((t1_2.c)::text = (c)::text))
-> Nested Loop Left Join
@@ -2087,6 +2204,7 @@ SELECT * FROM prt1_l t1 LEFT JOIN LATERAL
Hash Cond: ((t3_3.b = t2_3.a) AND ((t3_3.c)::text = (t2_3.c)::text))
-> Seq Scan on prt2_l_p2_p2 t3_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_l_p2_p2 t2_3
Filter: ((t1_3.a = a) AND ((t1_3.c)::text = (c)::text))
-> Nested Loop Left Join
@@ -2098,12 +2216,13 @@ SELECT * FROM prt1_l t1 LEFT JOIN LATERAL
-> Seq Scan on prt2_l_p3_p1 t3_5
-> Seq Scan on prt2_l_p3_p2 t3_6
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_l_p3_p1 t2_5
Filter: ((t1_4.a = a) AND ((t1_4.c)::text = (c)::text))
-> Seq Scan on prt1_l_p3_p2 t2_6
Filter: ((t1_4.a = a) AND ((t1_4.c)::text = (c)::text))
-(44 rows)
+(48 rows)
SELECT * FROM prt1_l t1 LEFT JOIN LATERAL
(SELECT t2.a AS t2a, t2.c AS t2c, t2.b AS t2b, t3.b AS t3b, least(t1.a,t2.a,t3.b) FROM prt1_l t2 JOIN prt2_l t3 ON (t2.a = t3.b AND t2.c = t3.c)) ss
@@ -2214,9 +2333,10 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT * FROM prt1_l WHERE a = 1 AND a = 2)
-> Seq Scan on prt2_l_p3_p1 t2_4
-> Seq Scan on prt2_l_p3_p2 t2_5
-> Hash
+ Buckets: 1024 Batches: 1
-> Result
One-Time Filter: false
-(11 rows)
+(12 rows)
-- Test case to verify proper handling of subqueries in a partitioned delete.
-- The weird-looking lateral join is just there to force creation of a
@@ -2288,11 +2408,12 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1, prt4_n t2 WHERE t1.a = t2.a;
-> Seq Scan on prt1_p2 t1_2
-> Seq Scan on prt1_p3 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt4_n_p1 t2_1
-> Seq Scan on prt4_n_p2 t2_2
-> Seq Scan on prt4_n_p3 t2_3
-(11 rows)
+(12 rows)
EXPLAIN (COSTS OFF)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1, prt4_n t2, prt2 t3 WHERE t1.a = t2.a and t1.a = t3.b;
@@ -2305,23 +2426,27 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1 t1, prt4_n t2, prt2 t3 WHERE t1.a = t2.a
-> Seq Scan on prt4_n_p2 t2_2
-> Seq Scan on prt4_n_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Hash Join
Hash Cond: (t1_1.a = t3_1.b)
-> Seq Scan on prt1_p1 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p1 t3_1
-> Hash Join
Hash Cond: (t1_2.a = t3_2.b)
-> Seq Scan on prt1_p2 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p2 t3_2
-> Hash Join
Hash Cond: (t1_3.a = t3_3.b)
-> Seq Scan on prt1_p3 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_p3 t3_3
-(23 rows)
+(27 rows)
-- partitionwise join can not be applied if there are no equi-join conditions
-- between partition keys
@@ -2356,11 +2481,12 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_m t1, prt2_m t2 WHERE t1.a = (t2.b + t2.
-> Seq Scan on prt2_m_p2 t2_2
-> Seq Scan on prt2_m_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_m_p1 t1_1
-> Seq Scan on prt1_m_p2 t1_2
-> Seq Scan on prt1_m_p3 t1_3
-(11 rows)
+(12 rows)
-- equi-join between out-of-order partition key columns does not qualify for
-- partitionwise join
@@ -2375,11 +2501,12 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_m t1 LEFT JOIN prt2_m t2 ON t1.a = t2.b;
-> Seq Scan on prt1_m_p2 t1_2
-> Seq Scan on prt1_m_p3 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt2_m_p1 t2_1
-> Seq Scan on prt2_m_p2 t2_2
-> Seq Scan on prt2_m_p3 t2_3
-(11 rows)
+(12 rows)
-- equi-join between non-key columns does not qualify for partitionwise join
EXPLAIN (COSTS OFF)
@@ -2393,11 +2520,12 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_m t1 LEFT JOIN prt2_m t2 ON t1.c = t2.c;
-> Seq Scan on prt1_m_p2 t1_2
-> Seq Scan on prt1_m_p3 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt2_m_p1 t2_1
-> Seq Scan on prt2_m_p2 t2_2
-> Seq Scan on prt2_m_p3 t2_3
-(11 rows)
+(12 rows)
-- partitionwise join can not be applied for a join between list and range
-- partitioned tables
@@ -2411,10 +2539,11 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_n t1 LEFT JOIN prt2_n t2 ON (t1.c = t2.c
-> Seq Scan on prt2_n_p1 t2_1
-> Seq Scan on prt2_n_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_n_p1 t1_1
-> Seq Scan on prt1_n_p2 t1_2
-(9 rows)
+(10 rows)
-- partitionwise join can not be applied between tables with different
-- partition lists
@@ -2428,6 +2557,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_n t1 JOIN prt2_n t2 ON (t1.c = t2.c) JOI
-> Seq Scan on prt2_n_p1 t2_1
-> Seq Scan on prt2_n_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Hash Join
Hash Cond: (t3.c = (t1.c)::text)
-> Append
@@ -2435,10 +2565,11 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_n t1 JOIN prt2_n t2 ON (t1.c = t2.c) JOI
-> Seq Scan on plt1_p2 t3_2
-> Seq Scan on plt1_p3 t3_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_n_p1 t1_1
-> Seq Scan on prt1_n_p2 t1_2
-(16 rows)
+(18 rows)
-- partitionwise join can not be applied for a join between key column and
-- non-key column
@@ -2453,10 +2584,11 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_n t1 FULL JOIN prt1 t2 ON (t1.c = t2.c);
-> Seq Scan on prt1_p2 t2_2
-> Seq Scan on prt1_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_n_p1 t1_1
-> Seq Scan on prt1_n_p2 t1_2
-(10 rows)
+(11 rows)
--
-- Test some other plan types in a partitionwise join (unfortunately,
@@ -2594,21 +2726,24 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a =
Hash Cond: (t2_1.b = t1_1.a)
-> Seq Scan on prt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p1 t1_1
Filter: (b = 0)
-> Hash Join
Hash Cond: (t2_2.b = t1_2.a)
-> Seq Scan on prt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p2 t1_2
Filter: (b = 0)
-> Hash Join
Hash Cond: (t2_3.b = t1_3.a)
-> Seq Scan on prt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p3 t1_3
Filter: (b = 0)
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a = t2.b) WHERE t1.b = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -2635,21 +2770,24 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a
Hash Cond: (t2_1.b = t1_1.a)
-> Seq Scan on prt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p1 t1_1
Filter: (b = 0)
-> Hash Right Semi Join
Hash Cond: (t2_2.b = t1_2.a)
-> Seq Scan on prt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p2 t1_2
Filter: (b = 0)
-> Hash Right Semi Join
Hash Cond: (t2_3.b = t1_3.a)
-> Seq Scan on prt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p3 t1_3
Filter: (b = 0)
-(21 rows)
+(24 rows)
SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a = t2.b) AND t1.b = 0 ORDER BY t1.a;
a | b | c
@@ -2676,21 +2814,24 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 LEFT JOIN prt2_adv t2 ON (t1.a =
Hash Cond: (t2_1.b = t1_1.a)
-> Seq Scan on prt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p1 t1_1
Filter: (b = 0)
-> Hash Right Join
Hash Cond: (t2_2.b = t1_2.a)
-> Seq Scan on prt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p2 t1_2
Filter: (b = 0)
-> Hash Right Join
Hash Cond: (t2_3.b = t1_3.a)
-> Seq Scan on prt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p3 t1_3
Filter: (b = 0)
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 LEFT JOIN prt2_adv t2 ON (t1.a = t2.b) WHERE t1.b = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -2721,21 +2862,24 @@ SELECT t1.* FROM prt1_adv t1 WHERE NOT EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t
Hash Cond: (t2_1.b = t1_1.a)
-> Seq Scan on prt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p1 t1_1
Filter: (b = 0)
-> Hash Right Anti Join
Hash Cond: (t2_2.b = t1_2.a)
-> Seq Scan on prt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p2 t1_2
Filter: (b = 0)
-> Hash Right Anti Join
Hash Cond: (t2_3.b = t1_3.a)
-> Seq Scan on prt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p3 t1_3
Filter: (b = 0)
-(21 rows)
+(24 rows)
SELECT t1.* FROM prt1_adv t1 WHERE NOT EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a = t2.b) AND t1.b = 0 ORDER BY t1.a;
a | b | c
@@ -2760,6 +2904,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT 175 phv, * FROM prt1_adv WHERE prt1_a
-> Seq Scan on prt1_adv_p1 prt1_adv_1
Filter: (b = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_adv_p1 prt2_adv_1
Filter: (a = 0)
-> Hash Full Join
@@ -2768,6 +2913,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT 175 phv, * FROM prt1_adv WHERE prt1_a
-> Seq Scan on prt1_adv_p2 prt1_adv_2
Filter: (b = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_adv_p2 prt2_adv_2
Filter: (a = 0)
-> Hash Full Join
@@ -2776,9 +2922,10 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT 175 phv, * FROM prt1_adv WHERE prt1_a
-> Seq Scan on prt2_adv_p3 prt2_adv_3
Filter: (a = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p3 prt1_adv_3
Filter: (b = 0)
-(27 rows)
+(30 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT 175 phv, * FROM prt1_adv WHERE prt1_adv.b = 0) t1 FULL JOIN (SELECT 425 phv, * FROM prt2_adv WHERE prt2_adv.a = 0) t2 ON (t1.a = t2.b) WHERE t1.phv = t1.a OR t2.phv = t2.b ORDER BY t1.a, t2.b;
a | c | b | c
@@ -2803,21 +2950,24 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a =
Hash Cond: (t2_1.b = t1_1.a)
-> Seq Scan on prt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p1 t1_1
Filter: (b = 0)
-> Hash Join
Hash Cond: (t2_2.b = t1_2.a)
-> Seq Scan on prt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p2 t1_2
Filter: (b = 0)
-> Hash Join
Hash Cond: (t2_3.b = t1_3.a)
-> Seq Scan on prt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p3 t1_3
Filter: (b = 0)
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a = t2.b) WHERE t1.b = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -2844,21 +2994,24 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a
Hash Cond: (t2_1.b = t1_1.a)
-> Seq Scan on prt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p1 t1_1
Filter: (b = 0)
-> Hash Right Semi Join
Hash Cond: (t2_2.b = t1_2.a)
-> Seq Scan on prt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p2 t1_2
Filter: (b = 0)
-> Hash Right Semi Join
Hash Cond: (t2_3.b = t1_3.a)
-> Seq Scan on prt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p3 t1_3
Filter: (b = 0)
-(21 rows)
+(24 rows)
SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a = t2.b) AND t1.b = 0 ORDER BY t1.a;
a | b | c
@@ -2885,21 +3038,24 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 LEFT JOIN prt2_adv t2 ON (t1.a =
Hash Cond: (t2_1.b = t1_1.a)
-> Seq Scan on prt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p1 t1_1
Filter: (b = 0)
-> Hash Right Join
Hash Cond: (t2_2.b = t1_2.a)
-> Seq Scan on prt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p2 t1_2
Filter: (b = 0)
-> Hash Right Join
Hash Cond: (t2_3.b = t1_3.a)
-> Seq Scan on prt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p3 t1_3
Filter: (b = 0)
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 LEFT JOIN prt2_adv t2 ON (t1.a = t2.b) WHERE t1.b = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -2933,6 +3089,7 @@ SELECT t1.b, t1.c, t2.a, t2.c FROM prt2_adv t1 LEFT JOIN prt1_adv t2 ON (t1.b =
-> Seq Scan on prt1_adv_p2 t2_2
-> Seq Scan on prt1_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt2_adv_p1 t1_1
Filter: (a = 0)
@@ -2942,7 +3099,7 @@ SELECT t1.b, t1.c, t2.a, t2.c FROM prt2_adv t1 LEFT JOIN prt1_adv t2 ON (t1.b =
Filter: (a = 0)
-> Seq Scan on prt2_adv_extra t1_4
Filter: (a = 0)
-(18 rows)
+(19 rows)
-- anti join
EXPLAIN (COSTS OFF)
@@ -2956,21 +3113,24 @@ SELECT t1.* FROM prt1_adv t1 WHERE NOT EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t
Hash Cond: (t2_1.b = t1_1.a)
-> Seq Scan on prt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p1 t1_1
Filter: (b = 0)
-> Hash Right Anti Join
Hash Cond: (t2_2.b = t1_2.a)
-> Seq Scan on prt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p2 t1_2
Filter: (b = 0)
-> Hash Right Anti Join
Hash Cond: (t2_3.b = t1_3.a)
-> Seq Scan on prt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p3 t1_3
Filter: (b = 0)
-(21 rows)
+(24 rows)
SELECT t1.* FROM prt1_adv t1 WHERE NOT EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a = t2.b) AND t1.b = 0 ORDER BY t1.a;
a | b | c
@@ -2996,6 +3156,7 @@ SELECT t1.* FROM prt2_adv t1 WHERE NOT EXISTS (SELECT 1 FROM prt1_adv t2 WHERE t
-> Seq Scan on prt1_adv_p2 t2_2
-> Seq Scan on prt1_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt2_adv_p1 t1_1
Filter: (a = 0)
@@ -3005,7 +3166,7 @@ SELECT t1.* FROM prt2_adv t1 WHERE NOT EXISTS (SELECT 1 FROM prt1_adv t2 WHERE t
Filter: (a = 0)
-> Seq Scan on prt2_adv_extra t1_4
Filter: (a = 0)
-(18 rows)
+(19 rows)
-- full join; currently we can't do partitioned join if there are no matched
-- partitions on the nullable side
@@ -3028,6 +3189,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT 175 phv, * FROM prt1_adv WHERE prt1_a
-> Seq Scan on prt2_adv_extra prt2_adv_4
Filter: (a = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_adv_p1 prt1_adv_1
Filter: (b = 0)
@@ -3035,7 +3197,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT 175 phv, * FROM prt1_adv WHERE prt1_a
Filter: (b = 0)
-> Seq Scan on prt1_adv_p3 prt1_adv_3
Filter: (b = 0)
-(22 rows)
+(23 rows)
-- 3-way join where not every pair of relations can do partitioned join
EXPLAIN (COSTS OFF)
@@ -3057,23 +3219,27 @@ SELECT t1.b, t1.c, t2.a, t2.c, t3.a, t3.c FROM prt2_adv t1 LEFT JOIN prt1_adv t2
Hash Cond: (t2_2.a = t1_2.b)
-> Seq Scan on prt1_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Hash Join
Hash Cond: (t3_2.a = t1_2.b)
-> Seq Scan on prt1_adv_p2 t3_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_adv_p2 t1_2
Filter: (a = 0)
-> Hash Right Join
Hash Cond: (t2_3.a = t1_3.b)
-> Seq Scan on prt1_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Hash Join
Hash Cond: (t3_3.a = t1_3.b)
-> Seq Scan on prt1_adv_p3 t3_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt2_adv_p3 t1_3
Filter: (a = 0)
-(31 rows)
+(35 rows)
SELECT t1.b, t1.c, t2.a, t2.c, t3.a, t3.c FROM prt2_adv t1 LEFT JOIN prt1_adv t2 ON (t1.b = t2.a) INNER JOIN prt1_adv t3 ON (t1.b = t3.a) WHERE t1.a = 0 ORDER BY t1.b, t2.a, t3.a;
b | c | a | c | a | c
@@ -3112,6 +3278,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a =
-> Seq Scan on prt2_adv_p3_1 t2_3
-> Seq Scan on prt2_adv_p3_2 t2_4
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_adv_p1 t1_1
Filter: (b = 0)
@@ -3119,7 +3286,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a =
Filter: (b = 0)
-> Seq Scan on prt1_adv_p3 t1_3
Filter: (b = 0)
-(17 rows)
+(18 rows)
-- semi join
EXPLAIN (COSTS OFF)
@@ -3136,6 +3303,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a
-> Seq Scan on prt2_adv_p3_1 t2_3
-> Seq Scan on prt2_adv_p3_2 t2_4
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_adv_p1 t1_1
Filter: (b = 0)
@@ -3143,7 +3311,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a
Filter: (b = 0)
-> Seq Scan on prt1_adv_p3 t1_3
Filter: (b = 0)
-(17 rows)
+(18 rows)
-- left join
EXPLAIN (COSTS OFF)
@@ -3160,6 +3328,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 LEFT JOIN prt2_adv t2 ON (t1.a =
-> Seq Scan on prt2_adv_p3_1 t2_3
-> Seq Scan on prt2_adv_p3_2 t2_4
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_adv_p1 t1_1
Filter: (b = 0)
@@ -3167,7 +3336,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 LEFT JOIN prt2_adv t2 ON (t1.a =
Filter: (b = 0)
-> Seq Scan on prt1_adv_p3 t1_3
Filter: (b = 0)
-(17 rows)
+(18 rows)
-- anti join
EXPLAIN (COSTS OFF)
@@ -3184,6 +3353,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE NOT EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t
-> Seq Scan on prt2_adv_p3_1 t2_3
-> Seq Scan on prt2_adv_p3_2 t2_4
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_adv_p1 t1_1
Filter: (b = 0)
@@ -3191,7 +3361,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE NOT EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t
Filter: (b = 0)
-> Seq Scan on prt1_adv_p3 t1_3
Filter: (b = 0)
-(17 rows)
+(18 rows)
-- full join
EXPLAIN (COSTS OFF)
@@ -3213,6 +3383,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT 175 phv, * FROM prt1_adv WHERE prt1_a
-> Seq Scan on prt2_adv_p3_2 prt2_adv_4
Filter: (a = 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_adv_p1 prt1_adv_1
Filter: (b = 0)
@@ -3220,7 +3391,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM (SELECT 175 phv, * FROM prt1_adv WHERE prt1_a
Filter: (b = 0)
-> Seq Scan on prt1_adv_p3 prt1_adv_3
Filter: (b = 0)
-(22 rows)
+(23 rows)
DROP TABLE prt2_adv_p3_1;
DROP TABLE prt2_adv_p3_2;
@@ -3244,15 +3415,17 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a =
Hash Cond: (t2_1.b = t1_2.a)
-> Seq Scan on prt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p1 t1_2
Filter: (b = 0)
-> Hash Join
Hash Cond: (t2_2.b = t1_1.a)
-> Seq Scan on prt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p2 t1_1
Filter: (b = 0)
-(15 rows)
+(17 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a = t2.b) WHERE t1.b = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -3286,6 +3459,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a =
-> Seq Scan on prt2_adv_p2 t2_2
-> Seq Scan on prt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_adv_p2 t1_1
Filter: (b = 0)
@@ -3293,7 +3467,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a =
Filter: (b = 0)
-> Seq Scan on prt1_adv_p1 t1_3
Filter: (b = 0)
-(16 rows)
+(17 rows)
ALTER TABLE prt2_adv DETACH PARTITION prt2_adv_p3;
-- Change prt2_adv_p3 to the default partition
@@ -3314,6 +3488,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a =
-> Seq Scan on prt2_adv_p2 t2_2
-> Seq Scan on prt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on prt1_adv_p2 t1_1
Filter: (b = 0)
@@ -3321,7 +3496,7 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a =
Filter: (b = 0)
-> Seq Scan on prt1_adv_p1 t1_3
Filter: (b = 0)
-(16 rows)
+(17 rows)
DROP TABLE prt1_adv_p3;
ANALYZE prt1_adv;
@@ -3345,23 +3520,27 @@ SELECT t1.a, t1.c, t2.b, t2.c, t3.a, t3.c FROM prt1_adv t1 LEFT JOIN prt2_adv t2
Hash Cond: (t3_1.a = t1_1.a)
-> Seq Scan on prt3_adv_p1 t3_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Hash Right Join
Hash Cond: (t2_2.b = t1_1.a)
-> Seq Scan on prt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p2 t1_1
Filter: (b = 0)
-> Hash Right Join
Hash Cond: (t3_2.a = t1_2.a)
-> Seq Scan on prt3_adv_p2 t3_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Hash Right Join
Hash Cond: (t2_1.b = t1_2.a)
-> Seq Scan on prt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p1 t1_2
Filter: (b = 0)
-(23 rows)
+(27 rows)
SELECT t1.a, t1.c, t2.b, t2.c, t3.a, t3.c FROM prt1_adv t1 LEFT JOIN prt2_adv t2 ON (t1.a = t2.b) LEFT JOIN prt3_adv t3 ON (t1.a = t3.a) WHERE t1.b = 0 ORDER BY t1.a, t2.b, t3.a;
a | c | b | c | a | c
@@ -3404,15 +3583,17 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a =
Hash Cond: (t2_1.b = t1_1.a)
-> Seq Scan on prt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p1 t1_1
Filter: ((a < 300) AND (b = 0))
-> Hash Join
Hash Cond: (t2_2.b = t1_2.a)
-> Seq Scan on prt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p2 t1_2
Filter: ((a < 300) AND (b = 0))
-(15 rows)
+(17 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a = t2.b) WHERE t1.a < 300 AND t1.b = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -3443,15 +3624,17 @@ SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a =
Hash Cond: (t2_1.b = t1_1.a)
-> Seq Scan on prt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p1 t1_1
Filter: ((a >= 100) AND (a < 300) AND (b = 0))
-> Hash Join
Hash Cond: (t2_2.b = t1_2.a)
-> Seq Scan on prt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on prt1_adv_p2 t1_2
Filter: ((a >= 100) AND (a < 300) AND (b = 0))
-(15 rows)
+(17 rows)
SELECT t1.a, t1.c, t2.b, t2.c FROM prt1_adv t1 INNER JOIN prt2_adv t2 ON (t1.a = t2.b) WHERE t1.a >= 100 AND t1.a < 300 AND t1.b = 0 ORDER BY t1.a, t2.b;
a | c | b | c
@@ -3493,21 +3676,24 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
-> Hash Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -3530,21 +3716,24 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
-> Hash Right Semi Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Right Semi Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(21 rows)
+(24 rows)
SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a = t2.a AND t1.c = t2.c) AND t1.b < 10 ORDER BY t1.a;
a | b | c
@@ -3567,21 +3756,24 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
-> Hash Right Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Right Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -3606,21 +3798,24 @@ SELECT t1.* FROM plt1_adv t1 WHERE NOT EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
-> Hash Right Anti Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Right Anti Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(21 rows)
+(24 rows)
SELECT t1.* FROM plt1_adv t1 WHERE NOT EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a = t2.a AND t1.c = t2.c) AND t1.b < 10 ORDER BY t1.a;
a | b | c
@@ -3642,20 +3837,23 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 FULL JOIN plt2_adv t2 ON (t1.a =
Filter: ((COALESCE(t1_1.b, 0) < 10) AND (COALESCE(t2_1.b, 0) < 10))
-> Seq Scan on plt1_adv_p1 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash Full Join
Hash Cond: ((t1_2.a = t2_2.a) AND (t1_2.c = t2_2.c))
Filter: ((COALESCE(t1_2.b, 0) < 10) AND (COALESCE(t2_2.b, 0) < 10))
-> Seq Scan on plt1_adv_p2 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash Full Join
Hash Cond: ((t1_3.a = t2_3.a) AND (t1_3.c = t2_3.c))
Filter: ((COALESCE(t1_3.b, 0) < 10) AND (COALESCE(t2_3.b, 0) < 10))
-> Seq Scan on plt1_adv_p3 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt2_adv_p3 t2_3
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 FULL JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE coalesce(t1.b, 0) < 10 AND coalesce(t2.b, 0) < 10 ORDER BY t1.a, t2.a;
a | c | a | c
@@ -3686,21 +3884,24 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
-> Hash Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -3723,21 +3924,24 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
-> Hash Right Semi Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Right Semi Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(21 rows)
+(24 rows)
SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a = t2.a AND t1.c = t2.c) AND t1.b < 10 ORDER BY t1.a;
a | b | c
@@ -3760,21 +3964,24 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
-> Hash Right Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Right Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -3802,6 +4009,7 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt2_adv t1 LEFT JOIN plt1_adv t2 ON (t1.a =
-> Seq Scan on plt1_adv_p2 t2_2
-> Seq Scan on plt1_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on plt2_adv_extra t1_1
Filter: (b < 10)
@@ -3811,7 +4019,7 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt2_adv t1 LEFT JOIN plt1_adv t2 ON (t1.a =
Filter: (b < 10)
-> Seq Scan on plt2_adv_p3 t1_4
Filter: (b < 10)
-(18 rows)
+(19 rows)
-- anti join
EXPLAIN (COSTS OFF)
@@ -3825,21 +4033,24 @@ SELECT t1.* FROM plt1_adv t1 WHERE NOT EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
-> Hash Right Anti Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Right Anti Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(21 rows)
+(24 rows)
SELECT t1.* FROM plt1_adv t1 WHERE NOT EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a = t2.a AND t1.c = t2.c) AND t1.b < 10 ORDER BY t1.a;
a | b | c
@@ -3863,6 +4074,7 @@ SELECT t1.* FROM plt2_adv t1 WHERE NOT EXISTS (SELECT 1 FROM plt1_adv t2 WHERE t
-> Seq Scan on plt1_adv_p2 t2_2
-> Seq Scan on plt1_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on plt2_adv_extra t1_1
Filter: (b < 10)
@@ -3872,7 +4084,7 @@ SELECT t1.* FROM plt2_adv t1 WHERE NOT EXISTS (SELECT 1 FROM plt1_adv t2 WHERE t
Filter: (b < 10)
-> Seq Scan on plt2_adv_p3 t1_4
Filter: (b < 10)
-(18 rows)
+(19 rows)
-- full join; currently we can't do partitioned join if there are no matched
-- partitions on the nullable side
@@ -3891,11 +4103,12 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 FULL JOIN plt2_adv t2 ON (t1.a =
-> Seq Scan on plt2_adv_p2 t2_3
-> Seq Scan on plt2_adv_p3 t2_4
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on plt1_adv_p1 t1_1
-> Seq Scan on plt1_adv_p2 t1_2
-> Seq Scan on plt1_adv_p3 t1_3
-(15 rows)
+(16 rows)
DROP TABLE plt2_adv_extra;
-- Test cases where a partition on one side matches multiple partitions on
@@ -3921,6 +4134,7 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a =
-> Seq Scan on plt2_adv_p2_2 t2_3
-> Seq Scan on plt2_adv_p3 t2_4
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
@@ -3928,7 +4142,7 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a =
Filter: (b < 10)
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(17 rows)
+(18 rows)
-- semi join
EXPLAIN (COSTS OFF)
@@ -3945,6 +4159,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a
-> Seq Scan on plt2_adv_p2_2 t2_3
-> Seq Scan on plt2_adv_p3 t2_4
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
@@ -3952,7 +4167,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a
Filter: (b < 10)
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(17 rows)
+(18 rows)
-- left join
EXPLAIN (COSTS OFF)
@@ -3969,6 +4184,7 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a =
-> Seq Scan on plt2_adv_p2_2 t2_3
-> Seq Scan on plt2_adv_p3 t2_4
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
@@ -3976,7 +4192,7 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a =
Filter: (b < 10)
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(17 rows)
+(18 rows)
-- anti join
EXPLAIN (COSTS OFF)
@@ -3993,6 +4209,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE NOT EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t
-> Seq Scan on plt2_adv_p2_2 t2_3
-> Seq Scan on plt2_adv_p3 t2_4
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
@@ -4000,7 +4217,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE NOT EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t
Filter: (b < 10)
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(17 rows)
+(18 rows)
-- full join
EXPLAIN (COSTS OFF)
@@ -4018,11 +4235,12 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 FULL JOIN plt2_adv t2 ON (t1.a =
-> Seq Scan on plt2_adv_p2_2 t2_3
-> Seq Scan on plt2_adv_p3 t2_4
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on plt1_adv_p1 t1_1
-> Seq Scan on plt1_adv_p2 t1_2
-> Seq Scan on plt1_adv_p3 t1_3
-(15 rows)
+(16 rows)
DROP TABLE plt2_adv_p2_1;
DROP TABLE plt2_adv_p2_2;
@@ -4053,21 +4271,24 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1_null t1_1
Filter: (b < 10)
-> Hash Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3_null t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -4090,21 +4311,24 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1_null t1_1
Filter: (b < 10)
-> Hash Right Semi Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Right Semi Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3_null t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(21 rows)
+(24 rows)
SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a = t2.a AND t1.c = t2.c) AND t1.b < 10 ORDER BY t1.a;
a | b | c
@@ -4127,21 +4351,24 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1_null t1_1
Filter: (b < 10)
-> Hash Right Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Right Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3_null t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -4167,21 +4394,24 @@ SELECT t1.* FROM plt1_adv t1 WHERE NOT EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1_null t1_1
Filter: (b < 10)
-> Hash Right Anti Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Right Anti Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3_null t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(21 rows)
+(24 rows)
SELECT t1.* FROM plt1_adv t1 WHERE NOT EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a = t2.a AND t1.c = t2.c) AND t1.b < 10 ORDER BY t1.a;
a | b | c
@@ -4204,20 +4434,23 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 FULL JOIN plt2_adv t2 ON (t1.a =
Filter: ((COALESCE(t1_1.b, 0) < 10) AND (COALESCE(t2_1.b, 0) < 10))
-> Seq Scan on plt1_adv_p1_null t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash Full Join
Hash Cond: ((t1_2.a = t2_2.a) AND (t1_2.c = t2_2.c))
Filter: ((COALESCE(t1_2.b, 0) < 10) AND (COALESCE(t2_2.b, 0) < 10))
-> Seq Scan on plt1_adv_p2 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash Full Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
Filter: ((COALESCE(t1_3.b, 0) < 10) AND (COALESCE(t2_3.b, 0) < 10))
-> Seq Scan on plt2_adv_p3_null t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 FULL JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE coalesce(t1.b, 0) < 10 AND coalesce(t2.b, 0) < 10 ORDER BY t1.a, t2.a;
a | c | a | c
@@ -4258,21 +4491,24 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
-> Hash Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -4298,6 +4534,7 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a =
-> Seq Scan on plt2_adv_p2 t2_2
-> Seq Scan on plt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
@@ -4307,7 +4544,7 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a =
Filter: (b < 10)
-> Seq Scan on plt1_adv_extra t1_4
Filter: (b < 10)
-(18 rows)
+(19 rows)
-- full join; currently we can't do partitioned join if there are no matched
-- partitions on the nullable side
@@ -4326,11 +4563,12 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 FULL JOIN plt2_adv t2 ON (t1.a =
-> Seq Scan on plt1_adv_p3 t1_3
-> Seq Scan on plt1_adv_extra t1_4
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on plt2_adv_p1 t2_1
-> Seq Scan on plt2_adv_p2 t2_2
-> Seq Scan on plt2_adv_p3 t2_3
-(15 rows)
+(16 rows)
-- Add to plt2_adv the extra NULL partition containing only NULL values as the
-- key values
@@ -4349,21 +4587,24 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
-> Hash Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-(21 rows)
+(24 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -4386,18 +4627,21 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
-> Hash Right Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Right Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-> Nested Loop Left Join
@@ -4405,7 +4649,7 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a =
-> Seq Scan on plt1_adv_extra t1_4
Filter: (b < 10)
-> Seq Scan on plt2_adv_extra t2_4
-(26 rows)
+(29 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -4432,26 +4676,30 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 FULL JOIN plt2_adv t2 ON (t1.a =
Filter: ((COALESCE(t1_1.b, 0) < 10) AND (COALESCE(t2_1.b, 0) < 10))
-> Seq Scan on plt1_adv_p1 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash Full Join
Hash Cond: ((t1_2.a = t2_2.a) AND (t1_2.c = t2_2.c))
Filter: ((COALESCE(t1_2.b, 0) < 10) AND (COALESCE(t2_2.b, 0) < 10))
-> Seq Scan on plt1_adv_p2 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash Full Join
Hash Cond: ((t1_3.a = t2_3.a) AND (t1_3.c = t2_3.c))
Filter: ((COALESCE(t1_3.b, 0) < 10) AND (COALESCE(t2_3.b, 0) < 10))
-> Seq Scan on plt1_adv_p3 t1_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt2_adv_p3 t2_3
-> Hash Full Join
Hash Cond: ((t1_4.a = t2_4.a) AND (t1_4.c = t2_4.c))
Filter: ((COALESCE(t1_4.b, 0) < 10) AND (COALESCE(t2_4.b, 0) < 10))
-> Seq Scan on plt1_adv_extra t1_4
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt2_adv_extra t2_4
-(27 rows)
+(31 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 FULL JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE coalesce(t1.b, 0) < 10 AND coalesce(t2.b, 0) < 10 ORDER BY t1.a, t2.a;
a | c | a | c
@@ -4480,30 +4728,36 @@ SELECT t1.a, t1.c, t2.a, t2.c, t3.a, t3.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2
Hash Cond: ((t3_1.a = t1_1.a) AND (t3_1.c = t1_1.c))
-> Seq Scan on plt1_adv_p1 t3_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Hash Right Join
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1 t1_1
Filter: (b < 10)
-> Hash Right Join
Hash Cond: ((t3_2.a = t1_2.a) AND (t3_2.c = t1_2.c))
-> Seq Scan on plt1_adv_p2 t3_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Hash Right Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_2
Filter: (b < 10)
-> Hash Right Join
Hash Cond: ((t3_3.a = t1_3.a) AND (t3_3.c = t1_3.c))
-> Seq Scan on plt1_adv_p3 t3_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Hash Right Join
Hash Cond: ((t2_3.a = t1_3.a) AND (t2_3.c = t1_3.c))
-> Seq Scan on plt2_adv_p3 t2_3
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_3
Filter: (b < 10)
-> Nested Loop Left Join
@@ -4514,7 +4768,7 @@ SELECT t1.a, t1.c, t2.a, t2.c, t3.a, t3.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2
Filter: (b < 10)
-> Seq Scan on plt2_adv_extra t2_4
-> Seq Scan on plt1_adv_extra t3_4
-(41 rows)
+(47 rows)
SELECT t1.a, t1.c, t2.a, t2.c, t3.a, t3.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) LEFT JOIN plt1_adv t3 ON (t1.a = t3.a AND t1.c = t3.c) WHERE t1.b < 10 ORDER BY t1.a;
a | c | a | c | a | c
@@ -4551,15 +4805,17 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2_1.a = t1_2.a) AND (t2_1.c = t1_2.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1 t1_2
Filter: (b < 10)
-> Hash Join
Hash Cond: ((t2_2.a = t1_1.a) AND (t2_2.c = t1_1.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_1
Filter: (b < 10)
-(15 rows)
+(17 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -4589,12 +4845,13 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a =
-> Seq Scan on plt2_adv_p1 t2_1
-> Seq Scan on plt2_adv_p2_ext t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on plt1_adv_p2 t1_1
Filter: (b < 10)
-> Seq Scan on plt1_adv_p1 t1_2
Filter: (b < 10)
-(13 rows)
+(14 rows)
ALTER TABLE plt2_adv DETACH PARTITION plt2_adv_p2_ext;
-- Change plt2_adv_p2_ext to the default partition
@@ -4614,12 +4871,13 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a =
-> Seq Scan on plt2_adv_p1 t2_1
-> Seq Scan on plt2_adv_p2_ext t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on plt1_adv_p2 t1_1
Filter: (b < 10)
-> Seq Scan on plt1_adv_p1 t1_2
Filter: (b < 10)
-(13 rows)
+(14 rows)
DROP TABLE plt2_adv_p2_ext;
-- Restore plt2_adv_p2
@@ -4642,23 +4900,27 @@ SELECT t1.a, t1.c, t2.a, t2.c, t3.a, t3.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2
Hash Cond: ((t3_1.a = t1_1.a) AND (t3_1.c = t1_1.c))
-> Seq Scan on plt3_adv_p1 t3_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Hash Right Join
Hash Cond: ((t2_2.a = t1_1.a) AND (t2_2.c = t1_1.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_1
Filter: (b < 10)
-> Hash Right Join
Hash Cond: ((t3_2.a = t1_2.a) AND (t3_2.c = t1_2.c))
-> Seq Scan on plt3_adv_p2 t3_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Hash Right Join
Hash Cond: ((t2_1.a = t1_2.a) AND (t2_1.c = t1_2.c))
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1 t1_2
Filter: (b < 10)
-(23 rows)
+(27 rows)
SELECT t1.a, t1.c, t2.a, t2.c, t3.a, t3.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) LEFT JOIN plt3_adv t3 ON (t1.a = t3.a AND t1.c = t3.c) WHERE t1.b < 10 ORDER BY t1.a;
a | c | a | c | a | c
@@ -4688,15 +4950,17 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2_1.a = t1_2.a) AND (t2_1.c = t1_2.c))
-> Seq Scan on plt2_adv_p1_null t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p1 t1_2
Filter: (b < 10)
-> Hash Join
Hash Cond: ((t2_2.a = t1_1.a) AND (t2_2.c = t1_1.c))
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1_1
Filter: (b < 10)
-(15 rows)
+(17 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -4722,9 +4986,10 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2.a = t1.a) AND (t2.c = t1.c))
-> Seq Scan on plt2_adv_p2 t2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p2 t1
Filter: (b < 10)
-(8 rows)
+(9 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -4764,15 +5029,17 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p3 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_1
Filter: ((b < 10) AND (c = ANY ('{0003,0004,0005}'::text[])))
-> Hash Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p4 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p4 t1_2
Filter: ((b < 10) AND (c = ANY ('{0003,0004,0005}'::text[])))
-(15 rows)
+(17 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.c IN ('0003', '0004', '0005') AND t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -4792,9 +5059,10 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2.a = t1.a) AND (t2.c = t1.c))
-> Seq Scan on plt2_adv_p4 t2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p4 t1
Filter: ((c IS NULL) AND (b < 10))
-(8 rows)
+(9 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.c IS NULL AND t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -4817,15 +5085,17 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2_1.a = t1_1.a) AND (t2_1.c = t1_1.c))
-> Seq Scan on plt2_adv_p3 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p3 t1_1
Filter: ((b < 10) AND (c = ANY ('{0003,0004,0005}'::text[])))
-> Hash Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.c = t1_2.c))
-> Seq Scan on plt2_adv_p4 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p4 t1_2
Filter: ((b < 10) AND (c = ANY ('{0003,0004,0005}'::text[])))
-(15 rows)
+(17 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 INNER JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.c IN ('0003', '0004', '0005') AND t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -4845,9 +5115,10 @@ SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a =
Hash Cond: ((t2.a = t1.a) AND (t2.c = t1.c))
-> Seq Scan on plt2_adv_p4 t2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt1_adv_p4 t1
Filter: ((c IS NULL) AND (b < 10))
-(8 rows)
+(9 rows)
SELECT t1.a, t1.c, t2.a, t2.c FROM plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE t1.c IS NULL AND t1.b < 10 ORDER BY t1.a;
a | c | a | c
@@ -4891,8 +5162,10 @@ SELECT t1.a, t1.c, t2.a, t2.c, t3.a, t3.c FROM (plt1_adv t1 LEFT JOIN plt2_adv t
Hash Cond: (t1_1.c = t2_1.c)
-> Seq Scan on plt1_adv_p1 t1_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt2_adv_p1 t2_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt3_adv_p1 t3_1
-> Hash Full Join
Hash Cond: (t1_2.c = t3_2.c)
@@ -4901,10 +5174,12 @@ SELECT t1.a, t1.c, t2.a, t2.c, t3.a, t3.c FROM (plt1_adv t1 LEFT JOIN plt2_adv t
Hash Cond: (t1_2.c = t2_2.c)
-> Seq Scan on plt1_adv_p2 t1_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt2_adv_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on plt3_adv_p2 t3_2
-(23 rows)
+(27 rows)
SELECT t1.a, t1.c, t2.a, t2.c, t3.a, t3.c FROM (plt1_adv t1 LEFT JOIN plt2_adv t2 ON (t1.c = t2.c)) FULL JOIN plt3_adv t3 ON (t1.c = t3.c) WHERE coalesce(t1.a, 0) % 5 != 3 AND coalesce(t1.a, 0) % 5 != 4 ORDER BY t1.c, t1.a, t2.a, t3.a;
a | c | a | c | a | c
@@ -5010,11 +5285,13 @@ SELECT t1.*, t2.* FROM alpha t1 INNER JOIN beta t2 ON (t1.a = t2.a AND t1.b = t2
-> Seq Scan on alpha_neg_p1 t1_1
Filter: ((b >= 125) AND (b < 225))
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on beta_neg_p1 t2_1
-> Hash Join
Hash Cond: ((t2_2.a = t1_2.a) AND (t2_2.b = t1_2.b))
-> Seq Scan on beta_neg_p2 t2_2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on alpha_neg_p2 t1_2
Filter: ((b >= 125) AND (b < 225))
-> Hash Join
@@ -5024,6 +5301,7 @@ SELECT t1.*, t2.* FROM alpha t1 INNER JOIN beta t2 ON (t1.a = t2.a AND t1.b = t2
-> Seq Scan on beta_pos_p2 t2_5
-> Seq Scan on beta_pos_p3 t2_6
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on alpha_pos_p1 t1_4
Filter: ((b >= 125) AND (b < 225))
@@ -5031,7 +5309,7 @@ SELECT t1.*, t2.* FROM alpha t1 INNER JOIN beta t2 ON (t1.a = t2.a AND t1.b = t2
Filter: ((b >= 125) AND (b < 225))
-> Seq Scan on alpha_pos_p3 t1_6
Filter: ((b >= 125) AND (b < 225))
-(29 rows)
+(32 rows)
SELECT t1.*, t2.* FROM alpha t1 INNER JOIN beta t2 ON (t1.a = t2.a AND t1.b = t2.b) WHERE t1.b >= 125 AND t1.b < 225 ORDER BY t1.a, t1.b;
a | b | c | a | b | c
@@ -5093,6 +5371,7 @@ SELECT t1.*, t2.* FROM alpha t1 INNER JOIN beta t2 ON (t1.a = t2.a AND t1.c = t2
-> Seq Scan on alpha_neg_p2 t1_3
Filter: ((c = ANY ('{0004,0009}'::text[])) AND (((b >= 100) AND (b < 110)) OR ((b >= 200) AND (b < 210))))
-> Hash
+ Buckets: 1024 Batches: 1
-> Append
-> Seq Scan on beta_neg_p1 t2_2
Filter: (((b >= 100) AND (b < 110)) OR ((b >= 200) AND (b < 210)))
@@ -5110,7 +5389,7 @@ SELECT t1.*, t2.* FROM alpha t1 INNER JOIN beta t2 ON (t1.a = t2.a AND t1.c = t2
Filter: ((c = ANY ('{0004,0009}'::text[])) AND (((b >= 100) AND (b < 110)) OR ((b >= 200) AND (b < 210))))
-> Seq Scan on beta_pos_p3 t2_5
Filter: (((b >= 100) AND (b < 110)) OR ((b >= 200) AND (b < 210)))
-(28 rows)
+(29 rows)
SELECT t1.*, t2.* FROM alpha t1 INNER JOIN beta t2 ON (t1.a = t2.a AND t1.c = t2.c) WHERE ((t1.b >= 100 AND t1.b < 110) OR (t1.b >= 200 AND t1.b < 210)) AND ((t2.b >= 100 AND t2.b < 110) OR (t2.b >= 200 AND t2.b < 210)) AND t1.c IN ('0004', '0009') ORDER BY t1.a, t1.b, t2.b;
a | b | c | a | b | c
@@ -5145,6 +5424,7 @@ SELECT t1.*, t2.* FROM alpha t1 INNER JOIN beta t2 ON (t1.a = t2.a AND t1.b = t2
-> Seq Scan on alpha_neg_p1 t1_1
Filter: ((c = ANY ('{0004,0009}'::text[])) AND (((b >= 100) AND (b < 110)) OR ((b >= 200) AND (b < 210))))
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on beta_neg_p1 t2_1
Filter: (((b >= 100) AND (b < 110)) OR ((b >= 200) AND (b < 210)))
-> Hash Join
@@ -5152,6 +5432,7 @@ SELECT t1.*, t2.* FROM alpha t1 INNER JOIN beta t2 ON (t1.a = t2.a AND t1.b = t2
-> Seq Scan on alpha_neg_p2 t1_2
Filter: ((c = ANY ('{0004,0009}'::text[])) AND (((b >= 100) AND (b < 110)) OR ((b >= 200) AND (b < 210))))
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on beta_neg_p2 t2_2
Filter: (((b >= 100) AND (b < 110)) OR ((b >= 200) AND (b < 210)))
-> Nested Loop
@@ -5166,7 +5447,7 @@ SELECT t1.*, t2.* FROM alpha t1 INNER JOIN beta t2 ON (t1.a = t2.a AND t1.b = t2
Filter: ((c = ANY ('{0004,0009}'::text[])) AND (((b >= 100) AND (b < 110)) OR ((b >= 200) AND (b < 210))))
-> Seq Scan on beta_pos_p3 t2_4
Filter: (((b >= 100) AND (b < 110)) OR ((b >= 200) AND (b < 210)))
-(29 rows)
+(31 rows)
SELECT t1.*, t2.* FROM alpha t1 INNER JOIN beta t2 ON (t1.a = t2.a AND t1.b = t2.b AND t1.c = t2.c) WHERE ((t1.b >= 100 AND t1.b < 110) OR (t1.b >= 200 AND t1.b < 210)) AND ((t2.b >= 100 AND t2.b < 110) OR (t2.b >= 200 AND t2.b < 210)) AND t1.c IN ('0004', '0009') ORDER BY t1.a, t1.b;
a | b | c | a | b | c
diff --git a/src/test/regress/expected/plpgsql.out b/src/test/regress/expected/plpgsql.out
index 0a6945581bd..b5cbf9a685d 100644
--- a/src/test/regress/expected/plpgsql.out
+++ b/src/test/regress/expected/plpgsql.out
@@ -5554,6 +5554,7 @@ INFO: Hash Full Join
Output: ot.id, ot.val
-> Hash
Output: nt.id, nt.val
+ Buckets: 1024 Batches: 1
-> Named Tuplestore Scan
Output: nt.id, nt.val
diff --git a/src/test/regress/expected/predicate.out b/src/test/regress/expected/predicate.out
index 965a3a76161..83b53da3764 100644
--- a/src/test/regress/expected/predicate.out
+++ b/src/test/regress/expected/predicate.out
@@ -314,7 +314,8 @@ SELECT 1 FROM pred_tab t1
-> Materialize
-> Seq Scan on pred_tab t2
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on pred_tab t5
-(12 rows)
+(13 rows)
DROP TABLE pred_tab;
diff --git a/src/test/regress/expected/privileges.out b/src/test/regress/expected/privileges.out
index 6b01313101b..76061aa88f8 100644
--- a/src/test/regress/expected/privileges.out
+++ b/src/test/regress/expected/privileges.out
@@ -612,9 +612,10 @@ EXPLAIN (COSTS OFF) SELECT * FROM atest12 x, atest12 y
Hash Cond: (x.a = y.b)
-> Seq Scan on atest12 x
-> Hash
+ Buckets: 8192 Batches: 1
-> Seq Scan on atest12 y
Filter: (abs(a) <<< 5)
-(6 rows)
+(7 rows)
-- clean up (regress_priv_user1's objects are all dropped later)
DROP FUNCTION leak2(integer, integer) CASCADE;
diff --git a/src/test/regress/expected/returning.out b/src/test/regress/expected/returning.out
index d1394c67833..d8fb5b6fd62 100644
--- a/src/test/regress/expected/returning.out
+++ b/src/test/regress/expected/returning.out
@@ -637,10 +637,12 @@ UPDATE joinview SET f3 = f3 + 1 WHERE f3 = 57
Output: joinme_1.ctid, joinme_1.f2j
-> Hash
Output: foo_1.f2, foo_1.tableoid, foo_1.ctid
+ Buckets: 1024 Batches: 1
-> Seq Scan on pg_temp.foo foo_1
Output: foo_1.f2, foo_1.tableoid, foo_1.ctid
-> Hash
Output: joinme.ctid, joinme.other, joinme.f2j, foo_2.f1, foo_2.f3, foo_2.ctid, foo_2.f2, foo_2.tableoid
+ Buckets: 1024 Batches: 1
-> Hash Join
Output: joinme.ctid, joinme.other, joinme.f2j, foo_2.f1, foo_2.f3, foo_2.ctid, foo_2.f2, foo_2.tableoid
Hash Cond: (joinme.f2j = foo_2.f2)
@@ -648,10 +650,11 @@ UPDATE joinview SET f3 = f3 + 1 WHERE f3 = 57
Output: joinme.ctid, joinme.other, joinme.f2j
-> Hash
Output: foo_2.f1, foo_2.f3, foo_2.ctid, foo_2.f2, foo_2.tableoid
+ Buckets: 1024 Batches: 1
-> Seq Scan on pg_temp.foo foo_2
Output: foo_2.f1, foo_2.f3, foo_2.ctid, foo_2.f2, foo_2.tableoid
Filter: (foo_2.f3 = 57)
-(27 rows)
+(30 rows)
UPDATE joinview SET f3 = f3 + 1 WHERE f3 = 57
RETURNING old.*, new.*, *, new.f3 - old.f3 AS delta_f3;
@@ -711,10 +714,11 @@ UPDATE joinview SET f3 = f3 + 1, f4 = 7 WHERE f3 = 58
Output: joinme.other, joinme.ctid, joinme.f2j
-> Hash
Output: foo.f3, foo.f1, foo.f2, foo.f4, foo.ctid, foo.tableoid
+ Buckets: 1024 Batches: 1
-> Seq Scan on pg_temp.foo
Output: foo.f3, foo.f1, foo.f2, foo.f4, foo.ctid, foo.tableoid
Filter: (foo.f3 = 58)
-(12 rows)
+(13 rows)
UPDATE joinview SET f3 = f3 + 1, f4 = 7 WHERE f3 = 58
RETURNING old.*, new.*, *, new.f3 - old.f3 AS delta_f3; -- should succeed
diff --git a/src/test/regress/expected/rowsecurity.out b/src/test/regress/expected/rowsecurity.out
index fd5654df35e..d2896f9d03a 100644
--- a/src/test/regress/expected/rowsecurity.out
+++ b/src/test/regress/expected/rowsecurity.out
@@ -284,9 +284,10 @@ EXPLAIN (COSTS OFF) SELECT * FROM document NATURAL JOIN category WHERE f_leak(dt
Index Cond: (pguser = CURRENT_USER)
-> Seq Scan on category
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on document
Filter: ((dlevel <= (InitPlan 1).col1) AND f_leak(dtitle))
-(9 rows)
+(10 rows)
-- viewpoint from regress_rls_dave
SET SESSION AUTHORIZATION regress_rls_dave;
@@ -348,9 +349,10 @@ EXPLAIN (COSTS OFF) SELECT * FROM document NATURAL JOIN category WHERE f_leak(dt
Index Cond: (pguser = CURRENT_USER)
-> Seq Scan on category
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on document
Filter: ((cid <> 44) AND (cid <> 44) AND (cid < 50) AND (dlevel <= (InitPlan 1).col1) AND f_leak(dtitle))
-(9 rows)
+(10 rows)
-- 44 would technically fail for both p2r and p1r, but we should get an error
-- back from p1r for this because it sorts first
@@ -3209,9 +3211,10 @@ EXPLAIN (COSTS OFF) SELECT * FROM y2 JOIN test_qual_pushdown ON (b = abc) WHERE
-> Seq Scan on test_qual_pushdown
Filter: f_leak(abc)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on y2
Filter: (((a % 4) = 0) OR ((a % 3) = 0) OR ((a % 2) = 0))
-(7 rows)
+(8 rows)
SELECT * FROM y2 JOIN test_qual_pushdown ON (b = abc) WHERE f_leak(b);
NOTICE: f_leak => 5feceb66ffc86f38d952786c6d696c79
@@ -3239,9 +3242,10 @@ EXPLAIN (COSTS OFF) SELECT * FROM y2 JOIN test_qual_pushdown ON (b = abc) WHERE
Hash Cond: (test_qual_pushdown.abc = y2.b)
-> Seq Scan on test_qual_pushdown
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on y2
Filter: ((((a % 4) = 0) OR ((a % 3) = 0) OR ((a % 2) = 0)) AND f_leak(b))
-(6 rows)
+(7 rows)
DROP TABLE test_qual_pushdown;
--
diff --git a/src/test/regress/expected/select_parallel.out b/src/test/regress/expected/select_parallel.out
index a8090364532..aa3126f7bd7 100644
--- a/src/test/regress/expected/select_parallel.out
+++ b/src/test/regress/expected/select_parallel.out
@@ -1140,12 +1140,13 @@ explain (costs off, verbose)
Output: b.unique1
-> Hash
Output: a.unique1, a.two
+ Buckets: 16384 Batches: 1
-> Gather
Output: a.unique1, a.two
Workers Planned: 4
-> Parallel Seq Scan on public.tenk1 a
Output: a.unique1, a.two
-(18 rows)
+(19 rows)
-- LIMIT/OFFSET within sub-selects can't be pushed to workers.
explain (costs off)
@@ -1159,12 +1160,13 @@ explain (costs off)
Workers Planned: 4
-> Parallel Seq Scan on tenk1 a
-> Hash
+ Buckets: 1024 Batches: 1
-> Limit
-> Gather
Workers Planned: 4
-> Parallel Seq Scan on tenk1 b
Filter: (stringu1 ~~ '%AAAA'::text)
-(11 rows)
+(12 rows)
-- to increase the parallel query test coverage
SAVEPOINT settings;
diff --git a/src/test/regress/expected/select_views.out b/src/test/regress/expected/select_views.out
index 1aeed8452bd..db2b767c282 100644
--- a/src/test/regress/expected/select_views.out
+++ b/src/test/regress/expected/select_views.out
@@ -1416,9 +1416,10 @@ EXPLAIN (COSTS OFF) SELECT * FROM my_credit_card_normal WHERE f_leak(cnum);
-> Seq Scan on credit_card r
Filter: f_leak(cnum)
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on customer l
Filter: (name = CURRENT_USER)
-(7 rows)
+(8 rows)
SELECT * FROM my_credit_card_secure WHERE f_leak(cnum);
NOTICE: f_leak => 1111-2222-3333-4444
@@ -1436,9 +1437,10 @@ EXPLAIN (COSTS OFF) SELECT * FROM my_credit_card_secure WHERE f_leak(cnum);
Hash Cond: (r.cid = l.cid)
-> Seq Scan on credit_card r
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on customer l
Filter: (name = CURRENT_USER)
-(8 rows)
+(9 rows)
--
-- scenario: an external qualifier can be pushed-down by in-front-of the
@@ -1470,9 +1472,10 @@ EXPLAIN (COSTS OFF) SELECT * FROM my_credit_card_usage_normal
Hash Cond: (r_1.cid = l_1.cid)
-> Seq Scan on credit_card r_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on customer l_1
Filter: (name = CURRENT_USER)
-(13 rows)
+(14 rows)
SELECT * FROM my_credit_card_usage_secure
WHERE f_leak(cnum) AND ymd >= '2011-10-01' AND ymd < '2011-11-01';
@@ -1501,9 +1504,10 @@ EXPLAIN (COSTS OFF) SELECT * FROM my_credit_card_usage_secure
Hash Cond: (r_1.cid = l.cid)
-> Seq Scan on credit_card r_1
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on customer l
Filter: (name = CURRENT_USER)
-(13 rows)
+(14 rows)
--
-- Test for the case when security_barrier gets changed between rewriter
diff --git a/src/test/regress/expected/subselect.out b/src/test/regress/expected/subselect.out
index ebc545e2461..339bf2aa59b 100644
--- a/src/test/regress/expected/subselect.out
+++ b/src/test/regress/expected/subselect.out
@@ -407,8 +407,9 @@ select * from int4_tbl o where exists
Hash Cond: (o.f1 = i.f1)
-> Seq Scan on int4_tbl o
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int4_tbl i
-(5 rows)
+(6 rows)
explain (costs off)
select * from int4_tbl o where not exists
@@ -419,8 +420,9 @@ select * from int4_tbl o where not exists
Hash Cond: (o.f1 = i.f1)
-> Seq Scan on int4_tbl o
-> Hash
+ Buckets: 1024 Batches: 1
-> Seq Scan on int4_tbl i
-(5 rows)
+(6 rows)
explain (costs off)
select * from int4_tbl o where exists
@@ -1815,9 +1817,10 @@ order by t1.ten;
Output: t2.unique1, t2.unique2, t2.two, t2.four, t2.ten, t2.twenty, t2.hundred, t2.thousand, t2.twothousand, t2.fivethous, t2.tenthous, t2.odd, t2.even, t2.stringu1, t2.stringu2, t2.string4
-> Hash
Output: t1.ten, t1.unique1
+ Buckets: 16384 Batches: 1
-> Seq Scan on public.tenk1 t1
Output: t1.ten, t1.unique1
-(15 rows)
+(16 rows)
select t1.ten, sum(x) from
tenk1 t1 left join lateral (
@@ -1861,13 +1864,15 @@ order by 1, 2;
Output: t1.q1, t1.q2
-> Hash
Output: t2.q1, t2.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl t2
Output: t2.q1, t2.q2
-> Hash
Output: t3.q1, t3.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl t3
Output: t3.q1, t3.q2
-(19 rows)
+(21 rows)
select t1.q1, x from
int8_tbl t1 left join
@@ -1914,13 +1919,15 @@ order by 1, 2;
Output: t2.q1, t2.q2
-> Hash
Output: t3.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl t3
Output: t3.q2
-> Hash
Output: t1.q1, t1.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl t1
Output: t1.q1, t1.q2
-(19 rows)
+(21 rows)
select t1.q1, x from
int8_tbl t1 left join
@@ -1968,9 +1975,10 @@ order by 1, 2;
Filter: (t2.q2 = t3.q2)
-> Hash
Output: t1.q1, t1.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl t1
Output: t1.q1, t1.q2
-(17 rows)
+(18 rows)
select t1.q1, x from
int8_tbl t1 left join
@@ -2017,13 +2025,15 @@ order by 1, 2;
Output: t2.q1, t2.q2
-> Hash
Output: t3.q1
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl t3
Output: t3.q1
-> Hash
Output: t1.q1
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl t1
Output: t1.q1
-(19 rows)
+(21 rows)
select t1.q1, x from
int8_tbl t1 left join
@@ -2081,9 +2091,10 @@ order by 1, 2;
Filter: (t2.q2 = t3.q1)
-> Hash
Output: t1.q1
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl t1
Output: t1.q1
-(17 rows)
+(18 rows)
select t1.q1, x from
int8_tbl t1 left join
@@ -2149,17 +2160,20 @@ order by 1, 2, 3;
Output: t2.q1, t2.q2
-> Hash
Output: t3.q2, (COALESCE(t3.q1))
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl t3
Output: t3.q2, COALESCE(t3.q1)
-> Hash
Output: t4.q1, t4.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl t4
Output: t4.q1, t4.q2
-> Hash
Output: t1.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl t1
Output: t1.q2
-(26 rows)
+(29 rows)
select ss2.* from
int8_tbl t1 left join
@@ -2223,15 +2237,17 @@ order by 1, 2, 3;
Output: t2.q1, t2.q2
-> Hash
Output: t3.q2, (COALESCE(t3.q1))
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl t3
Output: t3.q2, COALESCE(t3.q1)
-> Seq Scan on public.int8_tbl t4
Output: t4.q1, t4.q2, (COALESCE(t3.q1))
-> Hash
Output: t1.q2
+ Buckets: 1024 Batches: 1
-> Seq Scan on public.int8_tbl t1
Output: t1.q2
-(24 rows)
+(26 rows)
select ss2.* from
int8_tbl t1 left join
@@ -2533,10 +2549,11 @@ select * from tenk1 A where hundred in (select hundred from tenk2 B where B.odd
Hash Cond: ((a.odd = b.odd) AND (a.hundred = b.hundred))
-> Seq Scan on tenk1 a
-> Hash
+ Buckets: 1024 Batches: 1
-> HashAggregate
Group Key: b.odd, b.hundred
-> Seq Scan on tenk2 b
-(7 rows)
+(8 rows)
explain (costs off)
select * from tenk1 A where exists
@@ -2602,10 +2619,11 @@ ON B.hundred in (SELECT c.hundred FROM tenk2 C WHERE c.odd = b.odd);
Hash Cond: ((b.odd = c.odd) AND (b.hundred = c.hundred))
-> Seq Scan on tenk2 b
-> Hash
+ Buckets: 1024 Batches: 1
-> HashAggregate
Group Key: c.odd, c.hundred
-> Seq Scan on tenk2 c
-(10 rows)
+(11 rows)
-- we can pull up the sublink into the inner JoinExpr.
explain (costs off)
@@ -2621,12 +2639,14 @@ WHERE a.thousand < 750;
-> Seq Scan on tenk1 a
Filter: (thousand < 750)
-> Hash
+ Buckets: 1024 Batches: 1
-> HashAggregate
Group Key: c.odd, c.hundred
-> Seq Scan on tenk2 c
-> Hash
+ Buckets: 16384 Batches: 1
-> Seq Scan on tenk2 b
-(12 rows)
+(14 rows)
-- we can pull up the aggregate sublink into RHS of a left join.
explain (costs off)
diff --git a/src/test/regress/expected/sysviews.out b/src/test/regress/expected/sysviews.out
index 352abc0bd42..a786bc5aaaa 100644
--- a/src/test/regress/expected/sysviews.out
+++ b/src/test/regress/expected/sysviews.out
@@ -155,6 +155,8 @@ select name, setting from pg_settings where name like 'enable%';
enable_group_by_reordering | on
enable_hashagg | on
enable_hashjoin | on
+ enable_hashjoin_adjust | off
+ enable_hashjoin_growth | off
enable_incremental_sort | on
enable_indexonlyscan | on
enable_indexscan | on
@@ -171,7 +173,7 @@ select name, setting from pg_settings where name like 'enable%';
enable_seqscan | on
enable_sort | on
enable_tidscan | on
-(23 rows)
+(25 rows)
-- There are always wait event descriptions for various types. InjectionPoint
-- may be present or absent, depending on history since last postmaster start.
diff --git a/src/test/regress/expected/tidscan.out b/src/test/regress/expected/tidscan.out
index f6ebdf0601f..9a83d6e420d 100644
--- a/src/test/regress/expected/tidscan.out
+++ b/src/test/regress/expected/tidscan.out
@@ -238,15 +238,16 @@ ROLLBACK;
-- appropriate place for these tests)
EXPLAIN (COSTS OFF)
SELECT count(*) FROM tenk1 t1 JOIN tenk1 t2 ON t1.ctid = t2.ctid;
- QUERY PLAN
-----------------------------------------
+ QUERY PLAN
+------------------------------------------
Aggregate
-> Hash Join
Hash Cond: (t1.ctid = t2.ctid)
-> Seq Scan on tenk1 t1
-> Hash
+ Buckets: 16384 Batches: 1
-> Seq Scan on tenk1 t2
-(6 rows)
+(7 rows)
SELECT count(*) FROM tenk1 t1 JOIN tenk1 t2 ON t1.ctid = t2.ctid;
count
diff --git a/src/test/regress/expected/updatable_views.out b/src/test/regress/expected/updatable_views.out
index 095df0a670c..74653c1eeb3 100644
--- a/src/test/regress/expected/updatable_views.out
+++ b/src/test/regress/expected/updatable_views.out
@@ -575,8 +575,9 @@ MERGE INTO rw_view1 t
-> Bitmap Index Scan on base_tbl_pkey
Index Cond: (a > 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Function Scan on generate_series
-(9 rows)
+(10 rows)
EXPLAIN (costs off)
MERGE INTO rw_view1 t
@@ -592,8 +593,9 @@ MERGE INTO rw_view1 t
-> Bitmap Index Scan on base_tbl_pkey
Index Cond: (a > 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Function Scan on generate_series
-(9 rows)
+(10 rows)
EXPLAIN (costs off)
MERGE INTO rw_view1 t
@@ -609,8 +611,9 @@ MERGE INTO rw_view1 t
-> Bitmap Index Scan on base_tbl_pkey
Index Cond: (a > 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Function Scan on generate_series
-(9 rows)
+(10 rows)
-- it's still updatable if we add a DO ALSO rule
CREATE TABLE base_tbl_hist(ts timestamptz default now(), a int, b text);
@@ -1277,8 +1280,9 @@ MERGE INTO rw_view2 t
-> Bitmap Index Scan on base_tbl_pkey
Index Cond: (a > 0)
-> Hash
+ Buckets: 1024 Batches: 1
-> Function Scan on generate_series x
-(11 rows)
+(12 rows)
-- MERGE with incomplete set of INSTEAD OF triggers
DROP TRIGGER rw_view1_del_trig ON rw_view1;
@@ -2763,11 +2767,12 @@ EXPLAIN (costs off) UPDATE rw_view1 SET a = a + 5;
Hash Cond: (b.a = r.a)
-> Seq Scan on base_tbl b
-> Hash
+ Buckets: 4096 Batches: 1
-> Seq Scan on ref_tbl r
SubPlan 1
-> Index Only Scan using ref_tbl_pkey on ref_tbl r_1
Index Cond: (a = b.a)
-(9 rows)
+(10 rows)
DROP TABLE base_tbl, ref_tbl CASCADE;
NOTICE: drop cascades to view rw_view1
diff --git a/src/test/regress/expected/window.out b/src/test/regress/expected/window.out
index 23d1463df22..b218f697eb2 100644
--- a/src/test/regress/expected/window.out
+++ b/src/test/regress/expected/window.out
@@ -5321,9 +5321,10 @@ LIMIT 1;
Hash Cond: (t1.unique1 = t2.tenthous)
-> Index Only Scan using tenk1_unique1 on tenk1 t1
-> Hash
+ Buckets: 8192 Batches: 1
-> Seq Scan on tenk1 t2
Filter: (two = 1)
-(8 rows)
+(9 rows)
-- Ensure we get a cheap total plan. This time use UNBOUNDED FOLLOWING, which
-- needs to read all join rows to output the first WindowAgg row.
diff --git a/src/test/regress/expected/with.out b/src/test/regress/expected/with.out
index 7a51e2eb757..ac52dc28b4d 100644
--- a/src/test/regress/expected/with.out
+++ b/src/test/regress/expected/with.out
@@ -686,8 +686,9 @@ select count(*) from tenk1 a
Hash Cond: (a.unique1 = x.unique1)
-> Index Only Scan using tenk1_unique1 on tenk1 a
-> Hash
+ Buckets: 16384 Batches: 1
-> CTE Scan on x
-(8 rows)
+(9 rows)
explain (costs off)
with x as materialized (insert into tenk1 default values returning unique1)
@@ -3156,6 +3157,7 @@ WHEN NOT MATCHED THEN INSERT VALUES(o.k, o.v);
Output: m.ctid, m.k
-> Hash
Output: o.k, o.v, o.*
+ Buckets: 1024 Batches: 1
-> Subquery Scan on o
Output: o.k, o.v, o.*
-> Result
@@ -3166,7 +3168,7 @@ WHEN NOT MATCHED THEN INSERT VALUES(o.k, o.v);
-> CTE Scan on cte_basic
Output: (cte_basic.b || ' merge update'::text)
Filter: (cte_basic.a = m.k)
-(21 rows)
+(22 rows)
-- InitPlan
WITH cte_init AS MATERIALIZED (SELECT 1 a, 'cte_init val' b)
@@ -3205,11 +3207,12 @@ WHEN NOT MATCHED THEN INSERT VALUES(o.k, o.v);
Output: m.ctid, m.k
-> Hash
Output: o.k, o.v, o.*
+ Buckets: 1024 Batches: 1
-> Subquery Scan on o
Output: o.k, o.v, o.*
-> Result
Output: 1, 'merge source InitPlan'::text
-(21 rows)
+(22 rows)
-- MERGE source comes from CTE:
WITH merge_source_cte AS MATERIALIZED (SELECT 15 a, 'merge_source_cte val' b)
@@ -3249,9 +3252,10 @@ WHEN NOT MATCHED THEN INSERT VALUES(o.a, o.b || (SELECT merge_source_cte.*::text
Output: m.ctid, m.k
-> Hash
Output: merge_source_cte.a, merge_source_cte.b, merge_source_cte.*
+ Buckets: 1024 Batches: 1
-> CTE Scan on merge_source_cte
Output: merge_source_cte.a, merge_source_cte.b, merge_source_cte.*
-(20 rows)
+(21 rows)
DROP TABLE m;
-- check that run to completion happens in proper ordering
@@ -3563,9 +3567,10 @@ DELETE FROM a_star USING wcte WHERE aa = q2;
Output: a_star_6.aa, a_star_6.tableoid, a_star_6.ctid
-> Hash
Output: wcte.*, wcte.q2
+ Buckets: 1024 Batches: 1
-> CTE Scan on wcte
Output: wcte.*, wcte.q2
-(32 rows)
+(33 rows)
-- error cases
-- data-modifying WITH tries to use its own output
diff --git a/src/test/regress/expected/xml.out b/src/test/regress/expected/xml.out
index 2e9616acda1..7505a140775 100644
--- a/src/test/regress/expected/xml.out
+++ b/src/test/regress/expected/xml.out
@@ -3,111 +3,85 @@ CREATE TABLE xmltest (
data xml
);
INSERT INTO xmltest VALUES (1, '<value>one</value>');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest VALUES (1, '<value>one</value>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
INSERT INTO xmltest VALUES (2, '<value>two</value>');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest VALUES (2, '<value>two</value>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
INSERT INTO xmltest VALUES (3, '<wrong');
-ERROR: invalid XML content
+ERROR: unsupported XML feature
LINE 1: INSERT INTO xmltest VALUES (3, '<wrong');
^
-DETAIL: line 1: Couldn't find end of Start Tag wrong line 1
-<wrong
- ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT * FROM xmltest;
- id | data
-----+--------------------
- 1 | <value>one</value>
- 2 | <value>two</value>
-(2 rows)
+ id | data
+----+------
+(0 rows)
-- test non-throwing API, too
SELECT pg_input_is_valid('<value>one</value>', 'xml');
- pg_input_is_valid
--------------------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT pg_input_is_valid('<value>one</', 'xml');
- pg_input_is_valid
--------------------
- f
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT message FROM pg_input_error_info('<value>one</', 'xml');
- message
----------------------
- invalid XML content
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT pg_input_is_valid('<?xml version="1.0" standalone="y"?><foo/>', 'xml');
- pg_input_is_valid
--------------------
- f
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT message FROM pg_input_error_info('<?xml version="1.0" standalone="y"?><foo/>', 'xml');
- message
-----------------------------------------------
- invalid XML content: invalid XML declaration
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlcomment('test');
- xmlcomment
--------------
- <!--test-->
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlcomment('-test');
- xmlcomment
---------------
- <!---test-->
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlcomment('test-');
-ERROR: invalid XML comment
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlcomment('--test');
-ERROR: invalid XML comment
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlcomment('te st');
- xmlcomment
---------------
- <!--te st-->
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlconcat(xmlcomment('hello'),
xmlelement(NAME qux, 'foo'),
xmlcomment('world'));
- xmlconcat
-----------------------------------------
- <!--hello--><qux>foo</qux><!--world-->
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlconcat('hello', 'you');
- xmlconcat
------------
- helloyou
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlconcat('hello', 'you');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlconcat(1, 2);
ERROR: argument of XMLCONCAT must be type xml, not type integer
LINE 1: SELECT xmlconcat(1, 2);
^
SELECT xmlconcat('bad', '<syntax');
-ERROR: invalid XML content
+ERROR: unsupported XML feature
LINE 1: SELECT xmlconcat('bad', '<syntax');
- ^
-DETAIL: line 1: Couldn't find end of Start Tag syntax line 1
-<syntax
- ^
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
- xmlconcat
---------------
- <foo/><bar/>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlconcat('<foo/>', NULL, '<?xml version="1.1" standa...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml version="1.1" standalone="no"?><bar/>');
- xmlconcat
------------------------------------
- <?xml version="1.1"?><foo/><bar/>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlconcat('<?xml version="1.1"?><foo/>', NULL, '<?xml...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlconcat(NULL);
xmlconcat
-----------
@@ -123,325 +97,186 @@ SELECT xmlconcat(NULL, NULL);
SELECT xmlelement(name element,
xmlattributes (1 as one, 'deuce' as two),
'content');
- xmlelement
-------------------------------------------------
- <element one="1" two="deuce">content</element>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlelement(name element,
xmlattributes ('unnamed and wrong'));
-ERROR: unnamed XML attribute value must be a column reference
-LINE 2: xmlattributes ('unnamed and wrong'));
- ^
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlelement(name element, xmlelement(name nested, 'stuff'));
- xmlelement
--------------------------------------------
- <element><nested>stuff</nested></element>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
- xmlelement
-----------------------------------------------------------------------
- <employee><name>sharon</name><age>25</age><pay>1000</pay></employee>
- <employee><name>sam</name><age>30</age><pay>2000</pay></employee>
- <employee><name>bill</name><age>20</age><pay>1000</pay></employee>
- <employee><name>jeff</name><age>23</age><pay>600</pay></employee>
- <employee><name>cim</name><age>30</age><pay>400</pay></employee>
- <employee><name>linda</name><age>19</age><pay>100</pay></employee>
-(6 rows)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlelement(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a));
-ERROR: XML attribute name "a" appears more than once
-LINE 1: ...ment(name duplicate, xmlattributes(1 as a, 2 as b, 3 as a));
- ^
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlelement(name num, 37);
- xmlelement
----------------
- <num>37</num>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlelement(name foo, text 'bar');
- xmlelement
-----------------
- <foo>bar</foo>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlelement(name foo, xml 'bar');
- xmlelement
-----------------
- <foo>bar</foo>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlelement(name foo, text 'b<a/>r');
- xmlelement
--------------------------
- <foo>b<a/>r</foo>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlelement(name foo, xml 'b<a/>r');
- xmlelement
--------------------
- <foo>b<a/>r</foo>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlelement(name foo, array[1, 2, 3]);
- xmlelement
--------------------------------------------------------------------------
- <foo><element>1</element><element>2</element><element>3</element></foo>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SET xmlbinary TO base64;
SELECT xmlelement(name foo, bytea 'bar');
- xmlelement
------------------
- <foo>YmFy</foo>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SET xmlbinary TO hex;
SELECT xmlelement(name foo, bytea 'bar');
- xmlelement
--------------------
- <foo>626172</foo>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlelement(name foo, xmlattributes(true as bar));
- xmlelement
--------------------
- <foo bar="true"/>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as bar));
- xmlelement
-----------------------------------
- <foo bar="2009-04-09T00:24:37"/>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar));
-ERROR: timestamp out of range
-DETAIL: XML does not support infinite timestamp values.
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlelement(name foo, xmlattributes('<>&"''' as funny, xml 'b<a/>r' as funnier));
- xmlelement
-------------------------------------------------------------
- <foo funny="<>&"'" funnier="b<a/>r"/>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(content '');
- xmlparse
-----------
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(content ' ');
- xmlparse
-----------
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(content 'abc');
- xmlparse
-----------
- abc
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(content '<abc>x</abc>');
- xmlparse
---------------
- <abc>x</abc>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(content '<invalidentity>&</invalidentity>');
-ERROR: invalid XML content
-DETAIL: line 1: xmlParseEntityRef: no name
-<invalidentity>&</invalidentity>
- ^
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(content '<undefinedentity>&idontexist;</undefinedentity>');
-ERROR: invalid XML content
-DETAIL: line 1: Entity 'idontexist' not defined
-<undefinedentity>&idontexist;</undefinedentity>
- ^
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(content '<invalidns xmlns=''<''/>');
- xmlparse
----------------------------
- <invalidns xmlns='<'/>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(content '<relativens xmlns=''relative''/>');
- xmlparse
---------------------------------
- <relativens xmlns='relative'/>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(content '<twoerrors>&idontexist;</unbalanced>');
-ERROR: invalid XML content
-DETAIL: line 1: Entity 'idontexist' not defined
-<twoerrors>&idontexist;</unbalanced>
- ^
-line 1: Opening and ending tag mismatch: twoerrors line 1 and unbalanced
-<twoerrors>&idontexist;</unbalanced>
- ^
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(content '<nosuchprefix:tag/>');
- xmlparse
----------------------
- <nosuchprefix:tag/>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(document ' ');
-ERROR: invalid XML document
-DETAIL: line 1: Start tag expected, '<' not found
-
- ^
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(document 'abc');
-ERROR: invalid XML document
-DETAIL: line 1: Start tag expected, '<' not found
-abc
-^
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(document '<abc>x</abc>');
- xmlparse
---------------
- <abc>x</abc>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(document '<invalidentity>&</abc>');
-ERROR: invalid XML document
-DETAIL: line 1: xmlParseEntityRef: no name
-<invalidentity>&</abc>
- ^
-line 1: Opening and ending tag mismatch: invalidentity line 1 and abc
-<invalidentity>&</abc>
- ^
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(document '<undefinedentity>&idontexist;</abc>');
-ERROR: invalid XML document
-DETAIL: line 1: Entity 'idontexist' not defined
-<undefinedentity>&idontexist;</abc>
- ^
-line 1: Opening and ending tag mismatch: undefinedentity line 1 and abc
-<undefinedentity>&idontexist;</abc>
- ^
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(document '<invalidns xmlns=''<''/>');
- xmlparse
----------------------------
- <invalidns xmlns='<'/>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(document '<relativens xmlns=''relative''/>');
- xmlparse
---------------------------------
- <relativens xmlns='relative'/>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(document '<twoerrors>&idontexist;</unbalanced>');
-ERROR: invalid XML document
-DETAIL: line 1: Entity 'idontexist' not defined
-<twoerrors>&idontexist;</unbalanced>
- ^
-line 1: Opening and ending tag mismatch: twoerrors line 1 and unbalanced
-<twoerrors>&idontexist;</unbalanced>
- ^
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlparse(document '<nosuchprefix:tag/>');
- xmlparse
----------------------
- <nosuchprefix:tag/>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlpi(name foo);
- xmlpi
----------
- <?foo?>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlpi(name xml);
-ERROR: invalid XML processing instruction
-DETAIL: XML processing instruction target name cannot be "xml".
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlpi(name xmlstuff);
- xmlpi
---------------
- <?xmlstuff?>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlpi(name foo, 'bar');
- xmlpi
--------------
- <?foo bar?>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlpi(name foo, 'in?>valid');
-ERROR: invalid XML processing instruction
-DETAIL: XML processing instruction cannot contain "?>".
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlpi(name foo, null);
- xmlpi
--------
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlpi(name xml, null);
-ERROR: invalid XML processing instruction
-DETAIL: XML processing instruction target name cannot be "xml".
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlpi(name xmlstuff, null);
- xmlpi
--------
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlpi(name "xml-stylesheet", 'href="mystyle.css" type="text/css"');
- xmlpi
--------------------------------------------------------
- <?xml-stylesheet href="mystyle.css" type="text/css"?>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlpi(name foo, ' bar');
- xmlpi
--------------
- <?foo bar?>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlroot(xml '<foo/>', version no value, standalone no value);
- xmlroot
----------
- <foo/>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot(xml '<foo/>', version no value, standalone no...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlroot(xml '<foo/>', version '2.0');
- xmlroot
------------------------------
- <?xml version="2.0"?><foo/>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot(xml '<foo/>', version '2.0');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
- xmlroot
-----------------------------------------------
- <?xml version="1.0" standalone="yes"?><foo/>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot(xml '<foo/>', version no value, standalone ye...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no value, standalone yes);
- xmlroot
-----------------------------------------------
- <?xml version="1.0" standalone="yes"?><foo/>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot(xml '<?xml version="1.1"?><foo/>', version no...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version '1.1', standalone no);
- xmlroot
----------------------------------------------
- <?xml version="1.1" standalone="no"?><foo/>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot(xmlroot(xml '<foo/>', version '1.0'), version...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no);
- xmlroot
----------------------------------------------
- <?xml version="1.0" standalone="no"?><foo/>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value, standalone no value);
- xmlroot
----------
- <foo/>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>', version no value);
- xmlroot
-----------------------------------------------
- <?xml version="1.0" standalone="yes"?><foo/>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlroot('<?xml version="1.1" standalone="yes"?><foo/>...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlroot (
xmlelement (
name gazonk,
@@ -457,126 +292,100 @@ SELECT xmlroot (
version '1.0',
standalone yes
);
- xmlroot
-------------------------------------------------------------------------------------------
- <?xml version="1.0" standalone="yes"?><gazonk name="val" num="2"><qux>foo</qux></gazonk>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlserialize(content data as character varying(20)) FROM xmltest;
- xmlserialize
---------------------
- <value>one</value>
- <value>two</value>
-(2 rows)
-
-SELECT xmlserialize(content 'good' as char(10));
xmlserialize
--------------
- good
-(1 row)
+(0 rows)
+SELECT xmlserialize(content 'good' as char(10));
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(content 'good' as char(10));
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlserialize(document 'bad' as text);
-ERROR: not an XML document
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(document 'bad' as text);
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- indent
SELECT xmlserialize(DOCUMENT '<foo><bar><val x="y">42</val></bar></foo>' AS text INDENT);
- xmlserialize
--------------------------
- <foo> +
- <bar> +
- <val x="y">42</val>+
- </bar> +
- </foo>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(DOCUMENT '<foo><bar><val x="y">42</val><...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlserialize(CONTENT '<foo><bar><val x="y">42</val></bar></foo>' AS text INDENT);
- xmlserialize
--------------------------
- <foo> +
- <bar> +
- <val x="y">42</val>+
- </bar> +
- </foo>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(CONTENT '<foo><bar><val x="y">42</val><...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- no indent
SELECT xmlserialize(DOCUMENT '<foo><bar><val x="y">42</val></bar></foo>' AS text NO INDENT);
- xmlserialize
--------------------------------------------
- <foo><bar><val x="y">42</val></bar></foo>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(DOCUMENT '<foo><bar><val x="y">42</val><...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlserialize(CONTENT '<foo><bar><val x="y">42</val></bar></foo>' AS text NO INDENT);
- xmlserialize
--------------------------------------------
- <foo><bar><val x="y">42</val></bar></foo>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(CONTENT '<foo><bar><val x="y">42</val><...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- indent non singly-rooted xml
SELECT xmlserialize(DOCUMENT '<foo>73</foo><bar><val x="y">42</val></bar>' AS text INDENT);
-ERROR: not an XML document
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(DOCUMENT '<foo>73</foo><bar><val x="y">4...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlserialize(CONTENT '<foo>73</foo><bar><val x="y">42</val></bar>' AS text INDENT);
- xmlserialize
------------------------
- <foo>73</foo> +
- <bar> +
- <val x="y">42</val>+
- </bar>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(CONTENT '<foo>73</foo><bar><val x="y">4...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- indent non singly-rooted xml with mixed contents
SELECT xmlserialize(DOCUMENT 'text node<foo>73</foo>text node<bar><val x="y">42</val></bar>' AS text INDENT);
-ERROR: not an XML document
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(DOCUMENT 'text node<foo>73</foo>text nod...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlserialize(CONTENT 'text node<foo>73</foo>text node<bar><val x="y">42</val></bar>' AS text INDENT);
- xmlserialize
-------------------------
- text node +
- <foo>73</foo>text node+
- <bar> +
- <val x="y">42</val> +
- </bar>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(CONTENT 'text node<foo>73</foo>text nod...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- indent singly-rooted xml with mixed contents
SELECT xmlserialize(DOCUMENT '<foo><bar><val x="y">42</val><val x="y">text node<val>73</val></val></bar></foo>' AS text INDENT);
- xmlserialize
----------------------------------------------
- <foo> +
- <bar> +
- <val x="y">42</val> +
- <val x="y">text node<val>73</val></val>+
- </bar> +
- </foo>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(DOCUMENT '<foo><bar><val x="y">42</val><...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlserialize(CONTENT '<foo><bar><val x="y">42</val><val x="y">text node<val>73</val></val></bar></foo>' AS text INDENT);
- xmlserialize
----------------------------------------------
- <foo> +
- <bar> +
- <val x="y">42</val> +
- <val x="y">text node<val>73</val></val>+
- </bar> +
- </foo>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(CONTENT '<foo><bar><val x="y">42</val><...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- indent empty string
SELECT xmlserialize(DOCUMENT '' AS text INDENT);
-ERROR: not an XML document
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(DOCUMENT '' AS text INDENT);
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlserialize(CONTENT '' AS text INDENT);
- xmlserialize
---------------
-
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(CONTENT '' AS text INDENT);
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- whitespaces
SELECT xmlserialize(DOCUMENT ' ' AS text INDENT);
-ERROR: not an XML document
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(DOCUMENT ' ' AS text INDENT);
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlserialize(CONTENT ' ' AS text INDENT);
- xmlserialize
---------------
-
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(CONTENT ' ' AS text INDENT);
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- indent null
SELECT xmlserialize(DOCUMENT NULL AS text INDENT);
xmlserialize
@@ -592,125 +401,88 @@ SELECT xmlserialize(CONTENT NULL AS text INDENT);
-- indent with XML declaration
SELECT xmlserialize(DOCUMENT '<?xml version="1.0" encoding="UTF-8"?><foo><bar><val>73</val></bar></foo>' AS text INDENT);
- xmlserialize
-----------------------------------------
- <?xml version="1.0" encoding="UTF-8"?>+
- <foo> +
- <bar> +
- <val>73</val> +
- </bar> +
- </foo>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(DOCUMENT '<?xml version="1.0" encoding="...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlserialize(CONTENT '<?xml version="1.0" encoding="UTF-8"?><foo><bar><val>73</val></bar></foo>' AS text INDENT);
- xmlserialize
--------------------
- <foo> +
- <bar> +
- <val>73</val>+
- </bar> +
- </foo>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(CONTENT '<?xml version="1.0" encoding="...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- indent containing DOCTYPE declaration
SELECT xmlserialize(DOCUMENT '<!DOCTYPE a><a/>' AS text INDENT);
- xmlserialize
---------------
- <!DOCTYPE a>+
- <a/>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(DOCUMENT '<!DOCTYPE a><a/>' AS text INDE...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlserialize(CONTENT '<!DOCTYPE a><a/>' AS text INDENT);
- xmlserialize
---------------
- <!DOCTYPE a>+
- <a/> +
-
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(CONTENT '<!DOCTYPE a><a/>' AS text INDE...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- indent xml with empty element
SELECT xmlserialize(DOCUMENT '<foo><bar></bar></foo>' AS text INDENT);
- xmlserialize
---------------
- <foo> +
- <bar/> +
- </foo>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(DOCUMENT '<foo><bar></bar></foo>' AS tex...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlserialize(CONTENT '<foo><bar></bar></foo>' AS text INDENT);
- xmlserialize
---------------
- <foo> +
- <bar/> +
- </foo>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(CONTENT '<foo><bar></bar></foo>' AS tex...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- 'no indent' = not using 'no indent'
SELECT xmlserialize(DOCUMENT '<foo><bar><val x="y">42</val></bar></foo>' AS text) = xmlserialize(DOCUMENT '<foo><bar><val x="y">42</val></bar></foo>' AS text NO INDENT);
- ?column?
-----------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(DOCUMENT '<foo><bar><val x="y">42</val><...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlserialize(CONTENT '<foo><bar><val x="y">42</val></bar></foo>' AS text) = xmlserialize(CONTENT '<foo><bar><val x="y">42</val></bar></foo>' AS text NO INDENT);
- ?column?
-----------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(CONTENT '<foo><bar><val x="y">42</val><...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- indent xml strings containing blank nodes
SELECT xmlserialize(DOCUMENT '<foo> <bar></bar> </foo>' AS text INDENT);
- xmlserialize
---------------
- <foo> +
- <bar/> +
- </foo>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(DOCUMENT '<foo> <bar></bar> </foo>'...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlserialize(CONTENT 'text node<foo> <bar></bar> </foo>' AS text INDENT);
- xmlserialize
---------------
- text node +
- <foo> +
- <bar/> +
- </foo>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmlserialize(CONTENT 'text node<foo> <bar></bar> ...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml '<foo>bar</foo>' IS DOCUMENT;
- ?column?
-----------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<foo>bar</foo>' IS DOCUMENT;
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
- ?column?
-----------
- f
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<foo>bar</foo><bar>foo</bar>' IS DOCUMENT;
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml '<abc/>' IS NOT DOCUMENT;
- ?column?
-----------
- f
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<abc/>' IS NOT DOCUMENT;
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml 'abc' IS NOT DOCUMENT;
- ?column?
-----------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xml 'abc' IS NOT DOCUMENT;
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT '<>' IS NOT DOCUMENT;
-ERROR: invalid XML content
+ERROR: unsupported XML feature
LINE 1: SELECT '<>' IS NOT DOCUMENT;
^
-DETAIL: line 1: StartTag: invalid element name
-<>
- ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlagg(data) FROM xmltest;
- xmlagg
---------------------------------------
- <value>one</value><value>two</value>
+ xmlagg
+--------
+
(1 row)
SELECT xmlagg(data) FROM xmltest WHERE id > 10;
@@ -720,226 +492,191 @@ SELECT xmlagg(data) FROM xmltest WHERE id > 10;
(1 row)
SELECT xmlelement(name employees, xmlagg(xmlelement(name name, name))) FROM emp;
- xmlelement
---------------------------------------------------------------------------------------------------------------------------------
- <employees><name>sharon</name><name>sam</name><name>bill</name><name>jeff</name><name>cim</name><name>linda</name></employees>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
-- Check mapping SQL identifier to XML name
SELECT xmlpi(name ":::_xml_abc135.%-&_");
- xmlpi
--------------------------------------------------
- <?_x003A_::_x005F_xml_abc135._x0025_-_x0026__?>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlpi(name "123");
- xmlpi
----------------
- <?_x0031_23?>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
+ERROR: unsupported XML feature
+LINE 1: PREPARE foo (xml) AS SELECT xmlconcat('<foo/>', $1);
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SET XML OPTION DOCUMENT;
EXECUTE foo ('<bar/>');
- xmlconcat
---------------
- <foo/><bar/>
-(1 row)
-
+ERROR: prepared statement "foo" does not exist
EXECUTE foo ('bad');
-ERROR: invalid XML document
-LINE 1: EXECUTE foo ('bad');
- ^
-DETAIL: line 1: Start tag expected, '<' not found
-bad
-^
+ERROR: prepared statement "foo" does not exist
SELECT xml '<!DOCTYPE a><a/><b/>';
-ERROR: invalid XML document
+ERROR: unsupported XML feature
LINE 1: SELECT xml '<!DOCTYPE a><a/><b/>';
^
-DETAIL: line 1: Extra content at the end of the document
-<!DOCTYPE a><a/><b/>
- ^
+DETAIL: This functionality requires the server to be built with libxml support.
SET XML OPTION CONTENT;
EXECUTE foo ('<bar/>');
- xmlconcat
---------------
- <foo/><bar/>
-(1 row)
-
+ERROR: prepared statement "foo" does not exist
EXECUTE foo ('good');
- xmlconcat
-------------
- <foo/>good
-(1 row)
-
+ERROR: prepared statement "foo" does not exist
SELECT xml '<!-- in SQL:2006+ a doc is content too--> <?y z?> <!DOCTYPE a><a/>';
- xml
---------------------------------------------------------------------
- <!-- in SQL:2006+ a doc is content too--> <?y z?> <!DOCTYPE a><a/>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<!-- in SQL:2006+ a doc is content too--> <?y z?...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml '<?xml version="1.0"?> <!-- hi--> <!DOCTYPE a><a/>';
- xml
-------------------------------
- <!-- hi--> <!DOCTYPE a><a/>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<?xml version="1.0"?> <!-- hi--> <!DOCTYPE a><a/...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml '<!DOCTYPE a><a/>';
- xml
-------------------
- <!DOCTYPE a><a/>
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xml '<!DOCTYPE a><a/>';
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
-ERROR: invalid XML content
+ERROR: unsupported XML feature
LINE 1: SELECT xml '<!-- hi--> oops <!DOCTYPE a><a/>';
^
-DETAIL: line 1: StartTag: invalid element name
-<!-- hi--> oops <!DOCTYPE a><a/>
- ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
-ERROR: invalid XML content
+ERROR: unsupported XML feature
LINE 1: SELECT xml '<!-- hi--> <oops/> <!DOCTYPE a><a/>';
^
-DETAIL: line 1: StartTag: invalid element name
-<!-- hi--> <oops/> <!DOCTYPE a><a/>
- ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml '<!DOCTYPE a><a/><b/>';
-ERROR: invalid XML content
+ERROR: unsupported XML feature
LINE 1: SELECT xml '<!DOCTYPE a><a/><b/>';
^
-DETAIL: line 1: Extra content at the end of the document
-<!DOCTYPE a><a/><b/>
- ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- Test backwards parsing
CREATE VIEW xmlview1 AS SELECT xmlcomment('test');
CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
+ERROR: unsupported XML feature
+LINE 1: CREATE VIEW xmlview2 AS SELECT xmlconcat('hello', 'you');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
CREATE VIEW xmlview3 AS SELECT xmlelement(name element, xmlattributes (1 as ":one:", 'deuce' as two), 'content&');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
CREATE VIEW xmlview4 AS SELECT xmlelement(name employee, xmlforest(name, age, salary as pay)) FROM emp;
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
CREATE VIEW xmlview5 AS SELECT xmlparse(content '<abc>x</abc>');
CREATE VIEW xmlview6 AS SELECT xmlpi(name foo, 'bar');
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version no value, standalone yes);
+ERROR: unsupported XML feature
+LINE 1: CREATE VIEW xmlview7 AS SELECT xmlroot(xml '<foo/>', version...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
CREATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as char(10));
+ERROR: unsupported XML feature
+LINE 1: ...EATE VIEW xmlview8 AS SELECT xmlserialize(content 'good' as ...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
CREATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as text);
+ERROR: unsupported XML feature
+LINE 1: ...EATE VIEW xmlview9 AS SELECT xmlserialize(content 'good' as ...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT table_name, view_definition FROM information_schema.views
WHERE table_name LIKE 'xmlview%' ORDER BY 1;
- table_name | view_definition
-------------+------------------------------------------------------------------------------------------------------------
+ table_name | view_definition
+------------+--------------------------------------------------------------------------------
xmlview1 | SELECT xmlcomment('test'::text) AS xmlcomment;
- xmlview2 | SELECT XMLCONCAT('hello'::xml, 'you'::xml) AS "xmlconcat";
- xmlview3 | SELECT XMLELEMENT(NAME element, XMLATTRIBUTES(1 AS ":one:", 'deuce' AS two), 'content&') AS "xmlelement";
- xmlview4 | SELECT XMLELEMENT(NAME employee, XMLFOREST(name AS name, age AS age, salary AS pay)) AS "xmlelement" +
- | FROM emp;
xmlview5 | SELECT XMLPARSE(CONTENT '<abc>x</abc>'::text STRIP WHITESPACE) AS "xmlparse";
- xmlview6 | SELECT XMLPI(NAME foo, 'bar'::text) AS "xmlpi";
- xmlview7 | SELECT XMLROOT('<foo/>'::xml, VERSION NO VALUE, STANDALONE YES) AS "xmlroot";
- xmlview8 | SELECT (XMLSERIALIZE(CONTENT 'good'::xml AS character(10)))::character(10) AS "xmlserialize";
- xmlview9 | SELECT XMLSERIALIZE(CONTENT 'good'::xml AS text) AS "xmlserialize";
-(9 rows)
+(2 rows)
-- Text XPath expressions evaluation
SELECT xpath('/value', data) FROM xmltest;
- xpath
-----------------------
- {<value>one</value>}
- {<value>two</value>}
-(2 rows)
+ xpath
+-------
+(0 rows)
SELECT xpath(NULL, NULL) IS NULL FROM xmltest;
?column?
----------
- t
- t
-(2 rows)
+(0 rows)
SELECT xpath('', '<!-- error -->');
-ERROR: empty XPath expression
-CONTEXT: SQL function "xpath" statement 1
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('', '<!-- error -->');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath('//text()', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
- xpath
-----------------
- {"number one"}
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('//text()', '<local:data xmlns:local="http://12...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath('//loc:piece/@id', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
- xpath
--------
- {1,2}
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('//loc:piece/@id', '<local:data xmlns:local="ht...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
- xpath
-------------------------------------------------------------------------------------------------------------------------------------------------
- {"<local:piece xmlns:local=\"http://127.0.0.1\" id=\"1\">number one</local:piece>","<local:piece xmlns:local=\"http://127.0.0.1\" id=\"2\"/>"}
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('//loc:piece', '<local:data xmlns:local="http:/...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath('//loc:piece', '<local:data xmlns:local="http://127.0.0.1" xmlns="http://127.0.0.2"><local:piece id="1"><internal>number one</internal><internal2/></local:piece><local:piece id="2" /></local:data>', ARRAY[ARRAY['loc', 'http://127.0.0.1']]);
- xpath
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- {"<local:piece xmlns:local=\"http://127.0.0.1\" xmlns=\"http://127.0.0.2\" id=\"1\"><internal>number one</internal><internal2/></local:piece>","<local:piece xmlns:local=\"http://127.0.0.1\" id=\"2\"/>"}
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('//loc:piece', '<local:data xmlns:local="http:/...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>');
- xpath
--------------------------
- {<b>two</b>,<b>etc</b>}
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('//b', '<a>one <b>two</b> three <b>etc</b></a>'...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath('//text()', '<root><</root>');
- xpath
---------
- {<}
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('//text()', '<root><</root>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath('//@value', '<root value="<"/>');
- xpath
---------
- {<}
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('//@value', '<root value="<"/>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath('''<<invalid>>''', '<root/>');
- xpath
----------------------------
- {<<invalid>>}
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('''<<invalid>>''', '<root/>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
- xpath
--------
- {3}
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('count(//*)', '<root><sub/><sub/></root>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
- xpath
----------
- {false}
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('count(//*)=0', '<root><sub/><sub/></root>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
- xpath
---------
- {true}
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('count(//*)=3', '<root><sub/><sub/></root>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
- xpath
---------
- {root}
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('name(/*)', '<root><sub/><sub/></root>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath('/nosuchtag', '<root/>');
- xpath
--------
- {}
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('/nosuchtag', '<root/>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath('root', '<root/>');
- xpath
------------
- {<root/>}
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('root', '<root/>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- Round-trip non-ASCII data through xpath().
DO $$
DECLARE
@@ -977,45 +714,55 @@ END
$$;
-- Test xmlexists and xpath_exists
SELECT xmlexists('//town[text() = ''Toronto'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
- xmlexists
------------
- f
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: ...sts('//town[text() = ''Toronto'']' PASSING BY REF '<towns><t...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlexists('//town[text() = ''Cwmbran'']' PASSING BY REF '<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>');
- xmlexists
------------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: ...sts('//town[text() = ''Cwmbran'']' PASSING BY REF '<towns><t...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmlexists('count(/nosuchtag)' PASSING BY REF '<root/>');
- xmlexists
------------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: ...LECT xmlexists('count(/nosuchtag)' PASSING BY REF '<root/>')...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath_exists('//town[text() = ''Toronto'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
- xpath_exists
---------------
- f
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: ...ELECT xpath_exists('//town[text() = ''Toronto'']','<towns><t...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><town>Bidford-on-Avon</town><town>Cwmbran</town><town>Bristol</town></towns>'::xml);
- xpath_exists
---------------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: ...ELECT xpath_exists('//town[text() = ''Cwmbran'']','<towns><t...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
- xpath_exists
---------------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath_exists('count(/nosuchtag)', '<root/>'::xml);
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
INSERT INTO xmltest VALUES (4, '<menu><beers><name>Budvar</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest VALUES (4, '<menu><beers><name>Budvar</n...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
INSERT INTO xmltest VALUES (5, '<menu><beers><name>Molson</name><cost>free</cost><name>Carling</name><cost>lots</cost></beers></menu>'::xml);
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest VALUES (5, '<menu><beers><name>Molson</n...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
INSERT INTO xmltest VALUES (6, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Budvar</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest VALUES (6, '<myns:menu xmlns:myns="http:...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
INSERT INTO xmltest VALUES (7, '<myns:menu xmlns:myns="http://myns.com"><myns:beers><myns:name>Molson</myns:name><myns:cost>free</myns:cost><myns:name>Carling</myns:name><myns:cost>lots</myns:cost></myns:beers></myns:menu>'::xml);
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest VALUES (7, '<myns:menu xmlns:myns="http:...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING data);
count
-------
@@ -1031,13 +778,13 @@ SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING BY REF data B
SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers' PASSING BY REF data);
count
-------
- 2
+ 0
(1 row)
SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beers/name[text() = ''Molson'']' PASSING BY REF data);
count
-------
- 1
+ 0
(1 row)
SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
@@ -1049,13 +796,13 @@ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beer',data);
SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers',data);
count
-------
- 2
+ 0
(1 row)
SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/menu/beers/name[text() = ''Molson'']',data);
count
-------
- 1
+ 0
(1 row)
SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beer',data,ARRAY[ARRAY['myns','http://myns.com']]);
@@ -1067,13 +814,13 @@ SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beer',data,ARR
SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers',data,ARRAY[ARRAY['myns','http://myns.com']]);
count
-------
- 2
+ 0
(1 row)
SELECT COUNT(id) FROM xmltest WHERE xpath_exists('/myns:menu/myns:beers/myns:name[text() = ''Molson'']',data,ARRAY[ARRAY['myns','http://myns.com']]);
count
-------
- 1
+ 0
(1 row)
CREATE TABLE query ( expr TEXT );
@@ -1081,126 +828,69 @@ INSERT INTO query VALUES ('/menu/beers/cost[text() = ''lots'']');
SELECT COUNT(id) FROM xmltest, query WHERE xmlexists(expr PASSING BY REF data);
count
-------
- 2
+ 0
(1 row)
-- Test xml_is_well_formed and variants
SELECT xml_is_well_formed_document('<foo>bar</foo>');
- xml_is_well_formed_document
------------------------------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed_document('abc');
- xml_is_well_formed_document
------------------------------
- f
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed_content('<foo>bar</foo>');
- xml_is_well_formed_content
-----------------------------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed_content('abc');
- xml_is_well_formed_content
-----------------------------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SET xmloption TO DOCUMENT;
SELECT xml_is_well_formed('abc');
- xml_is_well_formed
---------------------
- f
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed('<>');
- xml_is_well_formed
---------------------
- f
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed('<abc/>');
- xml_is_well_formed
---------------------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed('<foo>bar</foo>');
- xml_is_well_formed
---------------------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed('<foo>bar</foo');
- xml_is_well_formed
---------------------
- f
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed('<foo><bar>baz</foo>');
- xml_is_well_formed
---------------------
- f
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed('<local:data xmlns:local="http://127.0.0.1"><local:piece id="1">number one</local:piece><local:piece id="2" /></local:data>');
- xml_is_well_formed
---------------------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</my:foo>');
- xml_is_well_formed
---------------------
- f
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed('<pg:foo xmlns:pg="http://postgresql.org/stuff">bar</pg:foo>');
- xml_is_well_formed
---------------------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed('<invalidentity>&</abc>');
- xml_is_well_formed
---------------------
- f
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed('<undefinedentity>&idontexist;</abc>');
- xml_is_well_formed
---------------------
- f
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed('<invalidns xmlns=''<''/>');
- xml_is_well_formed
---------------------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed('<relativens xmlns=''relative''/>');
- xml_is_well_formed
---------------------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xml_is_well_formed('<twoerrors>&idontexist;</unbalanced>');
- xml_is_well_formed
---------------------
- f
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SET xmloption TO CONTENT;
SELECT xml_is_well_formed('abc');
- xml_is_well_formed
---------------------
- t
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
-- Since xpath() deals with namespaces, it's a bit stricter about
-- what's well-formed and what's not. If we don't obey these rules
-- (i.e. ignore namespace-related errors from libxml), xpath()
@@ -1213,46 +903,32 @@ SELECT xml_is_well_formed('abc');
-- error messages, we suppress the DETAIL in this test.
\set VERBOSITY terse
SELECT xpath('/*', '<invalidns xmlns=''<''/>');
-ERROR: could not parse XML document
+ERROR: unsupported XML feature at character 20
\set VERBOSITY default
-- Again, the XML isn't well-formed for namespace purposes
SELECT xpath('/*', '<nosuchprefix:tag/>');
-ERROR: could not parse XML document
-DETAIL: line 1: Namespace prefix nosuchprefix on tag is not defined
-<nosuchprefix:tag/>
- ^
-CONTEXT: SQL function "xpath" statement 1
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('/*', '<nosuchprefix:tag/>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- XPath deprecates relative namespaces, but they're not supposed to
-- throw an error, only a warning.
SELECT xpath('/*', '<relativens xmlns=''relative''/>');
-WARNING: line 1: xmlns: URI relative is not absolute
-<relativens xmlns='relative'/>
- ^
- xpath
---------------------------------------
- {"<relativens xmlns=\"relative\"/>"}
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xpath('/*', '<relativens xmlns=''relative''/>');
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- External entity references should not leak filesystem information.
SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>');
- xmlparse
------------------------------------------------------------------
- <!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/passwd">]><foo>&c;</foo>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT XMLPARSE(DOCUMENT '<!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>');
- xmlparse
------------------------------------------------------------------------
- <!DOCTYPE foo [<!ENTITY c SYSTEM "/etc/no.such.file">]><foo>&c;</foo>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
-- This might or might not load the requested DTD, but it mustn't throw error.
SELECT XMLPARSE(DOCUMENT '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"><chapter> </chapter>');
- xmlparse
-------------------------------------------------------------------------------------------------------------------------------------------------------
- <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"><chapter> </chapter>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
-- XMLPATH tests
CREATE TABLE xmldata(data xml);
INSERT INTO xmldata VALUES('<ROWS>
@@ -1287,6 +963,10 @@ INSERT INTO xmldata VALUES('<ROWS>
<REGION_ID>3</REGION_ID><SIZE unit="km">791</SIZE>
</ROW>
</ROWS>');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmldata VALUES('<ROWS>
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- XMLTABLE with columns
SELECT xmltable.*
FROM (SELECT data FROM xmldata) x,
@@ -1300,15 +980,9 @@ SELECT xmltable.*
size float PATH 'SIZE',
unit text PATH 'SIZE/@unit',
premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
- id | _id | country_name | country_id | region_id | size | unit | premier_name
-----+-----+--------------+------------+-----------+------+------+---------------
- 1 | 1 | Australia | AU | 3 | | | not specified
- 2 | 2 | China | CN | 3 | | | not specified
- 3 | 3 | HongKong | HK | 3 | | | not specified
- 4 | 4 | India | IN | 3 | | | not specified
- 5 | 5 | Japan | JP | 3 | | | Sinzo Abe
- 6 | 6 | Singapore | SG | 3 | 791 | km | not specified
-(6 rows)
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+--------------
+(0 rows)
CREATE VIEW xmltableview1 AS SELECT xmltable.*
FROM (SELECT data FROM xmldata) x,
@@ -1323,15 +997,9 @@ CREATE VIEW xmltableview1 AS SELECT xmltable.*
unit text PATH 'SIZE/@unit',
premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
SELECT * FROM xmltableview1;
- id | _id | country_name | country_id | region_id | size | unit | premier_name
-----+-----+--------------+------------+-----------+------+------+---------------
- 1 | 1 | Australia | AU | 3 | | | not specified
- 2 | 2 | China | CN | 3 | | | not specified
- 3 | 3 | HongKong | HK | 3 | | | not specified
- 4 | 4 | India | IN | 3 | | | not specified
- 5 | 5 | Japan | JP | 3 | | | Sinzo Abe
- 6 | 6 | Singapore | SG | 3 | 791 | km | not specified
-(6 rows)
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+--------------
+(0 rows)
\sv xmltableview1
CREATE OR REPLACE VIEW public.xmltableview1 AS
@@ -1374,38 +1042,39 @@ SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS zz),
'/zz:rows/zz:row'
PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
COLUMNS a int PATH 'zz:a');
- a
-----
- 10
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 3: PASSING '<rows xmlns="http://x.y"><row...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
CREATE VIEW xmltableview2 AS SELECT * FROM XMLTABLE(XMLNAMESPACES('http://x.y' AS "Zz"),
'/Zz:rows/Zz:row'
PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
COLUMNS a int PATH 'Zz:a');
+ERROR: unsupported XML feature
+LINE 3: PASSING '<rows xmlns="http://x.y"><row...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT * FROM xmltableview2;
- a
-----
- 10
-(1 row)
-
+ERROR: relation "xmltableview2" does not exist
+LINE 1: SELECT * FROM xmltableview2;
+ ^
\sv xmltableview2
-CREATE OR REPLACE VIEW public.xmltableview2 AS
- SELECT a
- FROM XMLTABLE(XMLNAMESPACES ('http://x.y'::text AS "Zz"), ('/Zz:rows/Zz:row'::text) PASSING ('<rows xmlns="http://x.y"><row><a>10</a></row></rows>'::xml) COLUMNS a integer PATH ('Zz:a'::text))
+ERROR: relation "xmltableview2" does not exist
SELECT * FROM XMLTABLE(XMLNAMESPACES(DEFAULT 'http://x.y'),
'/rows/row'
PASSING '<rows xmlns="http://x.y"><row><a>10</a></row></rows>'
COLUMNS a int PATH 'a');
-ERROR: DEFAULT namespace is not supported
+ERROR: unsupported XML feature
+LINE 3: PASSING '<rows xmlns="http://x.y"><row...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT * FROM XMLTABLE('.'
PASSING '<foo/>'
COLUMNS a text PATH 'foo/namespace::node()');
- a
---------------------------------------
- http://www.w3.org/XML/1998/namespace
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 2: PASSING '<foo/>'
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- used in prepare statements
PREPARE pp AS
SELECT xmltable.*
@@ -1421,110 +1090,72 @@ SELECT xmltable.*
unit text PATH 'SIZE/@unit',
premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
EXECUTE pp;
- id | _id | country_name | country_id | region_id | size | unit | premier_name
-----+-----+--------------+------------+-----------+------+------+---------------
- 1 | 1 | Australia | AU | 3 | | | not specified
- 2 | 2 | China | CN | 3 | | | not specified
- 3 | 3 | HongKong | HK | 3 | | | not specified
- 4 | 4 | India | IN | 3 | | | not specified
- 5 | 5 | Japan | JP | 3 | | | Sinzo Abe
- 6 | 6 | Singapore | SG | 3 | 791 | km | not specified
-(6 rows)
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+--------------
+(0 rows)
SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int);
COUNTRY_NAME | REGION_ID
--------------+-----------
- India | 3
- Japan | 3
-(2 rows)
+(0 rows)
SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY, "COUNTRY_NAME" text, "REGION_ID" int);
id | COUNTRY_NAME | REGION_ID
----+--------------+-----------
- 1 | India | 3
- 2 | Japan | 3
-(2 rows)
+(0 rows)
SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int);
id | COUNTRY_NAME | REGION_ID
----+--------------+-----------
- 4 | India | 3
- 5 | Japan | 3
-(2 rows)
+(0 rows)
SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id');
id
----
- 4
- 5
-(2 rows)
+(0 rows)
SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id FOR ORDINALITY);
id
----
- 1
- 2
-(2 rows)
+(0 rows)
SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH '.');
- id | COUNTRY_NAME | REGION_ID | rawdata
-----+--------------+-----------+------------------------------------------------------------------
- 4 | India | 3 | <ROW id="4"> +
- | | | <COUNTRY_ID>IN</COUNTRY_ID> +
- | | | <COUNTRY_NAME>India</COUNTRY_NAME> +
- | | | <REGION_ID>3</REGION_ID> +
- | | | </ROW>
- 5 | Japan | 3 | <ROW id="5"> +
- | | | <COUNTRY_ID>JP</COUNTRY_ID> +
- | | | <COUNTRY_NAME>Japan</COUNTRY_NAME> +
- | | | <REGION_ID>3</REGION_ID><PREMIER_NAME>Sinzo Abe</PREMIER_NAME>+
- | | | </ROW>
-(2 rows)
+ id | COUNTRY_NAME | REGION_ID | rawdata
+----+--------------+-----------+---------
+(0 rows)
SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS id int PATH '@id', "COUNTRY_NAME" text, "REGION_ID" int, rawdata xml PATH './*');
- id | COUNTRY_NAME | REGION_ID | rawdata
-----+--------------+-----------+-----------------------------------------------------------------------------------------------------------------------------
- 4 | India | 3 | <COUNTRY_ID>IN</COUNTRY_ID><COUNTRY_NAME>India</COUNTRY_NAME><REGION_ID>3</REGION_ID>
- 5 | Japan | 3 | <COUNTRY_ID>JP</COUNTRY_ID><COUNTRY_NAME>Japan</COUNTRY_NAME><REGION_ID>3</REGION_ID><PREMIER_NAME>Sinzo Abe</PREMIER_NAME>
-(2 rows)
+ id | COUNTRY_NAME | REGION_ID | rawdata
+----+--------------+-----------+---------
+(0 rows)
SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text);
- element
-----------------------
- a1aa2a bbbbxxxcccc
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT * FROM xmltable('/root' passing '<root><element>a1a<!...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT * FROM xmltable('/root' passing '<root><element>a1a<!-- aaaa -->a2a<?aaaaa?> <!--z--> bbbb<x>xxx</x>cccc</element></root>' COLUMNS element text PATH 'element/text()'); -- should fail
-ERROR: more than one value returned by column XPath expression
+ERROR: unsupported XML feature
+LINE 1: SELECT * FROM xmltable('/root' passing '<root><element>a1a<!...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- CDATA test
select * from xmltable('d/r' passing '<d><r><c><![CDATA[<hello> &"<>!<a>foo</a>]]></c></r><r><c>2</c></r></d>' columns c text);
- c
--------------------------
- <hello> &"<>!<a>foo</a>
- 2
-(2 rows)
-
+ERROR: unsupported XML feature
+LINE 1: select * from xmltable('d/r' passing '<d><r><c><![CDATA[<hel...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
-- XML builtin entities
SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>'</ent></a><a><ent>"</ent></a><a><ent>&</ent></a><a><ent><</ent></a><a><ent>></ent></a></x>' COLUMNS ent text);
- ent
------
- '
- "
- &
- <
- >
-(5 rows)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>'</en...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>'</ent></a><a><ent>"</ent></a><a><ent>&</ent></a><a><ent><</ent></a><a><ent>></ent></a></x>' COLUMNS ent xml);
- ent
-------------------
- <ent>'</ent>
- <ent>"</ent>
- <ent>&</ent>
- <ent><</ent>
- <ent>></ent>
-(5 rows)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT * FROM xmltable('/x/a' PASSING '<x><a><ent>'</en...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
EXPLAIN (VERBOSE, COSTS OFF)
SELECT xmltable.*
FROM (SELECT data FROM xmldata) x,
@@ -1553,8 +1184,7 @@ SELECT xmltable.*
SELECT xmltable.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) WHERE "COUNTRY_NAME" = 'Japan';
COUNTRY_NAME | REGION_ID
--------------+-----------
- Japan | 3
-(1 row)
+(0 rows)
EXPLAIN (VERBOSE, COSTS OFF)
SELECT f.* FROM xmldata, LATERAL xmltable('/ROWS/ROW[COUNTRY_NAME="Japan" or COUNTRY_NAME="India"]' PASSING data COLUMNS "COUNTRY_NAME" text, "REGION_ID" int) AS f WHERE "COUNTRY_NAME" = 'Japan';
@@ -1632,6 +1262,10 @@ INSERT INTO xmldata VALUES('<ROWS>
<REGION_ID>2</REGION_ID>
</ROW>
</ROWS>');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmldata VALUES('<ROWS>
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
INSERT INTO xmldata VALUES('<ROWS>
<ROW id="20">
<COUNTRY_ID>EG</COUNTRY_ID>
@@ -1644,6 +1278,10 @@ INSERT INTO xmldata VALUES('<ROWS>
<REGION_ID>1</REGION_ID>
</ROW>
</ROWS>');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmldata VALUES('<ROWS>
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmltable.*
FROM (SELECT data FROM xmldata) x,
LATERAL XMLTABLE('/ROWS/ROW'
@@ -1656,20 +1294,9 @@ SELECT xmltable.*
size float PATH 'SIZE',
unit text PATH 'SIZE/@unit',
premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
- id | _id | country_name | country_id | region_id | size | unit | premier_name
-----+-----+----------------+------------+-----------+------+------+---------------
- 1 | 1 | Australia | AU | 3 | | | not specified
- 2 | 2 | China | CN | 3 | | | not specified
- 3 | 3 | HongKong | HK | 3 | | | not specified
- 4 | 4 | India | IN | 3 | | | not specified
- 5 | 5 | Japan | JP | 3 | | | Sinzo Abe
- 6 | 6 | Singapore | SG | 3 | 791 | km | not specified
- 10 | 1 | Czech Republic | CZ | 2 | | | Milos Zeman
- 11 | 2 | Germany | DE | 2 | | | not specified
- 12 | 3 | France | FR | 2 | | | not specified
- 20 | 1 | Egypt | EG | 1 | | | not specified
- 21 | 2 | Sudan | SD | 1 | | | not specified
-(11 rows)
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+--------------
+(0 rows)
SELECT xmltable.*
FROM (SELECT data FROM xmldata) x,
@@ -1684,12 +1311,9 @@ SELECT xmltable.*
unit text PATH 'SIZE/@unit',
premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified')
WHERE region_id = 2;
- id | _id | country_name | country_id | region_id | size | unit | premier_name
-----+-----+----------------+------------+-----------+------+------+---------------
- 10 | 1 | Czech Republic | CZ | 2 | | | Milos Zeman
- 11 | 2 | Germany | DE | 2 | | | not specified
- 12 | 3 | France | FR | 2 | | | not specified
-(3 rows)
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+--------------
+(0 rows)
EXPLAIN (VERBOSE, COSTS OFF)
SELECT xmltable.*
@@ -1730,7 +1354,10 @@ SELECT xmltable.*
size float PATH 'SIZE' NOT NULL,
unit text PATH 'SIZE/@unit',
premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
-ERROR: null is not allowed in column "size"
+ id | _id | country_name | country_id | region_id | size | unit | premier_name
+----+-----+--------------+------------+-----------+------+------+--------------
+(0 rows)
+
-- if all is ok, then result is empty
-- one line xml test
WITH
@@ -1754,10 +1381,8 @@ WITH
proargtypes text))
SELECT * FROM z
EXCEPT SELECT * FROM x;
- proname | proowner | procost | pronargs | proargnames | proargtypes
----------+----------+---------+----------+-------------+-------------
-(0 rows)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
-- multi line xml test, result should be empty too
WITH
x AS (SELECT proname, proowner, procost::numeric, pronargs,
@@ -1780,63 +1405,60 @@ WITH
proargtypes text))
SELECT * FROM z
EXCEPT SELECT * FROM x;
- proname | proowner | procost | pronargs | proargnames | proargtypes
----------+----------+---------+----------+-------------+-------------
-(0 rows)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
CREATE TABLE xmltest2(x xml, _path text);
INSERT INTO xmltest2 VALUES('<d><r><ac>1</ac></r></d>', 'A');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest2 VALUES('<d><r><ac>1</ac></r></d>', 'A')...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
INSERT INTO xmltest2 VALUES('<d><r><bc>2</bc></r></d>', 'B');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest2 VALUES('<d><r><bc>2</bc></r></d>', 'B')...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
INSERT INTO xmltest2 VALUES('<d><r><cc>3</cc></r></d>', 'C');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest2 VALUES('<d><r><cc>3</cc></r></d>', 'C')...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
INSERT INTO xmltest2 VALUES('<d><r><dc>2</dc></r></d>', 'D');
+ERROR: unsupported XML feature
+LINE 1: INSERT INTO xmltest2 VALUES('<d><r><dc>2</dc></r></d>', 'D')...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmltable.* FROM xmltest2, LATERAL xmltable('/d/r' PASSING x COLUMNS a int PATH '' || lower(_path) || 'c');
a
---
- 1
- 2
- 3
- 2
-(4 rows)
+(0 rows)
SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH '.');
a
---
- 1
- 2
- 3
- 2
-(4 rows)
+(0 rows)
SELECT xmltable.* FROM xmltest2, LATERAL xmltable(('/d/r/' || lower(_path) || 'c') PASSING x COLUMNS a int PATH 'x' DEFAULT ascii(_path) - 54);
- a
-----
- 11
- 12
- 13
- 14
-(4 rows)
+ a
+---
+(0 rows)
-- XPath result can be boolean or number too
SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml PATH '.', b text PATH '.', c text PATH '"hi"', d boolean PATH '. = "a"', e integer PATH 'string-length(.)');
- a | b | c | d | e
-----------+---+----+---+---
- <a>a</a> | a | hi | t | 1
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT * FROM XMLTABLE('*' PASSING '<a>a</a>' COLUMNS a xml ...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
\x
SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&deep</n2>post</e>' COLUMNS x xml PATH '/e/n2', y xml PATH '/');
--[ RECORD 1 ]-----------------------------------------------------------
-x | <n2>&deep</n2>
-y | <e>pre<!--c1--><?pi arg?><![CDATA[&ent1]]><n2>&deep</n2>post</e>+
- |
-
+ERROR: unsupported XML feature
+LINE 1: SELECT * FROM XMLTABLE('*' PASSING '<e>pre<!--c1--><?pi arg?...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
\x
SELECT * FROM XMLTABLE('.' PASSING XMLELEMENT(NAME a) columns a varchar(20) PATH '"<foo/>"', b xml PATH '"<foo/>"');
- a | b
---------+--------------
- <foo/> | <foo/>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmltext(NULL);
xmltext
---------
@@ -1844,32 +1466,19 @@ SELECT xmltext(NULL);
(1 row)
SELECT xmltext('');
- xmltext
----------
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmltext(' ');
- xmltext
----------
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmltext('foo `$_-+?=*^%!|/\()[]{}');
- xmltext
---------------------------
- foo `$_-+?=*^%!|/\()[]{}
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmltext('foo & <"bar">');
- xmltext
------------------------------------
- foo & <"bar">
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT xmltext('x'|| '<P>73</P>'::xml || .42 || true || 'j'::char);
- xmltext
----------------------------------
- x<P>73</P>0.42truej
-(1 row)
-
+ERROR: unsupported XML feature
+LINE 1: SELECT xmltext('x'|| '<P>73</P>'::xml || .42 || true || 'j':...
+ ^
+DETAIL: This functionality requires the server to be built with libxml support.
diff --git a/src/test/regress/expected/xmlmap.out b/src/test/regress/expected/xmlmap.out
index ccc54606630..05c5d3eb8a2 100644
--- a/src/test/regress/expected/xmlmap.out
+++ b/src/test/regress/expected/xmlmap.out
@@ -12,1270 +12,85 @@ INSERT INTO testxmlschema.test2 VALUES (55, 'abc', 'def',
'21:07', '21:11 +05', '2009-06-08 21:07:30', '2009-06-08 21:07:30 -07', '2009-06-08',
NULL, 'ABC', true, 'XYZ');
SELECT table_to_xml('testxmlschema.test1', false, false, '');
- table_to_xml
----------------------------------------------------------------
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- +
- <row> +
- <a>1</a> +
- <b>one</b> +
- </row> +
- +
- <row> +
- <a>2</a> +
- <b>two</b> +
- </row> +
- +
- <row> +
- <a>-1</a> +
- </row> +
- +
- </test1> +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT table_to_xml('testxmlschema.test1', true, false, 'foo');
- table_to_xml
----------------------------------------------------------------------------
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="foo">+
- +
- <row> +
- <a>1</a> +
- <b>one</b> +
- </row> +
- +
- <row> +
- <a>2</a> +
- <b>two</b> +
- </row> +
- +
- <row> +
- <a>-1</a> +
- <b xsi:nil="true"/> +
- </row> +
- +
- </test1> +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT table_to_xml('testxmlschema.test1', false, true, '');
- table_to_xml
----------------------------------------------------------------
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- <a>1</a> +
- <b>one</b> +
- </test1> +
- +
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- <a>2</a> +
- <b>two</b> +
- </test1> +
- +
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- <a>-1</a> +
- </test1> +
- +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT table_to_xml('testxmlschema.test1', true, true, '');
- table_to_xml
----------------------------------------------------------------
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- <a>1</a> +
- <b>one</b> +
- </test1> +
- +
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- <a>2</a> +
- <b>two</b> +
- </test1> +
- +
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- <a>-1</a> +
- <b xsi:nil="true"/> +
- </test1> +
- +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT table_to_xml('testxmlschema.test2', false, false, '');
- table_to_xml
----------------------------------------------------------------
- <test2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- +
- <row> +
- <z>55</z> +
- <y>abc</y> +
- <x>def </x> +
- <w>98.60</w> +
- <v>2</v> +
- <u>999</u> +
- <t>0</t> +
- <s>21:07:00</s> +
- <stz>21:11:00+05</stz> +
- <r>2009-06-08T21:07:30</r> +
- <rtz>2009-06-08T21:07:30-07:00</rtz> +
- <q>2009-06-08</q> +
- <o>ABC</o> +
- <n>true</n> +
- <m>WFla</m> +
- </row> +
- +
- </test2> +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT table_to_xmlschema('testxmlschema.test1', false, false, '');
- table_to_xmlschema
------------------------------------------------------------------------------------------------------------------
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.text"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="RowType.regression.testxmlschema.test1"> +
- <xsd:sequence> +
- <xsd:element name="a" type="INTEGER" minOccurs="0"></xsd:element> +
- <xsd:element name="b" type="UDT.regression.pg_catalog.text" minOccurs="0"></xsd:element> +
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:complexType name="TableType.regression.testxmlschema.test1"> +
- <xsd:sequence> +
- <xsd:element name="row" type="RowType.regression.testxmlschema.test1" minOccurs="0" maxOccurs="unbounded"/>+
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:element name="test1" type="TableType.regression.testxmlschema.test1"/> +
- +
- </xsd:schema>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT table_to_xmlschema('testxmlschema.test1', true, false, '');
- table_to_xmlschema
------------------------------------------------------------------------------------------------------------------
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.text"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="RowType.regression.testxmlschema.test1"> +
- <xsd:sequence> +
- <xsd:element name="a" type="INTEGER" nillable="true"></xsd:element> +
- <xsd:element name="b" type="UDT.regression.pg_catalog.text" nillable="true"></xsd:element> +
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:complexType name="TableType.regression.testxmlschema.test1"> +
- <xsd:sequence> +
- <xsd:element name="row" type="RowType.regression.testxmlschema.test1" minOccurs="0" maxOccurs="unbounded"/>+
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:element name="test1" type="TableType.regression.testxmlschema.test1"/> +
- +
- </xsd:schema>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT table_to_xmlschema('testxmlschema.test1', false, true, 'foo');
- table_to_xmlschema
-----------------------------------------------------------------------------------------------
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" +
- targetNamespace="foo" +
- elementFormDefault="qualified"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.text"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="RowType.regression.testxmlschema.test1"> +
- <xsd:sequence> +
- <xsd:element name="a" type="INTEGER" minOccurs="0"></xsd:element> +
- <xsd:element name="b" type="UDT.regression.pg_catalog.text" minOccurs="0"></xsd:element>+
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:element name="test1" type="RowType.regression.testxmlschema.test1"/> +
- +
- </xsd:schema>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT table_to_xmlschema('testxmlschema.test1', true, true, '');
- table_to_xmlschema
-------------------------------------------------------------------------------------------------
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.text"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="RowType.regression.testxmlschema.test1"> +
- <xsd:sequence> +
- <xsd:element name="a" type="INTEGER" nillable="true"></xsd:element> +
- <xsd:element name="b" type="UDT.regression.pg_catalog.text" nillable="true"></xsd:element>+
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:element name="test1" type="RowType.regression.testxmlschema.test1"/> +
- +
- </xsd:schema>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT table_to_xmlschema('testxmlschema.test2', false, false, '');
- table_to_xmlschema
-----------------------------------------------------------------------------------------------------------------------------
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="VARCHAR"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="CHAR"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="NUMERIC"> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="SMALLINT"> +
- <xsd:restriction base="xsd:short"> +
- <xsd:maxInclusive value="32767"/> +
- <xsd:minInclusive value="-32768"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="BIGINT"> +
- <xsd:restriction base="xsd:long"> +
- <xsd:maxInclusive value="9223372036854775807"/> +
- <xsd:minInclusive value="-9223372036854775808"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="REAL"> +
- <xsd:restriction base="xsd:float"></xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIME"> +
- <xsd:restriction base="xsd:time"> +
- <xsd:pattern value="\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIME_WTZ"> +
- <xsd:restriction base="xsd:time"> +
- <xsd:pattern value="\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?(\+|-)\p{Nd}{2}:\p{Nd}{2}"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIMESTAMP"> +
- <xsd:restriction base="xsd:dateTime"> +
- <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}T\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIMESTAMP_WTZ"> +
- <xsd:restriction base="xsd:dateTime"> +
- <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}T\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?(\+|-)\p{Nd}{2}:\p{Nd}{2}"/>+
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="DATE"> +
- <xsd:restriction base="xsd:date"> +
- <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType mixed="true"> +
- <xsd:sequence> +
- <xsd:any name="element" minOccurs="0" maxOccurs="unbounded" processContents="skip"/> +
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:simpleType name="Domain.regression.public.testxmldomain"> +
- <xsd:restriction base="VARCHAR"/> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="BOOLEAN"> +
- <xsd:restriction base="xsd:boolean"></xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.bytea"> +
- <xsd:restriction base="xsd:base64Binary"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="RowType.regression.testxmlschema.test2"> +
- <xsd:sequence> +
- <xsd:element name="z" type="INTEGER" minOccurs="0"></xsd:element> +
- <xsd:element name="y" type="VARCHAR" minOccurs="0"></xsd:element> +
- <xsd:element name="x" type="CHAR" minOccurs="0"></xsd:element> +
- <xsd:element name="w" type="NUMERIC" minOccurs="0"></xsd:element> +
- <xsd:element name="v" type="SMALLINT" minOccurs="0"></xsd:element> +
- <xsd:element name="u" type="BIGINT" minOccurs="0"></xsd:element> +
- <xsd:element name="t" type="REAL" minOccurs="0"></xsd:element> +
- <xsd:element name="s" type="TIME" minOccurs="0"></xsd:element> +
- <xsd:element name="stz" type="TIME_WTZ" minOccurs="0"></xsd:element> +
- <xsd:element name="r" type="TIMESTAMP" minOccurs="0"></xsd:element> +
- <xsd:element name="rtz" type="TIMESTAMP_WTZ" minOccurs="0"></xsd:element> +
- <xsd:element name="q" type="DATE" minOccurs="0"></xsd:element> +
- <xsd:element name="p" type="XML" minOccurs="0"></xsd:element> +
- <xsd:element name="o" type="Domain.regression.public.testxmldomain" minOccurs="0"></xsd:element> +
- <xsd:element name="n" type="BOOLEAN" minOccurs="0"></xsd:element> +
- <xsd:element name="m" type="UDT.regression.pg_catalog.bytea" minOccurs="0"></xsd:element> +
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:complexType name="TableType.regression.testxmlschema.test2"> +
- <xsd:sequence> +
- <xsd:element name="row" type="RowType.regression.testxmlschema.test2" minOccurs="0" maxOccurs="unbounded"/> +
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:element name="test2" type="TableType.regression.testxmlschema.test2"/> +
- +
- </xsd:schema>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT table_to_xml_and_xmlschema('testxmlschema.test1', false, false, '');
- table_to_xml_and_xmlschema
------------------------------------------------------------------------------------------------------------------
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="#"> +
- +
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.text"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="RowType.regression.testxmlschema.test1"> +
- <xsd:sequence> +
- <xsd:element name="a" type="INTEGER" minOccurs="0"></xsd:element> +
- <xsd:element name="b" type="UDT.regression.pg_catalog.text" minOccurs="0"></xsd:element> +
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:complexType name="TableType.regression.testxmlschema.test1"> +
- <xsd:sequence> +
- <xsd:element name="row" type="RowType.regression.testxmlschema.test1" minOccurs="0" maxOccurs="unbounded"/>+
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:element name="test1" type="TableType.regression.testxmlschema.test1"/> +
- +
- </xsd:schema> +
- +
- <row> +
- <a>1</a> +
- <b>one</b> +
- </row> +
- +
- <row> +
- <a>2</a> +
- <b>two</b> +
- </row> +
- +
- <row> +
- <a>-1</a> +
- </row> +
- +
- </test1> +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT table_to_xml_and_xmlschema('testxmlschema.test1', true, false, '');
- table_to_xml_and_xmlschema
------------------------------------------------------------------------------------------------------------------
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="#"> +
- +
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.text"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="RowType.regression.testxmlschema.test1"> +
- <xsd:sequence> +
- <xsd:element name="a" type="INTEGER" nillable="true"></xsd:element> +
- <xsd:element name="b" type="UDT.regression.pg_catalog.text" nillable="true"></xsd:element> +
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:complexType name="TableType.regression.testxmlschema.test1"> +
- <xsd:sequence> +
- <xsd:element name="row" type="RowType.regression.testxmlschema.test1" minOccurs="0" maxOccurs="unbounded"/>+
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:element name="test1" type="TableType.regression.testxmlschema.test1"/> +
- +
- </xsd:schema> +
- +
- <row> +
- <a>1</a> +
- <b>one</b> +
- </row> +
- +
- <row> +
- <a>2</a> +
- <b>two</b> +
- </row> +
- +
- <row> +
- <a>-1</a> +
- <b xsi:nil="true"/> +
- </row> +
- +
- </test1> +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT table_to_xml_and_xmlschema('testxmlschema.test1', false, true, '');
- table_to_xml_and_xmlschema
-----------------------------------------------------------------------------------------------
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.text"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="RowType.regression.testxmlschema.test1"> +
- <xsd:sequence> +
- <xsd:element name="a" type="INTEGER" minOccurs="0"></xsd:element> +
- <xsd:element name="b" type="UDT.regression.pg_catalog.text" minOccurs="0"></xsd:element>+
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:element name="test1" type="RowType.regression.testxmlschema.test1"/> +
- +
- </xsd:schema> +
- +
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +
- <a>1</a> +
- <b>one</b> +
- </test1> +
- +
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +
- <a>2</a> +
- <b>two</b> +
- </test1> +
- +
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +
- <a>-1</a> +
- </test1> +
- +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT table_to_xml_and_xmlschema('testxmlschema.test1', true, true, 'foo');
- table_to_xml_and_xmlschema
-------------------------------------------------------------------------------------------------
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" +
- targetNamespace="foo" +
- elementFormDefault="qualified"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.text"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="RowType.regression.testxmlschema.test1"> +
- <xsd:sequence> +
- <xsd:element name="a" type="INTEGER" nillable="true"></xsd:element> +
- <xsd:element name="b" type="UDT.regression.pg_catalog.text" nillable="true"></xsd:element>+
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:element name="test1" type="RowType.regression.testxmlschema.test1"/> +
- +
- </xsd:schema> +
- +
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="foo"> +
- <a>1</a> +
- <b>one</b> +
- </test1> +
- +
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="foo"> +
- <a>2</a> +
- <b>two</b> +
- </test1> +
- +
- <test1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="foo"> +
- <a>-1</a> +
- <b xsi:nil="true"/> +
- </test1> +
- +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT query_to_xml('SELECT * FROM testxmlschema.test1', false, false, '');
- query_to_xml
----------------------------------------------------------------
- <table xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- +
- <row> +
- <a>1</a> +
- <b>one</b> +
- </row> +
- +
- <row> +
- <a>2</a> +
- <b>two</b> +
- </row> +
- +
- <row> +
- <a>-1</a> +
- </row> +
- +
- </table> +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT query_to_xmlschema('SELECT * FROM testxmlschema.test1', false, false, '');
- query_to_xmlschema
-----------------------------------------------------------------------------------------------
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.text"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="RowType"> +
- <xsd:sequence> +
- <xsd:element name="a" type="INTEGER" minOccurs="0"></xsd:element> +
- <xsd:element name="b" type="UDT.regression.pg_catalog.text" minOccurs="0"></xsd:element>+
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:complexType name="TableType"> +
- <xsd:sequence> +
- <xsd:element name="row" type="RowType" minOccurs="0" maxOccurs="unbounded"/> +
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:element name="table" type="TableType"/> +
- +
- </xsd:schema>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT query_to_xml_and_xmlschema('SELECT * FROM testxmlschema.test1', true, true, '');
- query_to_xml_and_xmlschema
-------------------------------------------------------------------------------------------------
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.text"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="RowType"> +
- <xsd:sequence> +
- <xsd:element name="a" type="INTEGER" nillable="true"></xsd:element> +
- <xsd:element name="b" type="UDT.regression.pg_catalog.text" nillable="true"></xsd:element>+
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:element name="row" type="RowType"/> +
- +
- </xsd:schema> +
- +
- <row xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +
- <a>1</a> +
- <b>one</b> +
- </row> +
- +
- <row xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +
- <a>2</a> +
- <b>two</b> +
- </row> +
- +
- <row xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +
- <a>-1</a> +
- <b xsi:nil="true"/> +
- </row> +
- +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
DECLARE xc CURSOR WITH HOLD FOR SELECT * FROM testxmlschema.test1 ORDER BY 1, 2;
SELECT cursor_to_xml('xc'::refcursor, 5, false, true, '');
- cursor_to_xml
--------------------------------------------------------------
- <row xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- <a>-1</a> +
- </row> +
- +
- <row xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- <a>1</a> +
- <b>one</b> +
- </row> +
- +
- <row xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- <a>2</a> +
- <b>two</b> +
- </row> +
- +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT cursor_to_xmlschema('xc'::refcursor, false, true, '');
- cursor_to_xmlschema
-----------------------------------------------------------------------------------------------
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.text"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="RowType"> +
- <xsd:sequence> +
- <xsd:element name="a" type="INTEGER" minOccurs="0"></xsd:element> +
- <xsd:element name="b" type="UDT.regression.pg_catalog.text" minOccurs="0"></xsd:element>+
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:element name="row" type="RowType"/> +
- +
- </xsd:schema>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
MOVE BACKWARD ALL IN xc;
SELECT cursor_to_xml('xc'::refcursor, 5, true, false, '');
- cursor_to_xml
----------------------------------------------------------------
- <table xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- +
- <row> +
- <a>-1</a> +
- <b xsi:nil="true"/> +
- </row> +
- +
- <row> +
- <a>1</a> +
- <b>one</b> +
- </row> +
- +
- <row> +
- <a>2</a> +
- <b>two</b> +
- </row> +
- +
- </table> +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT cursor_to_xmlschema('xc'::refcursor, true, false, '');
- cursor_to_xmlschema
-------------------------------------------------------------------------------------------------
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.text"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="RowType"> +
- <xsd:sequence> +
- <xsd:element name="a" type="INTEGER" nillable="true"></xsd:element> +
- <xsd:element name="b" type="UDT.regression.pg_catalog.text" nillable="true"></xsd:element>+
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:complexType name="TableType"> +
- <xsd:sequence> +
- <xsd:element name="row" type="RowType" minOccurs="0" maxOccurs="unbounded"/> +
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:element name="table" type="TableType"/> +
- +
- </xsd:schema>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT schema_to_xml('testxmlschema', false, true, '');
- schema_to_xml
------------------------------------------------------------------------
- <testxmlschema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- +
- <test1> +
- <a>1</a> +
- <b>one</b> +
- </test1> +
- +
- <test1> +
- <a>2</a> +
- <b>two</b> +
- </test1> +
- +
- <test1> +
- <a>-1</a> +
- </test1> +
- +
- +
- <test2> +
- <z>55</z> +
- <y>abc</y> +
- <x>def </x> +
- <w>98.60</w> +
- <v>2</v> +
- <u>999</u> +
- <t>0</t> +
- <s>21:07:00</s> +
- <stz>21:11:00+05</stz> +
- <r>2009-06-08T21:07:30</r> +
- <rtz>2009-06-08T21:07:30-07:00</rtz> +
- <q>2009-06-08</q> +
- <o>ABC</o> +
- <n>true</n> +
- <m>WFla</m> +
- </test2> +
- +
- +
- </testxmlschema> +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT schema_to_xml('testxmlschema', true, false, '');
- schema_to_xml
------------------------------------------------------------------------
- <testxmlschema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- +
- <test1> +
- +
- <row> +
- <a>1</a> +
- <b>one</b> +
- </row> +
- +
- <row> +
- <a>2</a> +
- <b>two</b> +
- </row> +
- +
- <row> +
- <a>-1</a> +
- <b xsi:nil="true"/> +
- </row> +
- +
- </test1> +
- +
- <test2> +
- +
- <row> +
- <z>55</z> +
- <y>abc</y> +
- <x>def </x> +
- <w>98.60</w> +
- <v>2</v> +
- <u>999</u> +
- <t>0</t> +
- <s>21:07:00</s> +
- <stz>21:11:00+05</stz> +
- <r>2009-06-08T21:07:30</r> +
- <rtz>2009-06-08T21:07:30-07:00</rtz> +
- <q>2009-06-08</q> +
- <p xsi:nil="true"/> +
- <o>ABC</o> +
- <n>true</n> +
- <m>WFla</m> +
- </row> +
- +
- </test2> +
- +
- </testxmlschema> +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT schema_to_xmlschema('testxmlschema', false, true, '');
- schema_to_xmlschema
-----------------------------------------------------------------------------------------------------------------------------
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.text"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="VARCHAR"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="CHAR"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="NUMERIC"> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="SMALLINT"> +
- <xsd:restriction base="xsd:short"> +
- <xsd:maxInclusive value="32767"/> +
- <xsd:minInclusive value="-32768"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="BIGINT"> +
- <xsd:restriction base="xsd:long"> +
- <xsd:maxInclusive value="9223372036854775807"/> +
- <xsd:minInclusive value="-9223372036854775808"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="REAL"> +
- <xsd:restriction base="xsd:float"></xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIME"> +
- <xsd:restriction base="xsd:time"> +
- <xsd:pattern value="\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIME_WTZ"> +
- <xsd:restriction base="xsd:time"> +
- <xsd:pattern value="\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?(\+|-)\p{Nd}{2}:\p{Nd}{2}"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIMESTAMP"> +
- <xsd:restriction base="xsd:dateTime"> +
- <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}T\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIMESTAMP_WTZ"> +
- <xsd:restriction base="xsd:dateTime"> +
- <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}T\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?(\+|-)\p{Nd}{2}:\p{Nd}{2}"/>+
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="DATE"> +
- <xsd:restriction base="xsd:date"> +
- <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType mixed="true"> +
- <xsd:sequence> +
- <xsd:any name="element" minOccurs="0" maxOccurs="unbounded" processContents="skip"/> +
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:simpleType name="Domain.regression.public.testxmldomain"> +
- <xsd:restriction base="VARCHAR"/> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="BOOLEAN"> +
- <xsd:restriction base="xsd:boolean"></xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.bytea"> +
- <xsd:restriction base="xsd:base64Binary"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="SchemaType.regression.testxmlschema"> +
- <xsd:sequence> +
- <xsd:element name="test1" type="RowType.regression.testxmlschema.test1" minOccurs="0" maxOccurs="unbounded"/> +
- <xsd:element name="test2" type="RowType.regression.testxmlschema.test2" minOccurs="0" maxOccurs="unbounded"/> +
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:element name="testxmlschema" type="SchemaType.regression.testxmlschema"/> +
- +
- </xsd:schema>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT schema_to_xmlschema('testxmlschema', true, false, '');
- schema_to_xmlschema
-----------------------------------------------------------------------------------------------------------------------------
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.text"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="VARCHAR"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="CHAR"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="NUMERIC"> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="SMALLINT"> +
- <xsd:restriction base="xsd:short"> +
- <xsd:maxInclusive value="32767"/> +
- <xsd:minInclusive value="-32768"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="BIGINT"> +
- <xsd:restriction base="xsd:long"> +
- <xsd:maxInclusive value="9223372036854775807"/> +
- <xsd:minInclusive value="-9223372036854775808"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="REAL"> +
- <xsd:restriction base="xsd:float"></xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIME"> +
- <xsd:restriction base="xsd:time"> +
- <xsd:pattern value="\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIME_WTZ"> +
- <xsd:restriction base="xsd:time"> +
- <xsd:pattern value="\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?(\+|-)\p{Nd}{2}:\p{Nd}{2}"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIMESTAMP"> +
- <xsd:restriction base="xsd:dateTime"> +
- <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}T\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIMESTAMP_WTZ"> +
- <xsd:restriction base="xsd:dateTime"> +
- <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}T\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?(\+|-)\p{Nd}{2}:\p{Nd}{2}"/>+
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="DATE"> +
- <xsd:restriction base="xsd:date"> +
- <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType mixed="true"> +
- <xsd:sequence> +
- <xsd:any name="element" minOccurs="0" maxOccurs="unbounded" processContents="skip"/> +
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:simpleType name="Domain.regression.public.testxmldomain"> +
- <xsd:restriction base="VARCHAR"/> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="BOOLEAN"> +
- <xsd:restriction base="xsd:boolean"></xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.bytea"> +
- <xsd:restriction base="xsd:base64Binary"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="SchemaType.regression.testxmlschema"> +
- <xsd:all> +
- <xsd:element name="test1" type="TableType.regression.testxmlschema.test1"/> +
- <xsd:element name="test2" type="TableType.regression.testxmlschema.test2"/> +
- </xsd:all> +
- </xsd:complexType> +
- +
- <xsd:element name="testxmlschema" type="SchemaType.regression.testxmlschema"/> +
- +
- </xsd:schema>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT schema_to_xml_and_xmlschema('testxmlschema', true, true, 'foo');
- schema_to_xml_and_xmlschema
-----------------------------------------------------------------------------------------------------------------------------
- <testxmlschema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="foo" xsi:schemaLocation="foo #"> +
- +
- <xsd:schema +
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" +
- targetNamespace="foo" +
- elementFormDefault="qualified"> +
- +
- <xsd:simpleType name="INTEGER"> +
- <xsd:restriction base="xsd:int"> +
- <xsd:maxInclusive value="2147483647"/> +
- <xsd:minInclusive value="-2147483648"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.text"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="VARCHAR"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="CHAR"> +
- <xsd:restriction base="xsd:string"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="NUMERIC"> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="SMALLINT"> +
- <xsd:restriction base="xsd:short"> +
- <xsd:maxInclusive value="32767"/> +
- <xsd:minInclusive value="-32768"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="BIGINT"> +
- <xsd:restriction base="xsd:long"> +
- <xsd:maxInclusive value="9223372036854775807"/> +
- <xsd:minInclusive value="-9223372036854775808"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="REAL"> +
- <xsd:restriction base="xsd:float"></xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIME"> +
- <xsd:restriction base="xsd:time"> +
- <xsd:pattern value="\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIME_WTZ"> +
- <xsd:restriction base="xsd:time"> +
- <xsd:pattern value="\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?(\+|-)\p{Nd}{2}:\p{Nd}{2}"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIMESTAMP"> +
- <xsd:restriction base="xsd:dateTime"> +
- <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}T\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="TIMESTAMP_WTZ"> +
- <xsd:restriction base="xsd:dateTime"> +
- <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}T\p{Nd}{2}:\p{Nd}{2}:\p{Nd}{2}(.\p{Nd}+)?(\+|-)\p{Nd}{2}:\p{Nd}{2}"/>+
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="DATE"> +
- <xsd:restriction base="xsd:date"> +
- <xsd:pattern value="\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}"/> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType mixed="true"> +
- <xsd:sequence> +
- <xsd:any name="element" minOccurs="0" maxOccurs="unbounded" processContents="skip"/> +
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:simpleType name="Domain.regression.public.testxmldomain"> +
- <xsd:restriction base="VARCHAR"/> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="BOOLEAN"> +
- <xsd:restriction base="xsd:boolean"></xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:simpleType name="UDT.regression.pg_catalog.bytea"> +
- <xsd:restriction base="xsd:base64Binary"> +
- </xsd:restriction> +
- </xsd:simpleType> +
- +
- <xsd:complexType name="SchemaType.regression.testxmlschema"> +
- <xsd:sequence> +
- <xsd:element name="test1" type="RowType.regression.testxmlschema.test1" minOccurs="0" maxOccurs="unbounded"/> +
- <xsd:element name="test2" type="RowType.regression.testxmlschema.test2" minOccurs="0" maxOccurs="unbounded"/> +
- </xsd:sequence> +
- </xsd:complexType> +
- +
- <xsd:element name="testxmlschema" type="SchemaType.regression.testxmlschema"/> +
- +
- </xsd:schema> +
- +
- <test1> +
- <a>1</a> +
- <b>one</b> +
- </test1> +
- +
- <test1> +
- <a>2</a> +
- <b>two</b> +
- </test1> +
- +
- <test1> +
- <a>-1</a> +
- <b xsi:nil="true"/> +
- </test1> +
- +
- +
- <test2> +
- <z>55</z> +
- <y>abc</y> +
- <x>def </x> +
- <w>98.60</w> +
- <v>2</v> +
- <u>999</u> +
- <t>0</t> +
- <s>21:07:00</s> +
- <stz>21:11:00+05</stz> +
- <r>2009-06-08T21:07:30</r> +
- <rtz>2009-06-08T21:07:30-07:00</rtz> +
- <q>2009-06-08</q> +
- <p xsi:nil="true"/> +
- <o>ABC</o> +
- <n>true</n> +
- <m>WFla</m> +
- </test2> +
- +
- +
- </testxmlschema> +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
-- test that domains are transformed like their base types
CREATE DOMAIN testboolxmldomain AS bool;
CREATE DOMAIN testdatexmldomain AS date;
@@ -1285,21 +100,8 @@ CREATE TABLE testxmlschema.test3
'2013-02-21'::date c3,
'2013-02-21'::testdatexmldomain c4;
SELECT xmlforest(c1, c2, c3, c4) FROM testxmlschema.test3;
- xmlforest
-------------------------------------------------------------------
- <c1>true</c1><c2>true</c2><c3>2013-02-21</c3><c4>2013-02-21</c4>
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
SELECT table_to_xml('testxmlschema.test3', true, true, '');
- table_to_xml
----------------------------------------------------------------
- <test3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">+
- <c1>true</c1> +
- <c2>true</c2> +
- <c3>2013-02-21</c3> +
- <c4>2013-02-21</c4> +
- </test3> +
- +
-
-(1 row)
-
+ERROR: unsupported XML feature
+DETAIL: This functionality requires the server to be built with libxml support.
--
2.47.1