agora inbox for pgsql-admin@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Olleg Samoylov <splarv@ya.ru>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: A trigger in an extension
Date: Thu, 20 Feb 2025 14:30:10 -0500
Message-ID: <2790099.1740079810@sss.pgh.pa.us> (raw)
In-Reply-To: <40129c90-138c-4331-a3d6-c04158cb91e0@ya.ru>
References: <40129c90-138c-4331-a3d6-c04158cb91e0@ya.ru>

Olleg Samoylov <splarv@ya.ru> writes:
> I have the extension pgpro_scheduler. In the exception there are two 
> tables and the trigger on one of them that write to the other. I was 
> surprised but when I load dump created by pg_dump this trigger is 
> created in the pre-data stage (automatically by create extension) early 
> and thus has wrong behavior when uploaded data in the data stage (lead 
> to duplication of primary key).

pg_dump does not like to editorialize on the contents of extensions.
It just does CREATE EXTENSION and doesn't inquire into what's in
them.  I'd argue that if you need triggers like this, maybe you
should rethink your data model.

			regards, tom lane





view thread (4+ messages)  latest in thread

Message-ID: <2790099.1740079810@sss.pgh.pa.us>
Permalink:  ../2790099.1740079810@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2790099.1740079810@sss.pgh.pa.us

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: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, splarv@ya.ru, pgsql-admin@lists.postgresql.org
  Subject: Re: A trigger in an extension
  In-Reply-To: <2790099.1740079810@sss.pgh.pa.us>

* 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