mirror of
https://github.com/timescale/timescaledb.git
synced 2025-04-20 03:21:15 +08:00
To increase schema security we do not want to mix our own internal objects with user objects. Since chunks are created in the _timescaledb_internal schema our internal functions should live in a different dedicated schema. This patch make the necessary adjustments for the following functions: - chunk_constraint_add_table_constraint(_timescaledb_catalog.chunk_constraint) - chunk_drop_replica(regclass,name) - chunk_index_clone(oid) - chunk_index_replace(oid,oid) - create_chunk_replica_table(regclass,name) - drop_stale_chunks(name,integer[]) - health() - hypertable_constraint_add_table_fk_constraint(name,name,name,integer) - process_ddl_event() - wait_subscription_sync(name,name,integer,numeric)
18 lines
896 B
SQL
18 lines
896 B
SQL
-- This file and its contents are licensed under the Apache License 2.0.
|
|
-- Please see the included NOTICE for copyright information and
|
|
-- LICENSE-APACHE for a copy of the license.
|
|
|
|
DROP EVENT TRIGGER IF EXISTS timescaledb_ddl_command_end;
|
|
|
|
CREATE OR REPLACE FUNCTION _timescaledb_functions.process_ddl_event() RETURNS event_trigger
|
|
AS '@MODULE_PATHNAME@', 'ts_timescaledb_process_ddl_event' LANGUAGE C;
|
|
|
|
--EVENT TRIGGER MUST exclude the ALTER EXTENSION tag.
|
|
CREATE EVENT TRIGGER timescaledb_ddl_command_end ON ddl_command_end
|
|
WHEN TAG IN ('ALTER TABLE','CREATE TRIGGER','CREATE TABLE','CREATE INDEX','ALTER INDEX', 'DROP TABLE', 'DROP INDEX', 'DROP SCHEMA')
|
|
EXECUTE FUNCTION _timescaledb_functions.process_ddl_event();
|
|
|
|
DROP EVENT TRIGGER IF EXISTS timescaledb_ddl_sql_drop;
|
|
CREATE EVENT TRIGGER timescaledb_ddl_sql_drop ON sql_drop
|
|
EXECUTE FUNCTION _timescaledb_functions.process_ddl_event();
|