Re: ask for review of MERGE

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: ask for review of MERGE
Дата
Msg-id 20101024095009.GA4695@svana.org
обсуждение исходный текст
Ответ на Re: ask for review of MERGE  (Greg Stark <gsstark@mit.edu>)
Ответы Re: ask for review of MERGE  (Robert Haas <robertmhaas@gmail.com>)
Re: ask for review of MERGE  (Greg Stark <gsstark@mit.edu>)
Список pgsql-hackers
On Sat, Oct 23, 2010 at 03:59:13PM -0700, Greg Stark wrote:
> I think the blocker with MERGE has always been that the standard is
> *so* general that it could apply to conditions that *aren't* covered
> by a unique constraint or exclusion constriant. Personally, I'm fine
> saying that those cases will perform poorly, locking the table, or
> aren't allowed and print a warning explaining exactly what exclusion
> constraint or btree unique index would be necessary to allow it. I
> think virtually every case where people will want to use it will be on
> a primary key anyways.

Can we please not get MERGE hung up on trying to make it atomic. The
standard requires no such thing and there are plenty of uses of MERGE
that don't involve high concurrency updates of the same row by
different processes. If we want an atomic UPSERT, make that a seperate
command, MERGE without atomicity is useful enough already.

Simply, if the row is visible in the current snapshot you do an update
otherwise an insert. If you get an error, raise it. Icing can be added
later.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patriotism is when love of your own people comes first; nationalism,
> when hate for people other than your own comes first.
>                                       - Charles de Gaulle

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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: WIP: extensible enums
Следующее
От: Hsien-Wen Chu
Дата:
Сообщение: Re: PostgreSQL and HugePage