Search Postgresql Archives

Re: newbie question - delete before insert

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

 



Grant Mckenzie wrote on 20.11.2010 07:00:
How do people implement insert or upate ( otherwise known as upsert )
behaviour in postgres i.e. insert a row if it's key does not exist in
the database else update the existing row?


You can simply send the UPDATE, if nothing was updated, it's safe to send the INSERT

Regards
Thomas



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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