Re: Casting varchar to interval.?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: jimw(at)kelcomaine(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: Casting varchar to interval.?
Date: 2004-01-26 16:37:57
Message-ID: 8152.1075135077@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Huxton <dev(at)archonet(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lamar Owen 2004-01-26 16:49:50 Re: I can't upgrade to PostgreSQL 7.4 in RedHat 9.0
Previous Message Greg Stark 2004-01-26 16:13:32 Re: FAQ (disk space)