Skip to content

Commit 96a5cb5

Browse files
committed
Rename gp_tablespace.source to gp_tablespace.sql
1 parent e2b9b29 commit 96a5cb5

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

File renamed without changes.
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
-- m/WARNING: tablespace symlink path is too long for TAR/
33
-- m/DETAIL: The symlinked path \".*\" will be truncated to 100 characters when sending a TAR to the utilities \(e.g. pg_basebackup\)/
44
-- end_matchignore
5+
\getenv abs_builddir PG_ABS_BUILDDIR
6+
\set testtablespace :abs_builddir '/testtablespace'
57
create or replace function has_init_file_for_oid(object oid) returns boolean as $$
68
select count(pg_stat_file(p.pg_relation_filepath || '_init')) = 1 as success
79
from (select * from pg_relation_filepath(object)) p;
@@ -36,17 +38,17 @@ END;
3638
$$ language plpgsql;
3739

3840
-- create tablespaces we can use
39-
CREATE TABLESPACE testspace LOCATION '@testtablespace@';
40-
CREATE TABLESPACE ul_testspace LOCATION '@testtablespace@_unlogged';
41+
CREATE TABLESPACE testspace LOCATION :'testtablespace';
42+
CREATE TABLESPACE ul_testspace LOCATION :'testtablespace' '_unlogged';
4143
SELECT gp_segment_id,
4244
CASE tblspc_loc
43-
WHEN '@testtablespace@' THEN 'testtablespace'
45+
WHEN :'testtablespace' THEN 'testtablespace'
4446
ELSE 'testtablespace_unknown'
4547
END AS tblspc_loc
4648
FROM gp_tablespace_location((SELECT oid FROM pg_tablespace WHERE spcname='testspace'));
4749
SELECT gp_segment_id,
4850
CASE tblspc_loc
49-
WHEN '@testtablespace@_unlogged' THEN 'testtablespace_unlogged'
51+
WHEN :'testtablespace' '_unlogged' THEN 'testtablespace_unlogged'
5052
ELSE 'testtablespace_unknown'
5153
END AS tblspc_loc
5254
FROM gp_tablespace_location((SELECT oid FROM pg_tablespace WHERE spcname='ul_testspace'));
@@ -59,7 +61,7 @@ FROM pg_tablespace WHERE spcname = 'testspace';
5961

6062
-- Ensure mirrors have applied filesystem changes
6163
SELECT force_mirrors_to_catch_up();
62-
\! ls @testtablespace@;
64+
\! ls :'testtablespace';
6365

6466
-- Test moving AO/AOCO tables from one tablespace to another.
6567
CREATE TABLE ao_ts_table (id int4, t text) with (appendonly=true, orientation=row) distributed by (id);
@@ -188,12 +190,12 @@ drop table aoco_ul_ctas;
188190
drop tablespace ul_testspace;
189191

190192
-- Cloudberry tablespaces have the option to define tablespace location for specific segments
191-
CREATE TABLESPACE testspace_otherloc LOCATION '@testtablespace@' WITH (content9999='@testtablespace@_otherloc'); -- should fail
192-
CREATE TABLESPACE testspace_otherloc LOCATION '@testtablespace@' WITH (content1='@testtablespace@_otherloc');
193+
CREATE TABLESPACE testspace_otherloc LOCATION :'testtablespace' WITH (content9999=:'testtablespace' '_otherloc'); -- should fail
194+
CREATE TABLESPACE testspace_otherloc LOCATION :'testtablespace' WITH (content1=:'testtablespace' '_otherloc');
193195
SELECT gp_segment_id,
194196
CASE tblspc_loc
195-
WHEN '@testtablespace@' THEN 'testtablespace'
196-
WHEN '@testtablespace@_otherloc' THEN 'testtablespace_otherloc'
197+
WHEN :'testtablespace' THEN 'testtablespace'
198+
WHEN :'testtablespace' '_otherloc' THEN 'testtablespace_otherloc'
197199
ELSE 'testtablespace_unknown'
198200
END AS tblspc_loc
199201
FROM gp_tablespace_location((SELECT oid FROM pg_tablespace WHERE spcname='testspace_otherloc'));
@@ -222,7 +224,7 @@ DROP TABLESPACE testspace_existing_version_dir;
222224

223225
-- Ensure mirrors have applied filesystem changes
224226
SELECT force_mirrors_to_catch_up();
225-
\! ls @testtablespace@_existing_version_dir/*;
227+
\! ls :'testtablespace'_existing_version_dir/*;
226228
227229
-- Test alter tablespace: PG does not seem to test these.
228230

0 commit comments

Comments
 (0)