On Sun, Feb 24, 2008 at 4:21 PM, Mark Mielke <[EMAIL PROTECTED]> wrote:
>  I tried using insert ... delete ... return ... and get a syntax error:

Yeah...

>  In the past I've executed insert ... select and then the delete.
>  However, I believe there is race condition here as the delete may see
>  more or less rows than the insert ... select. I thought the above would
>  be a clever PostgreSQL-8.3 alternative, but I'm either stupid or it
>  doesn't work... :-)

Not stupid, it doesn't work :)  This was a limitation of the original
design based on (IIRC) executor-related issues.  I've seen about 6 or
so posts now about using DELETE returning in the same manner as you're
discussing, and I agree it would be quite useful.  Unfortunately, with
the amount of changes required to make it work properly, no one has
wanted to pick that up and add it yet :(

Depending on what else I'm working on, I'd like to get this fixed for
8.4.  Though, I'll probably be working on other, more important
projects.

-- 
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation                | fax: 732.331.1301
499 Thornall Street, 2nd Floor          | [EMAIL PROTECTED]
Edison, NJ 08837                        | http://www.enterprisedb.com/

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to