From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Julien Rouhaud <rjuju123@gmail.com>
Cc: Bryn Llewellyn <bryn@yugabyte.com>
Cc: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: Re: Re: Unexpected result from ALTER FUNCTION— looks like a bug
Date: Tue, 19 Apr 2022 23:32:08 -0400
Message-ID: <2715948.1650425528@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwbqrC7VygfVuMhw_boY2Xf1jMUfG_PUo=3H4N0VZpR6gA@mail.gmail.com>
References: <8AC9A37F-99BD-446F-A2F7-B89AD0022774@yugabyte.com>
<CAKFQuwa6WXVmjJRuDvN=B0Qv1BoLEKPiimXQ3HBJbRMwjS0g+Q@mail.gmail.com>
<20220420024707.zvhpbr5ztermdmm6@jrouhaud>
<CAKFQuwbqrC7VygfVuMhw_boY2Xf1jMUfG_PUo=3H4N0VZpR6gA@mail.gmail.com>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> Might I suggest the following:
> + /*
> + * For each action, modify procForm to type-safely set the new value.
> + * However, because the SET clause is repeatable we handle it
> + * a bit differently, modifying the underlying tuple directly. So
> + * make sure to leave that conditional block for last.
+ */
Actually, the reason proconfig is handled differently is that it's
a variable-length field, so it can't be represented in the C struct
that we overlay onto the catalog tuple to access the fixed-width
fields cheaply. I'm not sure that insisting that that stanza be
last is especially useful advice for future hackers, because someday
there might be more than one variable-length field that this function
needs to update.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, rjuju123@gmail.com, bryn@yugabyte.com
Subject: Re: Unexpected result from ALTER FUNCTION— looks like a bug
In-Reply-To: <2715948.1650425528@sss.pgh.pa.us>
References: <8AC9A37F-99BD-446F-A2F7-B89AD0022774@yugabyte.com> <CAKFQuwa6WXVmjJRuDvN=B0Qv1BoLEKPiimXQ3HBJbRMwjS0g+Q@mail.gmail.com> <20220420024707.zvhpbr5ztermdmm6@jrouhaud> <CAKFQuwbqrC7VygfVuMhw_boY2Xf1jMUfG_PUo=3H4N0VZpR6gA@mail.gmail.com> <2715948.1650425528@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox