Q: insert/update in same statement - Mailing list pgsql-sql

From grk@usa.net (G. Ralph Kuntz, MD)
Subject Q: insert/update in same statement
Date
Msg-id 9881c752.0309120955.72b8460e@posting.google.com
Whole thread Raw
Responses Re: Q: insert/update in same statement
List pgsql-sql
Is it possible to make a single SQL statement that will insert a row
if it does not already exist, otherwise it will just update the
fields?

Actually, just a statement that will not give an error about duplicate
keys would be enough for my application.

Something like

INSERT INTO SOME_TABLE (FIELD1, ...) VALUES (VALUE1, ...) WHERE
KEY_FIELD DOES NOT EXIST;

I am working in PostgreSQL 7.3.x.

Thanks, Ralph


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: createlang problme
Next
From: grk@usa.net (G. Ralph Kuntz, MD)
Date:
Subject: Q: select query