This is an automated email from the ASF dual-hosted git repository.
chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/cbdb-postgres-merge by this
push:
new 54f30a6aada Fix some answer files
54f30a6aada is described below
commit 54f30a6aadae516061373fde75d2b6e6db346b27
Author: Jinbao Chen <[email protected]>
AuthorDate: Thu Dec 18 21:57:04 2025 +0800
Fix some answer files
---
src/test/regress/expected/case_gp.out | 52 ++++++-------
src/test/regress/expected/create_table_like_gp.out | 20 +++--
src/test/regress/expected/createdb.out | 7 +-
src/test/regress/expected/decode_expr.out | 8 +-
src/test/regress/expected/default_tablespace.out | 7 +-
src/test/regress/expected/filter.out | 3 +-
src/test/regress/expected/gp_create_view.out | 2 +-
src/test/regress/expected/gpdist.out | 18 +++--
src/test/regress/expected/join_gp.out | 43 +++++++----
src/test/regress/expected/notin.out | 42 +++++-----
src/test/regress/expected/replication_slots.out | 6 +-
src/test/regress/expected/window_views.out | 90 +++++++++++-----------
src/test/regress/sql/default_tablespace.sql | 8 +-
13 files changed, 162 insertions(+), 144 deletions(-)
diff --git a/src/test/regress/expected/case_gp.out
b/src/test/regress/expected/case_gp.out
index 153669cf994..21218b2b524 100644
--- a/src/test/regress/expected/case_gp.out
+++ b/src/test/regress/expected/case_gp.out
@@ -45,13 +45,13 @@ SELECT
END AS t
FROM mytable;
select pg_get_viewdef('notdisview2',true);
- pg_get_viewdef
--------------------------------------------------------------------------------
- SELECT +
- CASE +
- WHEN mytable.c::text IS NOT DISTINCT FROM ''::text THEN 'A'::text+
- ELSE 'B'::text +
- END AS t +
+ pg_get_viewdef
+-----------------------------------------------------------------------
+ SELECT +
+ CASE +
+ WHEN c::text IS NOT DISTINCT FROM ''::text THEN 'A'::text+
+ ELSE 'B'::text +
+ END AS t +
FROM mytable;
(1 row)
@@ -72,9 +72,9 @@ select pg_get_viewdef('notdisview3',false);
pg_get_viewdef
-----------------------------------------------------------------------------
SELECT +
- CASE mytable2.key_value +
+ CASE key_value +
WHEN IS NOT DISTINCT FROM 'NULL'::text THEN ('now'::text)::date+
- ELSE to_date((mytable2.key_value)::text, 'YYYYMM'::text) +
+ ELSE to_date((key_value)::text, 'YYYYMM'::text) +
END AS t +
FROM mytable2;
(1 row)
@@ -111,18 +111,18 @@ SELECT * FROM myview ORDER BY a,b;
-- Test deparse
select pg_get_viewdef('myview',true);
- pg_get_viewdef
--------------------------------------------------------------------------------------
- SELECT mytable.a,
+
- mytable.b,
+
- CASE mytable.a
+
- WHEN IS NOT DISTINCT FROM mytable.b THEN (mytable.b *
10)::numeric +
- WHEN IS NOT DISTINCT FROM mytable.b + 1 THEN (mytable.b *
100)::numeric+
- WHEN mytable.b - 1 THEN (mytable.b * 1000)::numeric
+
- WHEN mytable.b * 10 THEN (mytable.b * 10000)::numeric
+
- WHEN negate(mytable.b) THEN mytable.b::numeric * '-1.0'::numeric
+
- ELSE mytable.b::numeric
+
- END AS newb
+
+ pg_get_viewdef
+---------------------------------------------------------------------
+ SELECT a, +
+ b, +
+ CASE a +
+ WHEN IS NOT DISTINCT FROM b THEN (b * 10)::numeric +
+ WHEN IS NOT DISTINCT FROM b + 1 THEN (b * 100)::numeric+
+ WHEN b - 1 THEN (b * 1000)::numeric +
+ WHEN b * 10 THEN (b * 10000)::numeric +
+ WHEN negate(b) THEN b::numeric * '-1.0'::numeric +
+ ELSE b::numeric +
+ END AS newb +
FROM mytable;
(1 row)
@@ -296,10 +296,10 @@ SELECT * FROM myview ORDER BY id, location;
select pg_get_viewdef('myview',true);
pg_get_viewdef
--------------------------------------------------------------------
- SELECT products.id, +
- products.name, +
- products.price, +
- CASE products.id +
+ SELECT id, +
+ name, +
+ price, +
+ CASE id +
WHEN IS NOT DISTINCT FROM 1 THEN 'Southlake'::text +
WHEN IS NOT DISTINCT FROM 2 THEN 'San Francisco'::text+
WHEN IS NOT DISTINCT FROM 3 THEN 'New Jersey'::text +
@@ -310,7 +310,7 @@ select pg_get_viewdef('myview',true);
ELSE 'Non domestic'::text +
END AS location +
FROM products +
- WHERE products.id < 100;
+ WHERE id < 100;
(1 row)
-- User-defined DECODE function
diff --git a/src/test/regress/expected/create_table_like_gp.out
b/src/test/regress/expected/create_table_like_gp.out
index 42d85e68ab7..8cb92fbced0 100644
--- a/src/test/regress/expected/create_table_like_gp.out
+++ b/src/test/regress/expected/create_table_like_gp.out
@@ -34,11 +34,11 @@ WHERE
------------+-----------+-------------+--------------+---------------
t_ao | ao_column | t | | 0
t_ao_enc | ao_column | t | | 0
- t_ao_a | ao_column | t | | 0
- t_ao_b | ao_column | t | | 0
+ t_ao_a | heap | | |
+ t_ao_b | heap | | |
t_ao_c | heap | | |
- t_ao_enc_a | ao_column | t | | 0
- t_ao_d | ao_column | t | | 0
+ t_ao_enc_a | heap | | |
+ t_ao_d | ao_row | f | | 0
(7 rows)
SELECT
@@ -51,13 +51,11 @@ FROM
JOIN pg_catalog.pg_attribute_encoding a ON (a.attrelid = c.oid)
WHERE
c.relname like 't_ao_enc%';
- relname | attnum | filenum | attoptions
-------------+--------+---------+-----------------------------------------------------
- t_ao_enc | 2 | 2 |
{compresstype=zlib,compresslevel=1,blocksize=32768}
- t_ao_enc | 1 | 1 |
{compresstype=none,compresslevel=0,blocksize=32768}
- t_ao_enc_a | 2 | 2 |
{compresstype=zlib,compresslevel=1,blocksize=32768}
- t_ao_enc_a | 1 | 1 |
{compresstype=none,compresslevel=0,blocksize=32768}
-(4 rows)
+ relname | attnum | filenum | attoptions
+----------+--------+---------+-----------------------------------------------------
+ t_ao_enc | 2 | 2 |
{compresstype=zlib,compresslevel=1,blocksize=32768}
+ t_ao_enc | 1 | 1 |
{compresstype=none,compresslevel=0,blocksize=32768}
+(2 rows)
-- EXTERNAL TABLE
CREATE EXTERNAL TABLE t_ext (a integer) LOCATION ('file://127.0.0.1/tmp/foo')
FORMAT 'text';
diff --git a/src/test/regress/expected/createdb.out
b/src/test/regress/expected/createdb.out
index 97a7d9606a5..c7d261f5dcd 100644
--- a/src/test/regress/expected/createdb.out
+++ b/src/test/regress/expected/createdb.out
@@ -77,7 +77,7 @@ from gp_segment_configuration where content=0 and role='p';
-- should fail
create database db_with_leftover_files STRATEGY = file_copy;;
-ERROR: fault triggered, fault name:'create_db_after_file_copy' fault
type:'error'
+ERROR: fault triggered, fault name:'create_db_after_file_copy' fault
type:'error' (seg0 127.0.1.1:7002 pid=1195018)
-- Wait until replay_lsn = flush_lsn.
select force_mirrors_to_catch_up();
force_mirrors_to_catch_up
@@ -161,7 +161,7 @@ from gp_segment_configuration where content=0 and role='p';
-- should fail
create database db3 STRATEGY = file_copy;
-ERROR: fault triggered, fault name:'after_xlog_create_database' fault
type:'error'
+ERROR: fault triggered, fault name:'after_xlog_create_database' fault
type:'error' (seg0 127.0.1.1:7002 pid=1195018)
select force_mirrors_to_catch_up();
force_mirrors_to_catch_up
---------------------------
@@ -211,7 +211,8 @@ HINT: Inject an infinite 'skip' into the 'fts_probe' fault
to disable FTS probi
-- should fail
create database db4 STRATEGY = file_copy;
-ERROR: fault triggered, fault name:'end_prepare_two_phase' fault type:'panic'
+ERROR: fault triggered, fault name:'end_prepare_two_phase' fault type:'panic'
(seg0 127.0.1.1:7002 pid=1195018)
+NOTICE: Releasing segworker groups to retry broadcast.
select force_mirrors_to_catch_up();
force_mirrors_to_catch_up
---------------------------
diff --git a/src/test/regress/expected/decode_expr.out
b/src/test/regress/expected/decode_expr.out
index 7ed19939eac..bd1ce2cc2b5 100644
--- a/src/test/regress/expected/decode_expr.out
+++ b/src/test/regress/expected/decode_expr.out
@@ -1045,9 +1045,9 @@ order by locid, country_code;
country_code | character(2) | | | | extended |
region | text | | | | extended |
View definition:
- SELECT locations.bus_name,
- locations.country_code,
- CASE locations.country_code
+ SELECT bus_name,
+ country_code,
+ CASE country_code
WHEN IS NOT DISTINCT FROM 'US'::bpchar THEN 'Americas'::text
WHEN IS NOT DISTINCT FROM 'CA'::bpchar THEN 'Americas'::text
WHEN IS NOT DISTINCT FROM 'MX'::bpchar THEN 'Americas'::text
@@ -1062,7 +1062,7 @@ View definition:
ELSE NULL::text
END AS region
FROM locations
- ORDER BY locations.locid, locations.country_code;
+ ORDER BY locid, country_code;
select * from decode_view order by region, country_code;
bus_name | country_code | region
diff --git a/src/test/regress/expected/default_tablespace.out
b/src/test/regress/expected/default_tablespace.out
index 56e815de5f2..828c6e7c010 100644
--- a/src/test/regress/expected/default_tablespace.out
+++ b/src/test/regress/expected/default_tablespace.out
@@ -1,5 +1,8 @@
-create tablespace some_default_tablespace location
'@testtablespace@_default_tablespace';
-create tablespace some_database_tablespace location
'@testtablespace@_database_tablespace';
+\getenv abs_builddir PG_ABS_BUILDDIR
+\set default_tablespace :abs_builddir '/testtablespace_default_tablespace'
+\set database_tablespace :abs_builddir '/testtablespace_database_tablespace'
+create tablespace some_default_tablespace location :'default_tablespace';
+create tablespace some_database_tablespace location :'database_tablespace';
create database database_for_default_tablespace;
\c database_for_default_tablespace;
set default_tablespace to some_default_tablespace;
diff --git a/src/test/regress/expected/filter.out
b/src/test/regress/expected/filter.out
index 134b71c042e..edb4a71115b 100644
--- a/src/test/regress/expected/filter.out
+++ b/src/test/regress/expected/filter.out
@@ -561,7 +561,8 @@ select * from (select i from filter_test where j = 1) x1,
ERROR: invalid reference to FROM-clause entry for table "x1"
LINE 2: (select sum(i) filter (where i < x1.i) from fi...
^
-HINT: There is an entry for table "x1", but it cannot be referenced from this
part of the query.
+DETAIL: There is an entry for table "x1", but it cannot be referenced from
this part of the query.
+HINT: To reference that table, you must mark this subquery with LATERAL.
-- TEST against user defined aggregation function
create or replace function _maxodd(oldmax int, newval int) returns int as $$
SELECT CASE WHEN $1 is NULL
diff --git a/src/test/regress/expected/gp_create_view.out
b/src/test/regress/expected/gp_create_view.out
index 2e02be97bd5..c862e60abc3 100644
--- a/src/test/regress/expected/gp_create_view.out
+++ b/src/test/regress/expected/gp_create_view.out
@@ -119,7 +119,7 @@ CREATE TEMP VIEW view_with_gp_dist_random_special_chars AS
SELECT * FROM gp_dist
SELECT pg_get_viewdef('view_with_gp_dist_random_special_chars');
pg_get_viewdef
----------------------------------------------------------------------------
- SELECT "foo\'.bar".a +
+ SELECT a +
FROM gp_dist_random(E'"schema_view\\''.gp_dist_random"."foo\\''.bar"');
(1 row)
diff --git a/src/test/regress/expected/gpdist.out
b/src/test/regress/expected/gpdist.out
index dbe017b1f59..ca95fe4566b 100644
--- a/src/test/regress/expected/gpdist.out
+++ b/src/test/regress/expected/gpdist.out
@@ -669,20 +669,22 @@ create temporary table a as select generate_series(1, 5)
as i distributed by (i)
create temporary table b as select generate_series(2, 6) as i distributed by
(i);
create temporary table c as select generate_series(3, 7) as i distributed by
(i);
explain (costs off) select * from a full join b on (a.i=b.i) full join c on
(b.i=c.i);
- QUERY PLAN
-------------------------------------------
+ QUERY PLAN
+------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
-> Hash Full Join
Hash Cond: (b.i = c.i)
- -> Hash Full Join
- Hash Cond: (a.i = b.i)
- -> Seq Scan on a
- -> Hash
- -> Seq Scan on b
+ -> Redistribute Motion 3:3 (slice2; segments: 3)
+ Hash Key: b.i
+ -> Hash Full Join
+ Hash Cond: (a.i = b.i)
+ -> Seq Scan on a
+ -> Hash
+ -> Seq Scan on b
-> Hash
-> Seq Scan on c
Optimizer: Postgres query optimizer
-(11 rows)
+(13 rows)
select * from a full join b on (a.i=b.i) full join c on (b.i=c.i);
i | i | i
diff --git a/src/test/regress/expected/join_gp.out
b/src/test/regress/expected/join_gp.out
index 6e2a3af3955..1a7c1c7e291 100644
--- a/src/test/regress/expected/join_gp.out
+++ b/src/test/regress/expected/join_gp.out
@@ -341,12 +341,21 @@ create table bar (c int, d int) distributed randomly;
insert into foo select generate_series(1,10);
insert into bar select generate_series(1,10);
explain select a from foo where a<1 and a>1 and not exists (select c from bar
where c=a);
- QUERY PLAN
-------------------------------------------
- Result (cost=0.00..0.01 rows=1 width=0)
- One-Time Filter: false
- Optimizer status: Postgres query optimizer
-(3 rows)
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------
+ Gather Motion 3:1 (slice1; segments: 3) (cost=473.83..1458.05 rows=430
width=4)
+ -> Hash Right Anti Join (cost=473.83..1452.31 rows=144 width=4)
+ Hash Cond: (bar.c = foo.a)
+ -> Redistribute Motion 3:3 (slice2; segments: 3)
(cost=0.00..895.00 rows=28700 width=4)
+ Hash Key: bar.c
+ -> Seq Scan on bar (cost=0.00..321.00 rows=28700 width=4)
+ -> Hash (cost=470.24..470.24 rows=287 width=4)
+ -> Redistribute Motion 3:3 (slice3; segments: 3)
(cost=0.00..470.24 rows=287 width=4)
+ Hash Key: foo.a
+ -> Seq Scan on foo (cost=0.00..464.50 rows=287 width=4)
+ Filter: ((a < 1) AND (a > 1))
+ Optimizer: Postgres query optimizer
+(12 rows)
select a from foo where a<1 and a>1 and not exists (select c from bar where
c=a);
a
@@ -1953,17 +1962,17 @@ explain select fooJoinPruning.* from fooJoinPruning
left join barJoinPruning on
-- Unique key of inner relation ie 'p' is present in the join condition and is
equal to a column from outer relation but output columns are from inner
relation --
explain select barJoinPruning.* from fooJoinPruning left join barJoinPruning
on barJoinPruning.p=fooJoinPruning.b where fooJoinPruning.b>1000;
- QUERY PLAN
----------------------------------------------------------------------------------------------------
- Gather Motion 3:1 (slice1; segments: 3) (cost=618.25..1605.44 rows=25967
width=12)
- -> Hash Left Join (cost=618.25..1259.22 rows=8656 width=12)
- Hash Cond: (foojoinpruning.b = barjoinpruning.p)
- -> Redistribute Motion 3:3 (slice2; segments: 3)
(cost=0.00..531.69 rows=8656 width=4)
- Hash Key: foojoinpruning.b
- -> Seq Scan on foojoinpruning (cost=0.00..358.58 rows=8656
width=4)
- Filter: (b > 1000)
- -> Hash (cost=293.67..293.67 rows=25967 width=12)
- -> Seq Scan on barjoinpruning (cost=0.00..293.67 rows=25967
width=12)
+ QUERY PLAN
+---------------------------------------------------------------------------------------------------------
+ Gather Motion 3:1 (slice1; segments: 3) (cost=639.89..1551.60 rows=25967
width=12)
+ -> Hash Right Join (cost=639.89..1205.38 rows=8656 width=12)
+ Hash Cond: (barjoinpruning.p = foojoinpruning.b)
+ -> Seq Scan on barjoinpruning (cost=0.00..293.67 rows=25967
width=12)
+ -> Hash (cost=531.69..531.69 rows=8656 width=4)
+ -> Redistribute Motion 3:3 (slice2; segments: 3)
(cost=0.00..531.69 rows=8656 width=4)
+ Hash Key: foojoinpruning.b
+ -> Seq Scan on foojoinpruning (cost=0.00..358.58
rows=8656 width=4)
+ Filter: (b > 1000)
Optimizer: Postgres query optimizer
(10 rows)
diff --git a/src/test/regress/expected/notin.out
b/src/test/regress/expected/notin.out
index 5b1688fe00a..488e269ff84 100644
--- a/src/test/regress/expected/notin.out
+++ b/src/test/regress/expected/notin.out
@@ -1247,18 +1247,18 @@ select * from table_source3 where c3 = 'INC' and c4 =
'0000000001' and c2 not in
(0 rows)
explain select * from table_source4 where c3 = 'INC' and c4 = '0000000001' and
c2 not in (SELECT c1 from table_config where c2='test');
- QUERY PLAN
-------------------------------------------------------------------------------------------------
- Gather Motion 3:1 (slice1; segments: 3) (cost=9.33..10.54 rows=10 width=42)
- -> Hash Left Anti Semi (Not-In) Join (cost=9.33..10.41 rows=3 width=42)
- Hash Cond: ((table_source4.c2)::text = (table_config.c1)::text)
- -> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..1.03
rows=1 width=42)
- Hash Key: table_source4.c2
- -> Seq Scan on table_source4 (cost=0.00..1.01 rows=1 width=42)
- Filter: (((c3)::text = 'INC'::text) AND ((c4)::text =
'0000000001'::text))
- -> Hash (cost=5.17..5.17 rows=333 width=3)
- -> Seq Scan on table_config (cost=0.00..5.17 rows=333 width=3)
- Filter: ((c2)::text = 'test'::text)
+ QUERY PLAN
+-------------------------------------------------------------------------------------------------------
+ Gather Motion 3:1 (slice1; segments: 3) (cost=52.03..58.20 rows=10
width=872)
+ -> Hash Right Anti Join (cost=52.03..58.07 rows=3 width=872)
+ Hash Cond: ((table_config.c1)::text = (table_source4.c2)::text)
+ -> Seq Scan on table_config (cost=0.00..5.17 rows=333 width=3)
+ Filter: ((c2)::text = 'test'::text)
+ -> Hash (cost=52.02..52.02 rows=1 width=872)
+ -> Redistribute Motion 3:3 (slice2; segments: 3)
(cost=0.00..52.02 rows=1 width=872)
+ Hash Key: table_source4.c2
+ -> Seq Scan on table_source4 (cost=0.00..52.00 rows=1
width=872)
+ Filter: (((c3)::text = 'INC'::text) AND ((c4)::text
= '0000000001'::text))
Optimizer: Postgres query optimizer
(11 rows)
@@ -1415,15 +1415,15 @@ select * from t1_12930 where (a, b) not in (select a, b
from t2_12930);
(0 rows)
explain select * from t1_12930 where (a, b) not in (select a, b from t2_12930)
and b is not null;
- QUERY PLAN
-------------------------------------------------------------------------------------
- Gather Motion 3:1 (slice1; segments: 3) (cost=751.50..206932.71 rows=16
width=8)
- -> Hash Left Anti Semi (Not-In) Join (cost=751.50..206932.49 rows=5
width=8)
- Hash Cond: ((t1_12930.a = t2_12930.a) AND (t1_12930.b = t2_12930.b))
- -> Seq Scan on t1_12930 (cost=0.00..321.00 rows=28671 width=8)
- Filter: (b IS NOT NULL)
- -> Hash (cost=321.00..321.00 rows=28700 width=8)
- -> Seq Scan on t2_12930 (cost=0.00..321.00 rows=28700 width=8)
+ QUERY PLAN
+---------------------------------------------------------------------------------------
+ Gather Motion 3:1 (slice1; segments: 3) (cost=751.07..208007.32 rows=64510
width=8)
+ -> Hash Right Anti Join (cost=751.07..207147.18 rows=21503 width=8)
+ Hash Cond: ((t2_12930.a = t1_12930.a) AND (t2_12930.b = t1_12930.b))
+ -> Seq Scan on t2_12930 (cost=0.00..321.00 rows=28700 width=8)
+ -> Hash (cost=321.00..321.00 rows=28671 width=8)
+ -> Seq Scan on t1_12930 (cost=0.00..321.00 rows=28671 width=8)
+ Filter: (b IS NOT NULL)
Optimizer: Postgres query optimizer
(8 rows)
diff --git a/src/test/regress/expected/replication_slots.out
b/src/test/regress/expected/replication_slots.out
index 3fdec9b5c10..bc5de687bc6 100644
--- a/src/test/regress/expected/replication_slots.out
+++ b/src/test/regress/expected/replication_slots.out
@@ -11,9 +11,9 @@ HINT: Creating replication slots on a single segment is not
advised. Replicati
-- And I should see that my replication slot exists
select pg_get_replication_slots();
- pg_get_replication_slots
--------------------------------------------------
- (some_replication_slot,,physical,,f,f,,,,,,,,f)
+ pg_get_replication_slots
+--------------------------------------------------
+ (some_replication_slot,,physical,,f,f,,,,,,,,f,)
(1 row)
-- Cleanup:
diff --git a/src/test/regress/expected/window_views.out
b/src/test/regress/expected/window_views.out
index fe04dd7485c..accaf4d1b8c 100644
--- a/src/test/regress/expected/window_views.out
+++ b/src/test/regress/expected/window_views.out
@@ -9,9 +9,9 @@ create view v1 as
select avg(a) over (partition by b)
from testtab;
select pg_get_viewdef('v1');
- pg_get_viewdef
--------------------------------------------------------------
- SELECT avg(testtab.a) OVER (PARTITION BY testtab.b) AS avg+
+ pg_get_viewdef
+---------------------------------------------
+ SELECT avg(a) OVER (PARTITION BY b) AS avg+
FROM testtab;
(1 row)
@@ -19,9 +19,9 @@ create view v2 as
select avg(a) over (order by b)
from testtab;
select pg_get_viewdef('v2');
- pg_get_viewdef
----------------------------------------------------------
- SELECT avg(testtab.a) OVER (ORDER BY testtab.b) AS avg+
+ pg_get_viewdef
+-----------------------------------------
+ SELECT avg(a) OVER (ORDER BY b) AS avg+
FROM testtab;
(1 row)
@@ -29,9 +29,9 @@ create view v3 as
select avg(a) over (partition by a order by b)
from testtab;
select pg_get_viewdef('v3');
- pg_get_viewdef
---------------------------------------------------------------------------------
- SELECT avg(testtab.a) OVER (PARTITION BY testtab.a ORDER BY testtab.b) AS
avg+
+ pg_get_viewdef
+--------------------------------------------------------
+ SELECT avg(a) OVER (PARTITION BY a ORDER BY b) AS avg+
FROM testtab;
(1 row)
@@ -39,10 +39,10 @@ create view v4 as
select avg(a) over (w)
from testtab window w as ();
select pg_get_viewdef('v4');
- pg_get_viewdef
---------------------------------------
- SELECT avg(testtab.a) OVER w AS avg+
- FROM testtab +
+ pg_get_viewdef
+------------------------------
+ SELECT avg(a) OVER w AS avg+
+ FROM testtab +
WINDOW w AS ();
(1 row)
@@ -50,21 +50,21 @@ create view v5 as
select avg(a) over (w order by b)
from testtab window w as (partition by a);
select pg_get_viewdef('v5');
- pg_get_viewdef
------------------------------------------------------------
- SELECT avg(testtab.a) OVER (w ORDER BY testtab.b) AS avg+
- FROM testtab +
- WINDOW w AS (PARTITION BY testtab.a);
+ pg_get_viewdef
+-------------------------------------------
+ SELECT avg(a) OVER (w ORDER BY b) AS avg+
+ FROM testtab +
+ WINDOW w AS (PARTITION BY a);
(1 row)
create view v6 as
select avg(a) over (w order by a)
from testtab window w as ();
select pg_get_viewdef('v6');
- pg_get_viewdef
------------------------------------------------------------
- SELECT avg(testtab.a) OVER (w ORDER BY testtab.a) AS avg+
- FROM testtab +
+ pg_get_viewdef
+-------------------------------------------
+ SELECT avg(a) OVER (w ORDER BY a) AS avg+
+ FROM testtab +
WINDOW w AS ();
(1 row)
@@ -72,44 +72,44 @@ create view v7 as
select avg(a) over (w)
from testtab window w as (order by a);
select pg_get_viewdef('v7');
- pg_get_viewdef
---------------------------------------
- SELECT avg(testtab.a) OVER w AS avg+
- FROM testtab +
- WINDOW w AS (ORDER BY testtab.a);
+ pg_get_viewdef
+------------------------------
+ SELECT avg(a) OVER w AS avg+
+ FROM testtab +
+ WINDOW w AS (ORDER BY a);
(1 row)
create view v8 as
select avg(a) over (w)
from testtab window w as (order by a rows between unbounded preceding and
unbounded following);
select pg_get_viewdef('v8');
- pg_get_viewdef
-----------------------------------------------------------------------------------------------
- SELECT avg(testtab.a) OVER w AS avg
+
- FROM testtab
+
- WINDOW w AS (ORDER BY testtab.a ROWS BETWEEN UNBOUNDED PRECEDING AND
UNBOUNDED FOLLOWING);
+ pg_get_viewdef
+--------------------------------------------------------------------------------------
+ SELECT avg(a) OVER w AS avg
+
+ FROM testtab
+
+ WINDOW w AS (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED
FOLLOWING);
(1 row)
create view v9 as
select avg(a) over (w)
from testtab window w as (order by a rows between 1 preceding and 1
following);
select pg_get_viewdef('v9');
- pg_get_viewdef
-------------------------------------------------------------------------------
- SELECT avg(testtab.a) OVER w AS avg +
- FROM testtab +
- WINDOW w AS (ORDER BY testtab.a ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING);
+ pg_get_viewdef
+----------------------------------------------------------------------
+ SELECT avg(a) OVER w AS avg +
+ FROM testtab +
+ WINDOW w AS (ORDER BY a ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING);
(1 row)
create view v10 as
select avg(a) over (w rows between 1 preceding and 1 following)
from testtab window w as (order by a);
select pg_get_viewdef('v10');
- pg_get_viewdef
----------------------------------------------------------------------------------
- SELECT avg(testtab.a) OVER (w ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS
avg+
- FROM testtab
+
- WINDOW w AS (ORDER BY testtab.a);
+ pg_get_viewdef
+-------------------------------------------------------------------------
+ SELECT avg(a) OVER (w ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS avg+
+ FROM testtab +
+ WINDOW w AS (ORDER BY a);
(1 row)
-- Check that COUNT(*) is dumped with the star intact.
@@ -117,9 +117,9 @@ create view v_star as
select count(*) over (partition by a)
from testtab;
select pg_get_viewdef('v_star');
- pg_get_viewdef
----------------------------------------------------------
- SELECT count(*) OVER (PARTITION BY testtab.a) AS count+
+ pg_get_viewdef
+-------------------------------------------------
+ SELECT count(*) OVER (PARTITION BY a) AS count+
FROM testtab;
(1 row)
diff --git a/src/test/regress/sql/default_tablespace.sql
b/src/test/regress/sql/default_tablespace.sql
index 45679e2eda2..472a040a674 100644
--- a/src/test/regress/sql/default_tablespace.sql
+++ b/src/test/regress/sql/default_tablespace.sql
@@ -1,5 +1,9 @@
-create tablespace some_default_tablespace location
'@testtablespace@_default_tablespace';
-create tablespace some_database_tablespace location
'@testtablespace@_database_tablespace';
+\getenv abs_builddir PG_ABS_BUILDDIR
+\set default_tablespace :abs_builddir '/testtablespace_default_tablespace'
+\set database_tablespace :abs_builddir '/testtablespace_database_tablespace'
+
+create tablespace some_default_tablespace location :'default_tablespace';
+create tablespace some_database_tablespace location :'database_tablespace';
create database database_for_default_tablespace;
\c database_for_default_tablespace;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]