Received: from falcon.prod.itd.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBBNfxm41634 for ; Tue, 11 Dec 2001 18:41:59 -0500 (EST) (envelope-from metaperl@mac.com) Received: from pool0260.cvx26-bradley.dialup.earthlink.net ([209.179.223.5] helo=localhost) by falcon.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16DwXA-0000ub-00 for pgsql-sql@postgresql.org; Tue, 11 Dec 2001 15:42:01 -0800 Date: Tue, 11 Dec 2001 14:09:19 -0800 Subject: how does one replace a row in Postgresql? (ala MySQL REPLACE) Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v475) From: Terrence Brannon To: Content-Transfer-Encoding: 7bit In-Reply-To: <20011210131528.C70079-100000@megazone23.bigpanda.com> Message-Id: X-Mailer: Apple Mail (2.475) X-Archive-Number: 200112/117 X-Sequence-Number: 5940 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?