Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8QIc6h53135; Wed, 26 Sep 2001 14:38:06 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id f8QIawK06110; Wed, 26 Sep 2001 14:36:58 -0400 (EDT) To: Kovacs Baldvin cc: Jan Wieck , Kevin Way , pgsql-sql@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: [SQL] CHECK problem really OK now... In-reply-to: References: Comments: In-reply-to Kovacs Baldvin message dated "Mon, 24 Sep 2001 20:38:20 +0200" Date: Wed, 26 Sep 2001 14:36:58 -0400 Message-ID: <6107.1001529418@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200109/711 X-Sequence-Number: 13590 Kovacs Baldvin writes: > I tried, and it works: the current CVS version really runs > happily the query what sent to heaven our 7.1 version of the > backend. I believe this traces to a fix I made in May: 2001-05-27 16:48 tgl * src/: backend/executor/execJunk.c, backend/executor/execMain.c, include/executor/executor.h, include/nodes/execnodes.h: When using a junkfilter, the output tuple should NOT be stored back into the same tuple slot that the raw tuple came from, because that slot has the wrong tuple descriptor. Store it into its own slot with the correct descriptor, instead. This repairs problems with SPI functions seeing inappropriate tuple descriptors --- for example, plpgsql code failing to cope with SELECT FOR UPDATE. I didn't realize at the time that the error would also affect updates of child tables, but tracing through your example with 7.1 shows clearly that the CHECK is being applied to a slot that contains a four-column tuple and only a three-column descriptor. Ooops. regards, tom lane