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 ccb09e63bf3 Fix answer file for tablespace/timestamp
ccb09e63bf3 is described below
commit ccb09e63bf3e3d436796801188532337f1117ecb
Author: Jinbao Chen <[email protected]>
AuthorDate: Tue Nov 4 20:07:58 2025 +0800
Fix answer file for tablespace/timestamp
---
src/test/regress/expected/tablespace.out | 57 +++++++++++++++++---------------
src/test/regress/expected/timestamp.out | 6 ++--
src/test/regress/sql/tablespace.sql | 38 ++++++++++-----------
3 files changed, 53 insertions(+), 48 deletions(-)
diff --git a/src/test/regress/expected/tablespace.out
b/src/test/regress/expected/tablespace.out
index c0cb5bebe42..ee8975ce1d7 100644
--- a/src/test/regress/expected/tablespace.out
+++ b/src/test/regress/expected/tablespace.out
@@ -965,10 +965,40 @@ ERROR: permission denied for tablespace regress_tblspace
REINDEX (TABLESPACE regress_tblspace, CONCURRENTLY) TABLE tablespace_table; --
fail
ERROR: permission denied for tablespace regress_tblspace
RESET ROLE;
+
+-- Test that altering tablespace of a partition table should recurse into its
child tables unless ONLY is specified.
+CREATE TABLE tablespace_part(a int, b int) PARTITION BY RANGE(a) (partition t1
START (1) END (100));
+NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a'
as the Apache Cloudberry data distribution key for this table.
+HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make
sure column(s) chosen are the optimal data distribution key to minimize skew.
+ALTER TABLE tablespace_part SET TABLESPACE regress_tblspace;
+-- Both parent and child tables use the new tablespace
+SELECT c.relname, t.spcname FROM pg_class c LEFT JOIN pg_tablespace t ON
c.reltablespace = t.oid WHERE relname LIKE 'tablespace_part%';
+ relname | spcname
+--------------------------+------------------
+ tablespace_part | regress_tblspace
+ tablespace_part_1_prt_t1 | regress_tblspace
+(2 rows)
+
+DROP TABLE tablespace_part;
+CREATE TABLE tablespace_part(a int, b int) PARTITION BY RANGE(a) (partition t1
START (1) END (100));
+NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a'
as the Apache Cloudberry data distribution key for this table.
+HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make
sure column(s) chosen are the optimal data distribution key to minimize skew.
+ALTER TABLE ONLY tablespace_part SET TABLESPACE myts;
+ERROR: tablespace "myts" does not exist
+-- Only the parent table uses the new tablespace
+SELECT c.relname, t.spcname FROM pg_class c LEFT JOIN pg_tablespace t ON
c.reltablespace = t.oid WHERE relname LIKE 'tablespace_part%';
+ relname | spcname
+--------------------------+---------
+ tablespace_part |
+ tablespace_part_1_prt_t1 |
+(2 rows)
+
+DROP TABLE tablespace_part;
+
ALTER TABLESPACE regress_tblspace RENAME TO regress_tblspace_renamed;
-- Test that default_tablespace GUC is honored even after gang reset.
CREATE OR REPLACE FUNCTION cleanupAllGangs() RETURNS BOOL
-AS '@abs_builddir@/regress@DLSUFFIX@', 'cleanupAllGangs' LANGUAGE C;
+AS 'regress.so', 'cleanupAllGangs' LANGUAGE C;
SET default_tablespace TO regress_tblspace_renamed;
-- Destroy the QD-QE libpq connections.
select cleanupAllGangs();
@@ -1017,28 +1047,3 @@ drop cascades to materialized view testschema.amv
drop cascades to table testschema.tablespace_acl
DROP ROLE regress_tablespace_user1;
DROP ROLE regress_tablespace_user2;
--- Test that altering tablespace of a partition table should recurse into its
child tables unless ONLY is specified.
-CREATE TABLE tablespace_part(a int, b int) PARTITION BY RANGE(a) (partition t1
START (1) END (100));
-CREATE TABLESPACE myts LOCATION '@testtablespace@';
-ALTER TABLE tablespace_part SET TABLESPACE myts;
--- Both parent and child tables use the new tablespace
-SELECT c.relname, t.spcname FROM pg_class c LEFT JOIN pg_tablespace t ON
c.reltablespace = t.oid WHERE relname LIKE 'tablespace_part%';
- relname | spcname
---------------------------+---------
- tablespace_part | myts
- tablespace_part_1_prt_t1 | myts
-(2 rows)
-
-DROP TABLE tablespace_part;
-CREATE TABLE tablespace_part(a int, b int) PARTITION BY RANGE(a) (partition t1
START (1) END (100));
-ALTER TABLE ONLY tablespace_part SET TABLESPACE myts;
--- Only the parent table uses the new tablespace
-SELECT c.relname, t.spcname FROM pg_class c LEFT JOIN pg_tablespace t ON
c.reltablespace = t.oid WHERE relname LIKE 'tablespace_part%';
- relname | spcname
---------------------------+---------
- tablespace_part | myts
- tablespace_part_1_prt_t1 |
-(2 rows)
-
-DROP TABLE tablespace_part;
-DROP TABLESPACE myts;
diff --git a/src/test/regress/expected/timestamp.out
b/src/test/regress/expected/timestamp.out
index b666fa66ef4..285fcd78afd 100644
--- a/src/test/regress/expected/timestamp.out
+++ b/src/test/regress/expected/timestamp.out
@@ -2060,13 +2060,13 @@ SELECT i,
SELECT '' AS to_timestamp_1, to_timestamp('0097/Feb/16 --> 08:14:30',
'YYYY/Mon/DD --> HH:MI:SS');
to_timestamp_1 | to_timestamp
----------------+------------------------------
- | Sat Feb 16 08:14:30 0097 PST
+ | Sat Feb 16 08:14:30 0097 LMT
(1 row)
SELECT '' AS to_timestamp_2, to_timestamp('97/2/16 8:14:30', 'FMYYYY/FMMM/FMDD
FMHH:FMMI:FMSS');
to_timestamp_2 | to_timestamp
----------------+------------------------------
- | Sat Feb 16 08:14:30 0097 PST
+ | Sat Feb 16 08:14:30 0097 LMT
(1 row)
SELECT '' AS to_timestamp_3, to_timestamp('1985 January 12', 'YYYY FMMonth
DD');
@@ -2085,7 +2085,7 @@ SELECT '' AS to_timestamp_4, to_timestamp('My birthday->
Year: 1976, Month: May,
SELECT '' AS to_timestamp_5, to_timestamp('1,582nd VIII 21', 'Y,YYYth FMRM
DD');
to_timestamp_5 | to_timestamp
----------------+------------------------------
- | Sat Aug 21 00:00:00 1582 PST
+ | Sat Aug 21 00:00:00 1582 LMT
(1 row)
SELECT '' AS to_timestamp_6, to_timestamp('15 "text between quote marks" 98 54
45',
diff --git a/src/test/regress/sql/tablespace.sql
b/src/test/regress/sql/tablespace.sql
index 0813d7ed166..26b4c0315b5 100644
--- a/src/test/regress/sql/tablespace.sql
+++ b/src/test/regress/sql/tablespace.sql
@@ -434,11 +434,29 @@ REINDEX (TABLESPACE regress_tblspace) TABLE
tablespace_table; -- fail
REINDEX (TABLESPACE regress_tblspace, CONCURRENTLY) TABLE tablespace_table; --
fail
RESET ROLE;
+
+-- Test that altering tablespace of a partition table should recurse into its
child tables unless ONLY is specified.
+CREATE TABLE tablespace_part(a int, b int) PARTITION BY RANGE(a) (partition t1
START (1) END (100));
+ALTER TABLE tablespace_part SET TABLESPACE regress_tblspace;
+
+-- Both parent and child tables use the new tablespace
+SELECT c.relname, t.spcname FROM pg_class c LEFT JOIN pg_tablespace t ON
c.reltablespace = t.oid WHERE relname LIKE 'tablespace_part%';
+
+DROP TABLE tablespace_part;
+
+CREATE TABLE tablespace_part(a int, b int) PARTITION BY RANGE(a) (partition t1
START (1) END (100));
+ALTER TABLE ONLY tablespace_part SET TABLESPACE myts;
+
+-- Only the parent table uses the new tablespace
+SELECT c.relname, t.spcname FROM pg_class c LEFT JOIN pg_tablespace t ON
c.reltablespace = t.oid WHERE relname LIKE 'tablespace_part%';
+
+DROP TABLE tablespace_part;
+
ALTER TABLESPACE regress_tblspace RENAME TO regress_tblspace_renamed;
-- Test that default_tablespace GUC is honored even after gang reset.
CREATE OR REPLACE FUNCTION cleanupAllGangs() RETURNS BOOL
-AS '@abs_builddir@/regress@DLSUFFIX@', 'cleanupAllGangs' LANGUAGE C;
+AS 'regress.so', 'cleanupAllGangs' LANGUAGE C;
SET default_tablespace TO regress_tblspace_renamed;
@@ -471,21 +489,3 @@ DROP SCHEMA testschema CASCADE;
DROP ROLE regress_tablespace_user1;
DROP ROLE regress_tablespace_user2;
--- Test that altering tablespace of a partition table should recurse into its
child tables unless ONLY is specified.
-CREATE TABLE tablespace_part(a int, b int) PARTITION BY RANGE(a) (partition t1
START (1) END (100));
-CREATE TABLESPACE myts LOCATION '@testtablespace@';
-ALTER TABLE tablespace_part SET TABLESPACE myts;
-
--- Both parent and child tables use the new tablespace
-SELECT c.relname, t.spcname FROM pg_class c LEFT JOIN pg_tablespace t ON
c.reltablespace = t.oid WHERE relname LIKE 'tablespace_part%';
-
-DROP TABLE tablespace_part;
-
-CREATE TABLE tablespace_part(a int, b int) PARTITION BY RANGE(a) (partition t1
START (1) END (100));
-ALTER TABLE ONLY tablespace_part SET TABLESPACE myts;
-
--- Only the parent table uses the new tablespace
-SELECT c.relname, t.spcname FROM pg_class c LEFT JOIN pg_tablespace t ON
c.reltablespace = t.oid WHERE relname LIKE 'tablespace_part%';
-
-DROP TABLE tablespace_part;
-DROP TABLESPACE myts;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]