Search Postgresql Archives

Re: WITH x AS (...) and visibility in UPDATE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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 it becomes quickly a mess to avoid infinite loops.
> 
> Any ideas are welcome. Thanks.
>                         
> 
Insert into table (cols)
Select ... From table;

As mentioned previously just modify the original row before inserting it into the table as a new record.

David J.
-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux