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      [EMAIL PROTECTED]       http://yi.org/peter-e/


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to