Re: Writeable CTEs

From: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: PostgreSQL development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Writeable CTEs
Date: 2010-01-05 17:45:30
Message-ID: 4B437ABA.6000405@cs.helsinki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stefan Kaltenbrunner 2010-01-05 17:49:24 Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial
Previous Message Robert Haas 2010-01-05 17:40:04 Re: Re: [COMMITTERS] pgsql: Get rid of the need for manual maintenance of the initial