Re: INSERT ... ON CONFLICT {UPDATE | IGNORE} - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Date
Msg-id CAB7nPqTDkatemGY-ZvnhJEf41iK=HKLvuO5Zm9+k-Wrbxs7PGQ@mail.gmail.com
Whole thread Raw
In response to Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}  (Peter Geoghegan <pg@heroku.com>)
Responses Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
On Sun, Dec 21, 2014 at 6:56 AM, Peter Geoghegan <pg@heroku.com> wrote:
> On Thu, Dec 18, 2014 at 9:31 AM, Peter Geoghegan <pg@heroku.com> wrote:
>>> So I think there needs to be some kind of logic to de-recognize the table
>>> alias "foo".
>>>
>>> Once I rewrote the query to use TARGET and EXCLUDED correctly, I've put this
>>> through an adaptation of my usual torture test, and it ran fine until
>>> wraparound shutdown.  I'll poke at it more later.
>>
>> Oops. I agree with your diagnosis, and will circle around to fix that
>> bug in the next revision
>
> Attached patch fixes the bug. I'm not delighted about the idea of
> cutting off parent parse state (the parse state of the insert) within
> transformUpdateStmt() only once we've used the parent state to
> establish that this is a "speculative"/auxiliary update, but it's
> probably the path of least resistance here.
>
> When this is rolled into the next version, there will be a testcase.
Looking at this thread, the last version of this patch is available here:
http://www.postgresql.org/message-id/CAM3SWZRvkCKc=1Y6_Wn8mk97_Vi8+j-aX-RY-=msrJVU-Ec-qw@mail.gmail.com
And they do not apply correctly, so this patch needs a rebase.
Regards,
-- 
Michael



pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: Parallel Seq Scan
Next
From: Peter Geoghegan
Date:
Subject: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}