From: Vivek Khera <khera@kcilink.com>
To: pgsql-sql@postgresql.org
Subject: Re: MySql 'REPLACE'
Date: 26 Apr 2001 11:37:56 -0400
Message-ID: <x7hezbpt7v.fsf@onceler.kciLink.com> (raw)
References: <B51F0C636E578A4E832D3958690CD73E0130BEC6@es04snlnt>
>>>>> "JD" == Jeffrey Diehl <jdiehl@sandia.gov> writes:
JD> Replace into does an insert by default. If however, there is
JD> already a record which would cause a unique index collision, then
JD> mysql does an update on that record. I want to prevent my
JD> application from having to do all of that bookkeeping.
No, MySQL does not do an update in that case. It deletes the existing
row, then does the insert. This really screws you over when you have
auto incrementing (sequence) columns, and screws you when you are not
specifying every field in the row (those columns take their defaults,
not the original values of the old row). It is really a useless
function, as far as I can tell.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera@kciLink.com Rockville, MD +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: khera@kcilink.com
Subject: Re: MySql 'REPLACE'
In-Reply-To: <x7hezbpt7v.fsf@onceler.kciLink.com>
References: <B51F0C636E578A4E832D3958690CD73E0130BEC6@es04snlnt> <x7hezbpt7v.fsf@onceler.kciLink.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox