Re: Easy form of "insert if it isn't already there"?

Поиск
Список
Период
Сортировка
От Bartosz Dmytrak
Тема Re: Easy form of "insert if it isn't already there"?
Дата
Msg-id CAD8_UcYGOEzvnFkSPMyT2_YfP_KvFX2zscxfCE5HmYNW7kHA9w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Easy form of "insert if it isn't already there"?  (Berend Tober <btober@broadstripe.net>)
Список pgsql-general
Maybe to show how "found" works and how to ignore errors - that is my assumption only.

Regards,
Bartek


2012/2/15 Berend Tober <btober@broadstripe.net>
Chris Angelico wrote:
On Wed, Feb 15, 2012 at 5:26 PM, Bartosz Dmytrak<bdmytrak@eranet.pl>  wrote:

e.g. You can use BEGIN... EXCEPTION.... END, good example of
such approach is
there: http://www.postgresql.org/docs/9.1/static/plpgsql-control-structures.html#PLPGSQL-UPSERT-EXAMPLE;


I wonder why, in that example, you would not try the INSERT first, and if that fails, then do the update?




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

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

Предыдущее
От: Venkat Balaji
Дата:
Сообщение: Re: [GENERA]: Postgresql-9.1.1 synchronous replication issue
Следующее
От: Sandro Santilli
Дата:
Сообщение: Re: [postgis-users] ST_AsJpeg