Search Postgresql Archives

Re: It is possible to update more than 1 table in the same update statement?

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

 



The only way I can guarantee a transaction is in a Function or there are other ways?

Best Regards,



On Sun, Nov 7, 2010 at 3:22 PM, Szymon Guz <mabewlun@xxxxxxxxx> wrote:


On 7 November 2010 16:20, Andre Lopes <lopes80andre@xxxxxxxxx> wrote:
Sorry for not explain well.

I mean update more than one table at the same time with something like this:

update table1, table2
set
table1.f1 = 'aaa',
table2.date = '2001-01-01'
where
table1.id = 'x1' and table2.id = 'x1'

Something like this is possible? It is the best way to do it?

Best Regards,


This is not possible, however you could do two updates in one transaction.

regards
Szymon


[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