Re: Fix bug in handling of dropped columns in pltcl triggers

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Karl Lehenbauer <karl(at)flightaware(dot)com>
Subject: Re: Fix bug in handling of dropped columns in pltcl triggers
Date: 2016-11-07 22:25:23
Message-ID: 718405a6-00df-fdd3-6f3c-ba7db120fffb@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/4/16 4:28 PM, Tom Lane wrote:
> My proposal therefore is for SPI_fnumber to ignore (not match to)
> dropped columns, and to remove any caller-side attisdropped tests that
> thereby become redundant.

Yeah, SPI users certainly shouldn't need to worry about attisdropped,
and exposing attnum doesn't seem like a good idea either.

> 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.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532) mobile: 512-569-9461

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gilles Darold 2016-11-07 22:29:28 Re: Patch to implement pg_current_logfile() function
Previous Message Jim Nasby 2016-11-07 22:09:57 Re: Add support for SRF and returning composites to pl/tcl