Re: mysql replace in postgreSQL? - Mailing list pgsql-general

From Jan Wieck
Subject Re: mysql replace in postgreSQL?
Date
Msg-id 43684E71.80604@Yahoo.com
Whole thread Raw
In response to Re: mysql replace in postgreSQL?  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
Responses Re: mysql replace in postgreSQL?  (Tzvetan Tzankov <tzankov@noxis.net>)
Re: mysql replace in postgreSQL?  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
List pgsql-general
On 10/31/2005 11:58 AM, Lincoln Yeoh wrote:

> At 08:24 AM 10/30/2005 -0800, David Fetter wrote:
>
>> > >http://developer.postgresql.org/docs/postgres/plpgsql-control-structure
>> s.html#PLPGSQL-ERROR-TRAPPING
>> >
>> > Erm, doesn't it have the same race conditions?
>>
>>No, don't believe it does.  Have you found some?
>
> Depends on how you do things.
>
> As I mentioned, it's only fine if you have the relevant uniqueness constraint.

One would use MySQL's REPLACE INTO to avoid duplicates. To deliberately
omit the UNIQUE constraint in order to make the stored procedure
solution fail would smell a lot like the old MySQL crashme BS ... first
create and drop 10,000 tables to bloat the system catalog, next vacuum
with a user that doesn't have privileges to vacuum system catalogs
(because we told them to vacuum after that silly crap test), then show
that the system is still slow.

Using REPLACE INTO at one place and creating duplicates on purpose in
another seems to make zero sense to me. Until one can explain the reason
for that to me, I claim that a UNIQUE constraint on such key is a
logical consequence.


Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #

pgsql-general by date:

Previous
From: "Venki"
Date:
Subject: Re: Disappearing Records
Next
From: Guido Neitzer
Date:
Subject: Re: PostgreSQL, Mac OS X and locales