public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Peter Eisentraut <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Improve pg_trigger.tgargs representation
Date: Mon, 05 Feb 2024 10:49:07 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Peter Eisentraut <[email protected]> writes:
> I always found the encoding of the pg_trigger.tgargs field quite weird 
> and archaic.  (It encodes the trigger argument list into a bytea 
> column.)

It is that ...

> So I tried replacing this with a list of nodes in a 
> pg_node_tree.  This worked out quite nicely.  It makes the internal code 
> much simpler, and it would maybe also allow clients to decode the column 
> more easily.

> (Trigger arguments are all strings, so another representation might be 
> an array of text, but I think a node representation makes more sense. 
> For example, you could imagine encoding numeric constants more directly, 
> but this is not done here.)

I come down on the other side of that: if we change this we should
change to array-of-text.  I think expecting clients to be able to
decode pg_node_tree is an absolutely horrid idea: it's overly complex
and we change the representation constantly.

Also, while I see that indeed none of our client-side code looks
directly at pg_trigger.tgargs anymore, there is a lot of backend and
contrib code (and therefore likely also 3rd-party extension code) that
depends on the representation used in struct Trigger ... which is
array of C strings.  I do not think we dare change that.

On the whole I'm not sure this is worth messing with.  We run at least
some risk of breaking somebody's code, and it doesn't seem like we
gain much unless we're willing to change struct Trigger, which'd
break a *lot* of code.

			regards, tom lane






view thread (3+ 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]
  Subject: Re: Improve pg_trigger.tgargs representation
  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