Received: from opal.albourne.com (opal.albourne.com [195.212.241.228]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3PCcm388089 for ; Wed, 25 Apr 2001 08:38:48 -0400 (EDT) (envelope-from alessio@albourne.com) Received: from emily.cy.albourne.com (emily.cy.albourne.com [192.168.51.32]) by opal.albourne.com (8.9.3/8.9.3/Albourne/R/1.5) with ESMTP id PAA04645 for ; Wed, 25 Apr 2001 15:38:44 +0300 Received: from albourne.com (alessio@madeleine.cy.albourne.com [192.168.51.75]) by emily.cy.albourne.com (8.9.3/8.9.3/Albourne/S/1.4) with ESMTP id PAA14092; Wed, 25 Apr 2001 15:38:44 +0300 (EET DST) Message-ID: <3AE6C553.74036D93@albourne.com> Date: Wed, 25 Apr 2001 15:38:43 +0300 From: Alessio Bragadini Organization: APL Financial Services Overseas Ltd. X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.18pre21 i686) X-Accept-Language: it, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: MySql 'REPLACE' Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200104/374 X-Sequence-Number: 2732 I am working in porting the Slash software from MySql to PostgreSQL. I stepped in MySql's REPLACE command (a SQL command) that to my knowledge is not supported by PostgreSQL and it's not standard SQL. According to MySql's manual: "REPLACE works exactly like INSERT, except that if an old record in the table has the same value as a new record on a unique index, the old record is deleted before the new record is inserted. See section 7.21 INSERT syntax." REPLACE INTO table (column, column...) VALUES (value, value...) Has anyone had any experience about how to simulate it under PostgreSQL? I am using Perl and I can move most of the thing into application anyway. Thanks. -- Alessio F. Bragadini alessio@albourne.com APL Financial Services http://village.albourne.com Nicosia, Cyprus phone: +357-2-755750 "It is more complicated than you think" -- The Eighth Networking Truth from RFC 1925