Re: Segfault in backend CTE code - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Segfault in backend CTE code
Date
Msg-id 5050.1327791578@sss.pgh.pa.us
Whole thread Raw
In response to Re: Segfault in backend CTE code  (Phil Sorber <phil@omniti.com>)
List pgsql-bugs
Phil Sorber <phil@omniti.com> writes:
> On Wed, Jan 25, 2012 at 5:13 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I played around with removing the optimization, but there are other
> pieces further down the line that are upset but having a ModifyTable
> node in the execution tree.

Hm, yeah, obviously this scenario has never been tested :-(.  I have
applied a patch for it, and also done some work so that it will get
tested by the buildfarm in future.  Thanks for the report!

> We changed our writable CTE queries to update/insert loops so this is
> no longer a blocker for us.

FWIW, that technique didn't really work anyway, as even with the patch
I observe that you get a "duplicate unique key" failure if two such
commands try to insert a new row concurrently.  This is because neither
UPDATE subquery will see an as-yet-uncommitted inserted row.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: BUG #6200: standby bad memory allocations on SELECT
Next
From: Euler Taveira de Oliveira
Date:
Subject: Re: BUG #6412: psql & fe-connect truncate passwords