Re: Merge condition in postgresql

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Merge condition in postgresql
Дата
Msg-id 20080204142742.GE5031@tamriel.snowman.net
обсуждение исходный текст
Ответ на Merge condition in postgresql  ("Amit jain" <amitjain.bit@gmail.com>)
Ответы Re: Merge condition in postgresql  ("Roberts, Jon" <Jon.Roberts@asurion.com>)
Список pgsql-hackers
* Amit jain (amitjain.bit@gmail.com) wrote:
> I am currently migrating database from ORACLE to postgresql but i am stucked
> up at one point while creating procedures.
> There is a query which has used oracle MERGE condition so how can i change
> this query as per posgresql. kindly suggest me its very urgent.

If you're talking about what I think you're talking about, then
basically you need to break up the MERGE into seperate insert/update
steps.  You just have to write the queries such that if the record
doesn't exist, it gets inserted, and if it does exist, then it gets
updated.  MERGE just allows you to do this in a nicer, somewhat more
efficient, way.  If you've got alot of transactions happening around the
same time with the table in question then you may also have to write
your logic to be able to handle a rollback and to try again.
Enjoy,        Stephen

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

Предыдущее
От: Ron Mayer
Дата:
Сообщение: Re: configurability of OOM killer
Следующее
От: "Roberts, Jon"
Дата:
Сообщение: Re: Merge condition in postgresql