Re: Casting varchar to interval.?

From: Richard Huxton <dev(at)archonet(dot)com>
To: jimw(at)kelcomaine(dot)com, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Casting varchar to interval.?
Date: 2004-01-26 15:51:15
Message-ID: 200401261551.15243.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday 26 January 2004 14:43, Jim Wilson wrote:
> Is this a bug? You can work around it by wrapping the varying in a trim()
> function (e.g. select trim(config_value)::interval from config). I've
> solved another suspicious looking issue with that same kind of workaround.

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
This might be fixed in 7.4.1, but you'll need to check.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric Ridge 2004-01-26 16:05:35 Re: Storing Configuration settings for a database?
Previous Message Richard Huxton 2004-01-26 15:48:11 Re: Storing Configuration settings for a database?