Re: Unexpected behavior with transition tables in update statementtrigger - Mailing list pgsql-general

From Tom Kazimiers
Subject Re: Unexpected behavior with transition tables in update statementtrigger
Date
Msg-id 20180226151520.7imta6ogcjl227tr@dewberry.localdomain
Whole thread Raw
In response to Re: Unexpected behavior with transition tables in update statement trigger  (Thomas Munro <thomas.munro@enterprisedb.com>)
List pgsql-general
Hi Thomas,

On Mon, Feb 26, 2018 at 11:15:44PM +1300, Thomas Munro wrote:
>On Sat, Feb 24, 2018 at 4:47 PM, Tom Kazimiers <tom@voodoo-arts.net> wrote:
>Thanks for the reproducer.  Yeah, that seems to be a bug.
>nodeNamedTuplestorescan.c allocates a new read pointer for each
>separate scan of the named tuplestore, but it doesn't call
>tuplestore_select_read_pointer() so that the two scans that appear in
>your UNION ALL plan are sharing the same read pointer.  At first
>glance the attached seems to fix the problem, but I'll need to look
>more carefully tomorrow.

Thanks very much for investigating this. I can confirm that applying 
your patch results in the tuples I expected in both my test trigger and 
my actual trigger function.

It would be great if this or a similar fix would make it into the next 
official release.

Cheers,
Tom


pgsql-general by date:

Previous
From: Abhra Kar
Date:
Subject: merge statement gives error
Next
From: Thomas Kellerer
Date:
Subject: Re: merge statement gives error