Re: Casting varchar to interval.? - Mailing list pgsql-general

From Tom Lane
Subject Re: Casting varchar to interval.?
Date
Msg-id 8152.1075135077@sss.pgh.pa.us
Whole thread Raw
In response to Re: Casting varchar to interval.?  (Richard Huxton <dev@archonet.com>)
List pgsql-general
Richard Huxton <dev@archonet.com> writes:
> The trim() is probably a coincidence (although I haven't tested extensively).
> The issue is that there is a cast from text => interval but not from varchar.
> The solution is to do something like:
>   config_value::text::interval

The reason trim() works is that its result is of type text.  A simple
cast is a more efficient solution though.

> This might be fixed in 7.4.1, but you'll need to check.

No, the cast still isn't there.  You could add it yourself though, see
CREATE CAST.

            regards, tom lane

pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: Re: FAQ (disk space)
Next
From: Lamar Owen
Date:
Subject: Re: I can't upgrade to PostgreSQL 7.4 in RedHat 9.0