Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid
Дата
Msg-id 1294076937.19612.1812.camel@ebony
обсуждение исходный текст
Ответ на Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
On Mon, 2011-01-03 at 19:01 +0200, Heikki Linnakangas wrote:

> > If we do that, then we definitely need a catch-all WHEN statement, so
> > that we can say
> >
> > WHEN NOT MATCHED
> >    INSERT
> > WHEN MATCHED
> >    UPDATE
> > ELSE
> >    { INSERT into another table so we can try again in a minute
> >   or RAISE error }
> >
> > Otherwise we will silently drop rows. Throwing an error every time isn't
> > useful behaviour.
> 
> An ELSE clause would be nice, but it's not related to the question at 
> hand. Only some serialization anomalities result in a row that matches 
> neither WHEN MATCHED nor WHEN NOT MATCHED. 

Concurrent UPDATEs, DELETEs, MERGE

> Others result in a duplicate 
> key exception, for example.

Concurrent INSERTs, MERGE

So an ELSE clause is very relevant to handling anomalies in a useful
way.

-- Simon Riggs           http://www.2ndQuadrant.com/books/PostgreSQL Development, 24x7 Support, Training and Services



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: back branches vs. VS 2008