From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jim Nasby <Jim.Nasby@bluetreble.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Karl Lehenbauer <karl@flightaware.com>
Subject: Re: Fix bug in handling of dropped columns in pltcl triggers
Date: Tue, 08 Nov 2016 09:39:05 -0500
Message-ID: <19404.1478615945@sss.pgh.pa.us> (raw)
In-Reply-To: <718405a6-00df-fdd3-6f3c-ba7db120fffb@BlueTreble.com>
References: <b2de8258-c4c0-1cb8-7b97-e8538e5c975c@BlueTreble.com>
<CAB7nPqTggoAOxkYWQrzpZwdiwCMXGWGQ06-6X6uNHo85eFAXGw@mail.gmail.com>
<16808.1478294889@sss.pgh.pa.us>
<718405a6-00df-fdd3-6f3c-ba7db120fffb@BlueTreble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Jim Nasby <Jim.Nasby@bluetreble.com> writes:
> On 11/4/16 4:28 PM, Tom Lane wrote:
>> It's possible that it'd make sense for pltcl_trigger_handler to ignore
>> empty-string column names in the returned list, so that the behavior
>> with stupid trigger functions would be a bit more forgiving; but that
>> is more or less independent of this patch.
> I'm a bit reluctant to do that since it'd be nice to be consistent with
> regular pltcl functions returning composites. The same kind of issue
> exists with the holes in $TG_relatts; we shouldn't be exposing the
> details of attnum that way. Any code that's expecting those holes is
> going to blow up after a dump/restore anyway.
Hm. Offhand it seems like the functions that pltcl itself exposes don't
really do anything that would depend on $TG_relatts indexes matching
physical column numbers. The only way you could write a pltcl function
that would depend on that would be to have it do some catalog queries that
expect the indexes to match pg_attribute.attnum. That's possible I guess
but it seems neither likely nor good practice.
I think I'd be in favor of trying to remove the business about having
empty-string entries in $TG_relatts. Do you want to draft a patch
for that?
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, Jim.Nasby@bluetreble.com, michael.paquier@gmail.com, karl@flightaware.com
Subject: Re: Fix bug in handling of dropped columns in pltcl triggers
In-Reply-To: <19404.1478615945@sss.pgh.pa.us>
References: <b2de8258-c4c0-1cb8-7b97-e8538e5c975c@BlueTreble.com> <CAB7nPqTggoAOxkYWQrzpZwdiwCMXGWGQ06-6X6uNHo85eFAXGw@mail.gmail.com> <16808.1478294889@sss.pgh.pa.us> <718405a6-00df-fdd3-6f3c-ba7db120fffb@BlueTreble.com> <19404.1478615945@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