Search Postgresql Archives

Re: delete vs insert vs update due to primary key dups -> which is better

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

 




On Aug 28, 2007, at 3:10 , Richard Huxton wrote:

Ow Mun Heng wrote:
less typing per insert/update statement so it'll be where a.pkey = b.pkey instead of a.key1 = b.key1 and a.key2 = b.key2
and ... up to key5

I'd still leave it alone, but it's your database.

And you can use the row comparison syntax;

WHERE (a.key1, a.key2, a.key3, a.key4, a.key5) = (b.key1, b.key2, b.key3, b.key4, b.key5)

which I find very convenient as it makes the composite key much clearer than ANDed equalities.

Michael Glaesemann
grzm seespotcode net



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[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