Re: A trigger in an extension

From: Олег Самойлов <splarv(at)ya(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: A trigger in an extension
Date: 2025-02-20 19:43:56
Message-ID: 1276821740080203@mail.yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

<div>Olleg Samoylov &lt;<a href="mailto:splarv(at)ya(dot)ru" rel="noopener noreferrer">splarv(at)ya(dot)ru</a>&gt; writes:</div><blockquote><blockquote> I have the extension pgpro_scheduler. In the exception there are two<br /> tables and the trigger on one of them that write to the other. I was<br /> surprised but when I load dump created by pg_dump this trigger is<br /> created in the pre-data stage (automatically by create extension) early<br /> and thus has wrong behavior when uploaded data in the data stage (lead<br /> to duplication of primary key).</blockquote><p><br />pg_dump does not like to editorialize on the contents of extensions.<br />It just does CREATE EXTENSION and doesn't inquire into what's in<br />them.</p></blockquote><div> </div><div>I saw this.</div><div> </div><blockquote><p>I'd argue that if you need triggers like this, maybe you should rethink your data model.<br />                        regards, tom lane</p></blockquote><div> </div><div>This is not my extension. This is foreign extension that emulate sheduler or cron behaviour similar to oracle. Two tables: the second is history table where logged changes of the first cron table.</div><div> </div><div>The question is: is this somehow violate documented rules for  extensions, so I can point the extension developers to the documentation? May be triggers is explicitly forbidden for extensions? Or may be need to document this?</div><blockquote> </blockquote>

Attachment Content-Type Size
unknown_filename text/html 1.4 KB

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Bruce Momjian 2025-02-20 23:33:40 Re: Create a Database or a Schema -- when to do what?
Previous Message Tom Lane 2025-02-20 19:30:10 Re: A trigger in an extension