[EMAIL PROTECTED] wrote:
> Hi all,
> 
> What I want to do is:
>      if a record already exists in the table, update it
>      if a record doesn't exist, insert it into the table
> 
> I know that there is a ON DUPLICATE clause with MySQL, so I'm wondering is 
> there a corresponding way to do this in PostgreSQL ?

You can find something equivalent in Example 37-1 in the Postgres Docs:
http://www.postgresql.org/docs/8.2/interactive/plpgsql-control-structures.html

Unfortunately, Postgres so far does not support the "MERGE" statement as 
newer versions of Oracle or SQL server do.

-- Chris

(And as D'Arcy already mentioned, the PostgreSQL mailing list is a 
better place for such questions.)
_______________________________________________
PyGreSQL mailing list
[email protected]
http://mailman.vex.net/mailman/listinfo/pygresql

Reply via email to