public inbox for [email protected]
help / color / mirror / Atom feedFrom: Álvaro Herrera <[email protected]>
To: Dominique Devienne <[email protected]>
Cc: [email protected]
Subject: Re: Extension disappearing act
Date: Mon, 23 Jun 2025 12:59:04 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAFCRh-_TQagsob_YH0nXktwhuBftNaiZ_VZ4REhZdSEkWXVKXg@mail.gmail.com>
On 2025-Jun-19, Dominique Devienne wrote:
> Hi. Little mystery we don't understand. v17.
>
> Create new DB, owned by dedicated new ROLE.
> Create extension (pgcrypto) in our case. Installed in public, owned by
> DB owner role.
> Create schemas and populate them inside the DB.
I would investigate this using an event trigger attached to the sql_drop
event. That should allow you to identify exactly when the extension is
dropped. Something like
CREATE OR REPLACE FUNCTION report_dropped()
RETURNS event_trigger
AS $$
DECLARE r record;
BEGIN
FOR r IN SELECT * from pg_event_trigger_dropped_objects()
LOOP
RAISE NOTICE
'orig=% normal=% istemp=% type=% identity=% name=% args=%',
r.original, r.normal, r.is_temporary, r.object_type,
r.object_identity, r.address_names, r.address_args;
END LOOP;
END;
$$ LANGUAGE plpgsql;
CREATE EVENT TRIGGER svar_regress_event_trigger_report_dropped ON sql_drop
EXECUTE PROCEDURE report_dropped();
--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"En las profundidades de nuestro inconsciente hay una obsesiva necesidad
de un universo lógico y coherente. Pero el universo real se halla siempre
un paso más allá de la lógica" (Irulan)
view thread (10+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Extension disappearing act
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox