Re: newbie question - delete before insert

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: newbie question - delete before insert
Дата
Msg-id ic83f2$jpu$1@dough.gmane.org
обсуждение исходный текст
Ответ на newbie question - delete before insert  (Grant Mckenzie <mckenzig@optonline.net>)
Ответы Re: newbie question - delete before insert  (Ashish Karalkar <ashish.karalkar@netcore.co.in>)
Список pgsql-general
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


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

Предыдущее
От: Ron Mayer
Дата:
Сообщение: Re: Survey on backing up unlogged tables: help us with PostgreSQL development!
Следующее
От: Ashish Karalkar
Дата:
Сообщение: Re: newbie question - delete before insert