Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f3RCpw381150 for ; Fri, 27 Apr 2001 08:51:58 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3QFu4316384 for ; Thu, 26 Apr 2001 11:56:04 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f3QFbvR93827 for pgsql-sql@postgresql.org; Thu, 26 Apr 2001 11:37:57 -0400 (EDT) (envelope-from news) From: Vivek Khera X-Newsgroups: comp.databases.postgresql.sql Subject: Re: MySql 'REPLACE' Date: 26 Apr 2001 11:37:56 -0400 Organization: Khera Communications, Inc., Rockville, MD Lines: 20 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: scrappy@hub.org User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) To: pgsql-sql@postgresql.org X-Archive-Number: 200104/420 X-Sequence-Number: 2782 >>>>> "JD" == Jeffrey Diehl 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/