Re: Writeable CTEs and side effects - Mailing list pgsql-hackers

From Jaime Casanova
Subject Re: Writeable CTEs and side effects
Date
Msg-id 3073cc9b0910071416r1413fb55vc536cf98a2e5033f@mail.gmail.com
Whole thread Raw
In response to Writeable CTEs and side effects  (Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>)
Responses Re: Writeable CTEs and side effects
List pgsql-hackers
On Wed, Oct 7, 2009 at 4:08 PM, Marko Tiikkaja
<marko.tiikkaja@cs.helsinki.fi> wrote:
>
> 1)      WITH t AS
>        (UPDATE foo SET bar = bar+1 RETURNING *)
>        SELECT * FROM t LIMIT 1;
>
> What's problematic here is that only 1 row is read from the CTE, meaning
> also that only one row is updated which, at least how I see it, is not
> what we want.  The CTE should only store one row and return that after
> it has completely processed the UPDATE statement.
>

i'm talking from my ignorance... but AFAIU this should process the
whole UPDATE and then form a WorkTable with the results...
what the select reads from that results is another thing...

--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157


pgsql-hackers by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Writeable CTEs and side effects
Next
From: "Brad T. Sliger"
Date:
Subject: Re: Unicode UTF-8 table formatting for psql text output