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

Поиск
Список
Период
Сортировка
От Szymon Guz
Тема Re: It is possible to update more than 1 table in the same update statement?
Дата
Msg-id AANLkTimbyGyKLYa__J=0R4GuSU24YfpV1r3wRxV4vam+@mail.gmail.com
обсуждение исходный текст
Ответ на Re: It is possible to update more than 1 table in the same update statement?  (Andre Lopes <lopes80andre@gmail.com>)
Ответы Re: It is possible to update more than 1 table in the same update statement?  (Andre Lopes <lopes80andre@gmail.com>)
Список pgsql-general


On 7 November 2010 16:20, Andre Lopes <lopes80andre@gmail.com> 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Sergey Konoplev
Дата:
Сообщение: Re: Looking for a Generic lightweight job queueing (stack) implementation.
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: Run "postgresql\9.0\data" on a RAID-1 disk on my Local Area Network (LAN)