Re: Casting Varchar to Numeric - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Casting Varchar to Numeric
Date
Msg-id 20011206150158.O28880-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: Casting Varchar to Numeric  ("Andy Marden" <amarden@usa.net>)
Responses Re: Casting Varchar to Numeric
List pgsql-general
On Mon, 3 Dec 2001, Andy Marden wrote:

> Martijn,
>
> It does work (believe it or not). I've now tried the method you mention
> below - that also works and is much nicer. I can't believe that PostgreSQL
> can't work this out. Surely implementing an algorithm that understands that
> if you can go from a ->b and b->c then you can certainly go from a->c. If

It's more complicated than that (and postgres does some of this but not
all), for example the cast text->float8->numeric potentially loses
precision and should probably not be an automatic cast for that reason.

> this is viewed as too complex a task for the internals - at least a diagram
> or some way of understanding how you should go from a->c would be immensely
> helpful wouldn't it! Daunting for anyone picking up the database and trying
> to do something simple(!)

There may be a need for documentation on this.  Would you like to write
some ;)


pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Trigger problem
Next
From: Andrew Snow
Date:
Subject: Re: How to make a REALLY FAST db server?