Can I use a query with UPDATE on its SET? - Mailing list pgsql-general

From Eus
Subject Can I use a query with UPDATE on its SET?
Date
Msg-id 444142.23217.qm@web37602.mail.mud.yahoo.com
Whole thread Raw
Responses Re: Can I use a query with UPDATE on its SET?  (Craig Ringer <craig@postnewspapers.com.au>)
List 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 by date:

Previous
From: Thom Brown
Date:
Subject: Re: Warm standby failover mechanism
Next
From: Grzegorz Jaśkiewicz
Date:
Subject: funny view/temp table problem with query