Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/backend/distributed/deparser/citus_ruleutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -997,11 +997,12 @@ AddVacuumParams(ReindexStmt *reindexStmt, StringInfo buffer)
{
if (temp->len > 0)
{
appendStringInfo(temp, ", TABLESPACE %s", tableSpaceName);
appendStringInfo(temp, ", TABLESPACE %s",
quote_identifier(tableSpaceName));
}
else
{
appendStringInfo(temp, "TABLESPACE %s", tableSpaceName);
appendStringInfo(temp, "TABLESPACE %s", quote_identifier(tableSpaceName));
}
}

Expand Down
18 changes: 18 additions & 0 deletions src/test/regress/expected/pg14.out
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,24 @@ DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
reindex(TABLESPACE test_tablespace1) index idx;
ERROR: tablespace "test_tablespace1" does not exist
reset citus.log_remote_commands;
-- a tablespace name that needs quoting must stay quoted on the shards
ALTER TABLESPACE test_tablespace RENAME TO "Test Tablespace";
SELECT result FROM run_command_on_workers('ALTER TABLESPACE test_tablespace RENAME TO "Test Tablespace"');
result
---------------------------------------------------------------------
ALTER TABLESPACE
ALTER TABLESPACE
(2 rows)

reindex(TABLESPACE "Test Tablespace") index idx;
ALTER TABLESPACE "Test Tablespace" RENAME TO test_tablespace;
SELECT result FROM run_command_on_workers('ALTER TABLESPACE "Test Tablespace" RENAME TO test_tablespace');
result
---------------------------------------------------------------------
ALTER TABLESPACE
ALTER TABLESPACE
(2 rows)

-- CREATE STATISTICS allows table references too
CREATE TABLE tbl1(a timestamp, b int);
SELECT create_distributed_table('tbl1','a');
Expand Down
6 changes: 6 additions & 0 deletions src/test/regress/sql/pg14.sql
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ reindex(verbose, TABLESPACE test_tablespace) index idx ;
-- should error saying table space doesn't exist
reindex(TABLESPACE test_tablespace1) index idx;
reset citus.log_remote_commands;
-- a tablespace name that needs quoting must stay quoted on the shards
ALTER TABLESPACE test_tablespace RENAME TO "Test Tablespace";
SELECT result FROM run_command_on_workers('ALTER TABLESPACE test_tablespace RENAME TO "Test Tablespace"');
reindex(TABLESPACE "Test Tablespace") index idx;
ALTER TABLESPACE "Test Tablespace" RENAME TO test_tablespace;
SELECT result FROM run_command_on_workers('ALTER TABLESPACE "Test Tablespace" RENAME TO test_tablespace');
-- CREATE STATISTICS allows table references too
CREATE TABLE tbl1(a timestamp, b int);
SELECT create_distributed_table('tbl1','a');
Expand Down
Loading