pg_ivm/pg_ivm--1.2--1.3.sql
Yugo Nagata e31dc21eaa
Use object_access_hook to drop an IMMV entry from pg_ivm_immv (#29)
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
2022-09-30 23:49:51 +09:00

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;