Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix quoting owners in sql scripts. #5906

Merged
merged 1 commit into from
Aug 4, 2023
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
3 changes: 3 additions & 0 deletions .unreleased/PR_5906
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixes: #5906 Fix quoting owners in sql scripts.

Thanks: @mrksngl
6 changes: 3 additions & 3 deletions sql/updates/2.10.1--2.10.2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ DROP VIEW IF EXISTS timescaledb_experimental.policies;

ALTER TABLE _timescaledb_config.bgw_job
ALTER COLUMN owner DROP DEFAULT,
ALTER COLUMN owner TYPE regrole USING owner::regrole,
ALTER COLUMN owner SET DEFAULT current_role::regrole;
ALTER COLUMN owner TYPE regrole USING pg_catalog.quote_ident(owner)::regrole,
ALTER COLUMN owner SET DEFAULT pg_catalog.quote_ident(current_role)::regrole;
CREATE TABLE _timescaledb_config.bgw_job_tmp AS SELECT * FROM _timescaledb_config.bgw_job;

ALTER EXTENSION timescaledb DROP TABLE _timescaledb_config.bgw_job;
Expand Down Expand Up @@ -40,7 +40,7 @@ CREATE TABLE _timescaledb_config.bgw_job (
retry_period interval NOT NULL,
proc_schema name NOT NULL,
proc_name name NOT NULL,
owner regrole NOT NULL DEFAULT current_role::regrole,
owner regrole NOT NULL DEFAULT pg_catalog.quote_ident(current_role)::regrole,
scheduled bool NOT NULL DEFAULT TRUE,
fixed_schedule bool not null default true,
initial_start timestamptz,
Expand Down
2 changes: 1 addition & 1 deletion sql/updates/2.11.0--2.10.3.sql
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ END
$BODY$ SET search_path TO pg_catalog, pg_temp;

ALTER TABLE _timescaledb_config.bgw_job
ALTER COLUMN owner SET DEFAULT current_role::regrole;
ALTER COLUMN owner SET DEFAULT pg_catalog.quote_ident(current_role)::regrole;

-- Rebuild the _timescaledb_catalog.continuous_agg_migrate_plan_step definition
ALTER TABLE _timescaledb_catalog.continuous_agg_migrate_plan_step
Expand Down
Loading