Re: Unexpected behavior with transition tables in update statement trigger

From: Tom Kazimiers <tom(at)voodoo-arts(dot)net>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Unexpected behavior with transition tables in update statement trigger
Date: 2018-02-26 15:18:07
Message-ID: 20180226151520.7imta6ogcjl227tr@dewberry.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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(at)voodoo-arts(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2018-02-26 15:22:09 Re: merge statement gives error
Previous Message Abhra Kar 2018-02-26 15:02:15 merge statement gives error

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikita Glukhov 2018-02-26 15:34:04 Re: jsonpath
Previous Message Konstantin Knizhnik 2018-02-26 14:56:08 Re: Contention preventing locking