Re: Replace into...?

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Replace into...?
Дата
Msg-id Pine.LNX.4.30.0103272207200.1215-100000@peter.localdomain
обсуждение исходный текст
Ответ на Replace into...?  ("Diehl, Jeffrey" <jdiehl@sandia.gov>)
Список pgsql-sql
Diehl, Jeffrey writes:

> I'm in the process of migrating a database and application suite from mysql
> to postgresql.  The problem is that I've used
> mysql's "replace into..." quite frequently...

begin transaction;
update ...
<if zero rows> insert ...
<endif>
commit;

or some permutation thereof.  If you need to do a lot of this, writing a
PL/pgSQL function might be worthwhile.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



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

Предыдущее
От: "Diehl, Jeffrey"
Дата:
Сообщение: Replace into...?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Replace into...?