Re: BUG #5490: INSERT doesn't force cast from text to timestamp - Mailing list pgsql-bugs

From Robert Haas
Subject Re: BUG #5490: INSERT doesn't force cast from text to timestamp
Date
Msg-id AANLkTinqaHuskUhj5blI3ngHUXIm74iTrmerIh2CXAdm@mail.gmail.com
Whole thread Raw
In response to Re: BUG #5490: INSERT doesn't force cast from text to timestamp  (Andy Balholm <andy@balholm.com>)
Responses Re: BUG #5490: INSERT doesn't force cast from text to timestamp  (Greg Stark <gsstark@mit.edu>)
List pgsql-bugs
On Mon, Jun 7, 2010 at 10:30 AM, Andy Balholm <andy@balholm.com> wrote:
> Craig Ringer wrote:
>> showing that your issue isn't actually with DISTINCT at all, but with Pg=
's unwillingness to *implicitly* cast a value of explict text type to anoth=
er type.
>
> Is there a way to make values of "undefined" type pass through the SELECT=
 DISTINCT filter (getting checked for uniqueness) but remain "undefined" if=
 all the values supplied for the column are "undefined"? I don't know if th=
e internal design of SELECT DISTINCT and the type system would allow for th=
is, but if it would, it would take care of Farid's problem without introduc=
ing implicit type casts.

The issue isn't what's technically possible, but what's least likely
to lead to surprising behavior.  This whole thread is basically about
whether implicit casts to and from text are a good idea or not.  The
OP obviously thinks they are, and everyone else (whether they agree
with the behavior or not) is trying to explain the reasons why we
don't have them.

--=20
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

pgsql-bugs by date:

Previous
From: Robert Haas
Date:
Subject: Re: Invalid YAML output from EXPLAIN
Next
From: Tom Lane
Date:
Subject: Re: BUG #5490: INSERT doesn't force cast from text to timestamp