Previously, we used an event trigger and executed DELETE command, but it caused a privilege error when non-superuser dropped a table even if it is irrelevant to IMMV. To fix it, we now use object_access_hook and an entry is deleted via CatalogTupleDelete which doesn't need the superuser privilege. Issue #25
18 lines
378 B
SQL
18 lines
378 B
SQL
-- functions
|
|
|
|
CREATE FUNCTION ivm_visible_in_prestate(oid, tid, oid)
|
|
RETURNS bool
|
|
STABLE
|
|
AS 'MODULE_PATHNAME', 'ivm_visible_in_prestate'
|
|
LANGUAGE C;
|
|
|
|
CREATE FUNCTION get_immv_def(IN immvrelid regclass)
|
|
RETURNS text
|
|
STRICT
|
|
AS 'MODULE_PATHNAME', 'get_immv_def'
|
|
LANGUAGE C;
|
|
|
|
-- event trigger
|
|
|
|
DROP EVENT TRIGGER pg_ivm_sql_drop_trigger;
|
|
DROP FUNCTION pg_ivm_sql_drop_trigger_func;
|