MySql 'REPLACE'

From: Alessio Bragadini <alessio(at)albourne(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: MySql 'REPLACE'
Date: 2001-04-25 12:38:43
Message-ID: 3AE6C553.74036D93@albourne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)albourne(dot)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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Thomas Good 2001-04-25 13:06:21 Re: MySql 'REPLACE'
Previous Message Antti Linno 2001-04-25 07:05:24 Re: RE:Table corrupted and data lost (second time in one month!!)