Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c47Zn-0000nN-Tk for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Nov 2016 14:40:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c47Zn-0006lz-GS for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Nov 2016 14:40:39 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c47YP-0005AE-4S for pgsql-hackers@postgresql.org; Tue, 08 Nov 2016 14:39:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c47YM-0002zk-NY for pgsql-hackers@postgresql.org; Tue, 08 Nov 2016 14:39:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id uA8Ed5mi019405; Tue, 8 Nov 2016 09:39:05 -0500 From: Tom Lane To: Jim Nasby cc: Michael Paquier , Pg Hackers , Karl Lehenbauer Subject: Re: Fix bug in handling of dropped columns in pltcl triggers In-reply-to: <718405a6-00df-fdd3-6f3c-ba7db120fffb@BlueTreble.com> References: <16808.1478294889@sss.pgh.pa.us> <718405a6-00df-fdd3-6f3c-ba7db120fffb@BlueTreble.com> Comments: In-reply-to Jim Nasby message dated "Mon, 07 Nov 2016 16:25:23 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19403.1478615945.1@sss.pgh.pa.us> Date: Tue, 08 Nov 2016 09:39:05 -0500 Message-ID: <19404.1478615945@sss.pgh.pa.us> X-Pg-Spam-Score: -4.8 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Jim Nasby 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