Re: [GENERAL] Using results from DELETE ... RETURNING

From: Petr Jelinek <pjmodos(at)pjmodos(dot)net>
To: David Fetter <david(at)fetter(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] Using results from DELETE ... RETURNING
Date: 2009-06-14 15:59:58
Message-ID: 4A351E7E.3070907@pjmodos.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

David Fetter wrote:
> I was discussing this with Andrew Gierth in IRC, who thought that
> putting RETURNING inside the WITH clause would be relatively easy, at
> least for the parser and planner. For the executor, he suggested that
> one approach might be to make INSERT, UPDATE and DELETE into their own
> nodes.

David asked me to post his (and mine) experimental work in progress
patch for this here. The patch in the current state does not work. It
dies in executor on:
ERROR: attribute 1 has wrong type
DETAIL: Table has type tid, but query expects integer.
Since I know nothing about postgres' executor I am only guessing it
thinks the query is SELECT instead of DELETE RETURNING.
Also I think those query->commandType == CMD_SELECT ? query->targetList
: query->returningList in several places might not be the right way to go.
Anyway it's beginning and maybe somebody who knows what he is doing
could help or continue the work.

--
Regards
Petr Jelinek (PJMODOS)

Attachment Content-Type Size
with-delete.diff text/plain 10.2 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message James B. Byrne 2009-06-14 17:30:19 cygwin and postgresql
Previous Message APseudoUtopia 2009-06-14 15:14:04 Opinions on how to Integrate Transactions

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-06-14 17:00:24 Re: machine-readable explain output
Previous Message Tom Lane 2009-06-14 15:28:44 Re: machine-readable explain output