Re: INSERT OU UPDATE WITHOUT SELECT?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: INSERT OU UPDATE WITHOUT SELECT?
Дата
Msg-id 20060530223818.GK31547@surnet.cl
обсуждение исходный текст
Ответ на Re: INSERT OU UPDATE WITHOUT SELECT?  (PFC <lists@peufeu.com>)
Список pgsql-performance
PFC wrote:
> >PostgreSQL does not support MERGE at the moment, sorry.
>
>     Issue an UPDATE, and watch the rowcount ; if the rowcount is 0,
>     issue an  INSERT.
>     Be prepared to retry if another transaction has inserted the row
> meanwhile, though.

Oh, you mean, like the example that's in the documentation?

http://www.postgresql.org/docs/8.1/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING

Example 36-1

>     MERGE would be really useful.

It has been discussed before -- MERGE is something different.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

Предыдущее
От: PFC
Дата:
Сообщение: Re: Optimizing a huge_table/tiny_table join
Следующее
От: "Dave Dutcher"
Дата:
Сообщение: Re: INSERT OU UPDATE WITHOUT SELECT?