pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Phil Sorber <phil@omniti.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Segfault in backend CTE code
Date: Sat, 28 Jan 2012 17:59:38 -0500
Message-ID: <5050.1327791578@sss.pgh.pa.us> (raw)
In-Reply-To: <CADAkt-ix+ts5V1aHx2gHtRogUnKciJ6B5c5s-RTobp70WWjrXQ@mail.gmail.com>
References: <CADAkt-iWfSvovEMd4-sT15OQ+YK4FC_YbZDefxwUK5EwrWe4bA@mail.gmail.com>
	<20955.1327383788@sss.pgh.pa.us>
	<CADAkt-h=ut28S_k1zWzyx+-qdHAahOB24LUMA5z5QoF3WVppBQ@mail.gmail.com>
	<6418.1327438984@sss.pgh.pa.us>
	<CADAkt-jK4o==uiy-Q9sn+rPDPWSzo+OWfq2aeeZWafi9ZRmWXw@mail.gmail.com>
	<12620.1327529624@sss.pgh.pa.us>
	<CADAkt-ix+ts5V1aHx2gHtRogUnKciJ6B5c5s-RTobp70WWjrXQ@mail.gmail.com>

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



view thread (9+ messages)

Message-ID: <5050.1327791578@sss.pgh.pa.us>
Permalink:  ../5050.1327791578@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5050.1327791578@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, phil@omniti.com
  Subject: Re: Segfault in backend CTE code
  In-Reply-To: <5050.1327791578@sss.pgh.pa.us>
  References: <CADAkt-iWfSvovEMd4-sT15OQ+YK4FC_YbZDefxwUK5EwrWe4bA@mail.gmail.com> <20955.1327383788@sss.pgh.pa.us> <CADAkt-h=ut28S_k1zWzyx+-qdHAahOB24LUMA5z5QoF3WVppBQ@mail.gmail.com> <6418.1327438984@sss.pgh.pa.us> <CADAkt-jK4o==uiy-Q9sn+rPDPWSzo+OWfq2aeeZWafi9ZRmWXw@mail.gmail.com> <12620.1327529624@sss.pgh.pa.us> <CADAkt-ix+ts5V1aHx2gHtRogUnKciJ6B5c5s-RTobp70WWjrXQ@mail.gmail.com> <5050.1327791578@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox