Re: how does one replace a row in Postgresql? (ala MySQL REPLACE) - Mailing list pgsql-sql

From Philip Hallstrom
Subject Re: how does one replace a row in Postgresql? (ala MySQL REPLACE)
Date
Msg-id 20011211163822.O70071-100000@teak.adhesivemedia.com
Whole thread Raw
In response to how does one replace a row in Postgresql? (ala MySQL REPLACE)  (Terrence Brannon <metaperl@mac.com>)
Responses why doesn't \d table_name show the table inheritance graph?
temp tables versus the global sql area
List pgsql-sql
Try to UPDATE the row.  If that fails, then insert it.

There's no REPLACE in postgresql (unless someone added it and forgot to
tell me :)

On Tue, 11 Dec 2001, Terrence Brannon wrote:

> A common task is to check to see if a row with a certain primary
> key exists before inserting it. If the row exists, then you
> simply update/overwrite its contents with the new row data.
> Otherwise you insert it.
>
> MySQL has a REPLACE command which does this.
>
> I didn't see one in the Postgresql manual. How do you do this in
> Postgresql?
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>



pgsql-sql by date:

Previous
From: Terrence Brannon
Date:
Subject: how does one replace a row in Postgresql? (ala MySQL REPLACE)
Next
From: "Andrew G. Hammond"
Date:
Subject: Re: Poolman/mySQL transaction exception on connect