> 1) create the copy of the row and return the identifier
> 2) apply updates on the new row identified by the identifier returned in step
> 1
>
> If possible, I want to write this in a single command, to avoid overhead and
> mistakes.
>
> I tried writing a rewrite rule or before trigger, but i
On 7/27/2011 4:22 PM, Peter V wrote:
I want to apply updates on a copy of a row, instead on the row itself.
The queries are above were simplied to demonstrate the problem.
So basically I want to do:
1) create the copy of the row and return the identifier
2) apply updates on the new row identifi
> Date: Wed, 27 Jul 2011 16:16:48 -0500
> Subject: Re: [GENERAL] WITH x AS (...) and visibility in UPDATE
> From: mmonc...@gmail.com
> To: peterv861...@hotmail.com
> CC: pgsql-general@postgresql.org
>
> On Wed, Jul 27, 2011 at 4:
On Wed, Jul 27, 2011 at 4:03 PM, Peter V wrote:
>> On Wed, Jul 27, 2011 at 3:18 PM, Peter V wrote:
>> >
>> > Hello all,
>> >
>> > I am trying out PostgreSQL 9.1 Beta 3. In particular, I am very interested
>> > in WITH x AS (...) construction.
>> >
>> > drop table if exists t;
>> > create table t
> Date: Wed, 27 Jul 2011 15:58:04 -0500
> Subject: Re: [GENERAL] WITH x AS (...) and visibility in UPDATE
> From: mmonc...@gmail.com
> To: peterv861...@hotmail.com
> CC: pgsql-general@postgresql.org
>
> On Wed, Jul 27, 2011 at 3:
On Wed, Jul 27, 2011 at 3:18 PM, Peter V wrote:
>
> Hello all,
>
> I am trying out PostgreSQL 9.1 Beta 3. In particular, I am very interested in
> WITH x AS (...) construction.
>
> drop table if exists t;
> create table t
> (
> identifier serial,
> title text
> );
>
> with c as
>
Hello all,
I am trying out PostgreSQL 9.1 Beta 3. In particular, I am very interested in
WITH x AS (...) construction.
drop table if exists t;
create table t
(
identifier serial,
title text
);
with c as
(
insert into t (title) values ('old') returning *
)
update t set titl