Re: someone working to add merge?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: someone working to add merge?
Дата
Msg-id 20083.1131730779@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: someone working to add merge?  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: someone working to add merge?  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Josh Berkus <josh@agliodbs.com> writes:
> Funny, we were just discussing this at OpenDBCon.   Seems that you can't do a
> full implementation of MERGE without Predicate Locking (the ability to say 
> "lock this table against inserts or updates of any row with key=5").  
> However, Peter suggested that we could do a proof-of-concept implementation, 
> working out syntax and trigger issues, based on a full table lock and do the 
> hard work once it was proved to be feasable.

If you don't have any better idea how to do it than a full table lock,
you might as well not do it at all.  A "proof of concept" that doesn't
solve the hard part of the problem is no proof :-(

My first guess about a real implementation would involve extending the
index AM API to offer a function "insert this key, or return the
existing match if there already is one".  This might tie into
refactoring the existing implementation of unique indexes, in which all
the problem is put on the AM's head (which is why only btree copes at
the moment).
        regards, tom lane


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: someone working to add merge?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 8.1 substring bug?