Re: Writeable CTEs
Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>
From: Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>
To: Greg Stark <gsstark@mit.edu>
Cc: PostgreSQL development <pgsql-hackers@postgresql.org>
Date: 2010-01-05T17:45:30Z
Lists: pgsql-hackers
On 2010-01-05 19:21 +0200, Greg Stark wrote: > with t as (delete from foo returning *) > select * from t where x=? > > applications will almost certainly expect the number to match the > actual number of rows returned and may well misbehave if they don't. I probably wasn't clear about the actual problem in the original post. The problem only affects INSERT, UDPATE and DELETE where you are actually counting affected rows (i.e. PQcmdTuples(), not PQntuples()) so the this example would work as expected. Regards, Marko Tiikkaja