Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Peter Geoghegan <pg@heroku.com>
From: Peter Geoghegan <pg@heroku.com>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Josh Berkus <josh@agliodbs.com>, Craig Ringer <craig@2ndquadrant.com>, Anssi Kääriäinen <anssi.kaariainen@thl.fi>, Simon Riggs <simon@2ndquadrant.com>, Bruce Momjian <bruce@momjian.us>, Kevin Grittner <kgrittn@ymail.com>, Andres Freund <andres@2ndquadrant.com>, Heikki Linnakangas <hlinnakangas@vmware.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2014-12-20T21:56:52Z
Lists: pgsql-hackers
Attachments
- target_ref_bugfix.patch (text/x-patch) patch
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. Thanks -- Peter Geoghegan
Commits
-
Change the way we mark tuples as frozen.
- 37484ad2aace 9.4.0 cited
-
Add documentation for data-modifying statements in WITH clauses.
- 0ef0b3020402 9.1.0 cited