agora inbox for pgsql-docs@postgresql.org
help / color / mirror / Atom feedFrom: Michael Paquier <michael@paquier.xyz>
To: Greg Sabino Mullane <htamfids@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-docs <pgsql-docs@lists.postgresql.org>
Subject: Re: Table rewrite supporting functions for event triggers
Date: Fri, 13 Sep 2024 07:39:13 +0900
Message-ID: <ZuNtkd5IJ0TipHzo@paquier.xyz> (raw)
In-Reply-To: <CAKAnmmLOq8DPfd14Wj+gmn8vH4nUY0_NrWiHL0gQGxXj2SCW4g@mail.gmail.com>
References: <CAKAnmmL+Z6j-C8dAx1tVrnBmZJu+BSoc68WSg3sR+CVNjBCqbw@mail.gmail.com>
<718fcf4a067b576b501bd5b18b54a1fdc4fda639.camel@cybertec.at>
<CAKAnmm+SfSEg+bmWqT5Q9BSTU3FGaSquVebrQ+8jg3Dq-_1vxg@mail.gmail.com>
<CAKAnmm+NKVhZMjNN8okbPHXMxSb0Ngqhxgt4hEMGU=RWq9fnKA@mail.gmail.com>
<c264f34792b17f5bd30133071cfa252919bf5323.camel@cybertec.at>
<ZuEx_09-ohYExkJG@paquier.xyz>
<CAKAnmmJ-DXh4QDjS8Aiz8SBxDWrcj1Epq54byb8T_035nTX2JQ@mail.gmail.com>
<ZuJdSA9U5OmgagbS@paquier.xyz>
<CAKAnmmLOq8DPfd14Wj+gmn8vH4nUY0_NrWiHL0gQGxXj2SCW4g@mail.gmail.com>
On Thu, Sep 12, 2024 at 08:52:00AM -0400, Greg Sabino Mullane wrote:
> I do like the simplicity of the bitmap:
>
> if (reason & 1)
> print "Table has changed from logged to unlogged"
> if (reason & 2)
> print "Default has been changed"
>
> versus with text[]:
>
> foreach reason in tablereason[]
> if reason.match_exact("ALTER_PERSISTENCE")
> print "Table has changed from logged to unlogged"
> if reason.match_regex("DEFAULT")
> print "Default has been changed"
> ...
Okay. I am not going to be annoying with compatibility, then :D
> My initial reaction was that this is indeed a rare case, and to avoid
> putting that level of code detail in the docs. Your argument is a good one,
> but it still feels wrong to put that there. Yes, this puts a little more
> onus on future developers, but updating the docs is already a core
> requirement for patches.
>
> (On reflection, maybe reverse it - put a code comment in event_trigger.h
> reminding people to also update the docs? But again, that's seems like
> something obvious anyway for someone making that change.)
I am not so sure, TBH. One example: I know these values in
tablecmds.c for some time because that's an area I tend to focus on
for bug fixes, but forgot entirely about the SQL function in event
triggers that feed on it until I found your post. A comment in
event_trigger.h to mention the doc update would work for me. That
would be impossible to miss.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../ZuNtkd5IJ0TipHzo@paquier.xyz/2-signature.asc)
download
view thread (11+ messages) latest in thread
Message-ID: <ZuNtkd5IJ0TipHzo@paquier.xyz>
Permalink: ../ZuNtkd5IJ0TipHzo@paquier.xyz/
Also on: postgresql.org/message-id/ZuNtkd5IJ0TipHzo@paquier.xyz
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-docs@postgresql.org
Cc: michael@paquier.xyz, htamfids@gmail.com, laurenz.albe@cybertec.at, pgsql-docs@lists.postgresql.org
Subject: Re: Table rewrite supporting functions for event triggers
In-Reply-To: <ZuNtkd5IJ0TipHzo@paquier.xyz>
* 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