Re: UPDATE OR REPLACE?

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: dandl <david(at)andl(dot)org>, 'Mike Sofen' <msofen(at)runbox(dot)com>, 'pgsql-general' <pgsql-general(at)postgresql(dot)org>
Subject: Re: UPDATE OR REPLACE?
Date: 2016-09-02 13:31:09
Message-ID: 3de0ebac-d68d-9f7a-5b1e-d8f0e66e72e0@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 09/01/2016 05:08 PM, dandl wrote:
>>> In my particular situation the case I care about is when the result
>> of an UPDATE is two identical rows. All I really want is a DISTINCT
>> option.
>>
>> Assuming I am following correctly what you want is that the result of
>> an UPDATE not be two identical rows.
>
> Correct. In practice I don't care whether the action is IGNORE or REPLACE (in Sqlite terms), the outcome is the same.

It is not:
https://www.sqlite.org/lang_conflict.html

>
> Obviously two different records that share the same primary key is a bad thing and worth an error. Two identical records is just boring.

I do not see how the Sqlite mechanism achieves that. It only looks at
UNIQUE, NOT NULL, CHECK, and PRIMARY KEY constraints. It is not looking
at the record in its entirety.

>
> Regards
> David M Bennett FACS
>
> Andl - A New Database Language - andl.org
>
>
>
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message dandl 2016-09-02 14:43:10 Re: UPDATE OR REPLACE?
Previous Message Albe Laurenz 2016-09-02 13:06:13 Re: Duplicate data despite unique constraint