Re: someone working to add merge?

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: someone working to add merge?
Дата
Msg-id 20051111192246.GA1206@wolff.to
обсуждение исходный текст
Ответ на Re: someone working to add merge?  (Csaba Nagy <nagy@ecircle-ag.com>)
Ответы Re: someone working to add merge?  (Csaba Nagy <nagy@ecircle-ag.com>)
Список pgsql-hackers
On Fri, Nov 11, 2005 at 18:48:33 +0100, Csaba Nagy <nagy@ecircle-ag.com> wrote:
> OK, I'm relatively new on this list, and I might have missed a few
> discussions on this topic.
> I wonder if doing it this way would not be better than using a table
> lock:
> 
>  - set a save point;
>  - insert the row;
>      - on error:
>         - roll back to the save point;
>         - update the row;
>      - on success release the save point;
> 
> This would provide less contention while paying the prise for the save
> point. In low contention scenarios the table lock would be better, and I
> wonder for high contention scenarios which is better, the table lock, or
> the save point version...

You may not be able to update the row after the insert fails. If there is
insert occurring in another transaction, the row may not be visible to
the current transaction. In which case you can neither insert or update the
row. You need to wait for the other transaction to commit or rollback.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Multi-table-unique-constraint
Следующее
От: Tom Lane
Дата:
Сообщение: Re: someone working to add merge?