Can I use a query with UPDATE on its SET?

Поиск
Список
Период
Сортировка
От Eus
Тема Can I use a query with UPDATE on its SET?
Дата
Msg-id 444142.23217.qm@web37602.mail.mud.yahoo.com
обсуждение исходный текст
Ответы Re: Can I use a query with UPDATE on its SET?  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-general
Hi Ho!

Since I can do:

INSERT INTO table (SELECT a_transaction.*);

I am wondering whether I can do:

UPDATE table SET (SELECT a_transaction.*) WHERE primary_key = (SELECT a_transaction.primary_key);

instead of:

DELETE FROM table WHERE primary_key = (SELECT a_transaction.primary_key);
INSERT INTO table (SELECT a_transaction.*);



Can I? I am using PostgreSQL 8.3.5. I get the feel that I cannot do so from reading the manual.

Thank you.



Best regards,
Eus (FSF member #4445)

In this digital era, where computing technology is pervasive, your freedom depends on the software controlling those
computingdevices. 

Join free software movement today! It is free as in freedom, not as in free beer!

Join: http://www.fsf.org/jf?referrer=4445




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

Предыдущее
От: Thom Brown
Дата:
Сообщение: Re: Warm standby failover mechanism
Следующее
От: Grzegorz Jaśkiewicz
Дата:
Сообщение: funny view/temp table problem with query