Skip to content

Commit

Permalink
Create temporary bgw function in _timescaledb_functions schema
Browse files Browse the repository at this point in the history
Only creating functions/procedures in a dedicated schema allows us to
further lockdown the _timescaledb_internal schema by removing EXECUTE
privilege for it.
  • Loading branch information
svenklemm committed Apr 21, 2024
1 parent 0f1983e commit 22bde57
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sql/updates/pre-version-change.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ DROP EVENT TRIGGER IF EXISTS timescaledb_ddl_sql_drop;
-- may either be in _timescaledb_internal or in _timescaledb_functions
-- depending on the version we are upgrading from and we can't make
-- the move in this location as the new schema might not have been set up.
CREATE FUNCTION _timescaledb_internal._tmp_restart_background_workers()
CREATE FUNCTION _timescaledb_functions._tmp_restart_background_workers()
RETURNS BOOL
AS '@LOADER_PATHNAME@', 'ts_bgw_db_workers_restart'
LANGUAGE C VOLATILE;
SELECT _timescaledb_internal._tmp_restart_background_workers();
DROP FUNCTION _timescaledb_internal._tmp_restart_background_workers();
SELECT _timescaledb_functions._tmp_restart_background_workers();
DROP FUNCTION _timescaledb_functions._tmp_restart_background_workers();

-- Table for ACL and initprivs of tables.
CREATE TABLE _timescaledb_internal.saved_privs(
Expand Down

0 comments on commit 22bde57

Please sign in to comment.