Skip site navigation (1) Skip section navigation (2)

Re: BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Farid Zidan <farid(at)zidsoft(dot)com>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail
Date: 2010-06-05 02:41:32
Message-ID: AANLkTinvpWLi3CoBWYgNPxVdFbbLhEHZuYdp9buvDubV@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
On Fri, Jun 4, 2010 at 11:15 PM, Farid Zidan <farid(at)zidsoft(dot)com> wrote:
> Now this not rocket science, it's simple insert statement where we do not
> want duplicates inserted. Works on 10 other DBMSs.
>

I find usually when one person is arguing something is complex and
someone else is arguing it's simple it's the person who's claiming
it's simple who is wrong.

The other databases are not, I believe, preventing duplicates from
being inserted as you describe. They are removing duplicates from the
string constants and then silently converting to a different datatype
before inserting. When postgres removed these default casts to text it
turned up many instances where users had buggy code and Postgres had
been hiding from them by silently using string operators which was not
what users were expecting. In other words, while it might not matter
in this case, in general if you code in this style your code is buggy
and these other database implementations are not doing you any favours
by making it appear to work correctly most of the time.

-- 
greg

In response to

Responses

pgsql-bugs by date

Next:From: Farid ZidanDate: 2010-06-05 02:54:15
Subject: Re: Re: BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail
Previous:From: Kris JurkaDate: 2010-06-05 01:42:20
Subject: Re: Re: BUG #5490: Using distinct for select list causes insert of timestamp string literal to fail

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group