Re: [HACKERS] Data type conversion again - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Re: [HACKERS] Data type conversion again
Date
Msg-id 3551491F.3A83657A@alumni.caltech.edu
Whole thread Raw
In response to Data type conversion again  ("Jackson, DeJuan" <djackson@cpsgroup.com>)
List pgsql-hackers
> OK guys this really concerns me.  And I really do consider it a bug.
> Now if Thomas has gotten this working for 6.4 I'll shut my trap.

Ooooh. Some motivation :) (sorry, couldn't resist...)

> But until I hear someone tell me that I'm overreacting or that it's
> fixed I'll continue to try to raise support for one or the other.
> test=> select dtm::DATE from dtm_test;
> ERROR:  Unable to convert null datetime to date

I'm suprised at this message and problem; will try to address it for
v6.4. In testing on my alpha code I'm not handling this any better yet
(and in fact have new problems with the null constant).

> to say 'Because of the range problems', then tell me what
> 'infinity'::TIMESTAMP is for.

A kludge to work around the limited range. Although you kids may not
realize it, "-infinity" is actually substantially earlier than 1902,
despite Postgres' behavior :)

> What this means is that for a lot of conversions you'd have to do at
> least two CAST steps.  Some conversions (even though they would make
> since) aren't possible.
>
> There are similar problems with varchar, text, and char.
> I'm not even sure about other types.
>
> If I'm way off base here I'm sure you guys will let me know.  If not,
> what can I do to help fix this.

Cataloging specific problems as you are doing is helpful. If you want to
keep a running list then I can ask you for it later, once I've gotten
the new type conversion code off the ground.

We've been chipping away at the type conversion and casting problem for
the last several releases, and things are a _lot_ more solid than they
were when we started. Consolidating types for v6.4 as we are doing with
character strings and perhaps date/time types will also help us focus on
the useful ones which remain.

                     - Tom

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: mailing lists
Next
From: Andreas Zeugswetter
Date:
Subject: AW: AW: [HACKERS] Re: [QUESTIONS] groups of users