Re: Casting Varchar to Numeric

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Andy Marden <amarden(at)usa(dot)net>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Casting Varchar to Numeric
Date: 2001-12-06 23:08:19
Message-ID: 20011206150158.O28880-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 ;)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2001-12-06 23:09:20 Re: Database links in Postgresql.
Previous Message mordicus 2001-12-06 22:29:34 Trigger problem