Re: Casting varchar to interval.?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Casting varchar to interval.?
Дата
Msg-id 200401261551.15243.dev@archonet.com
обсуждение исходный текст
Ответ на Re: Casting varchar to interval.?  ("Jim Wilson" <jimw@kelcomaine.com>)
Ответы Re: Casting varchar to interval.?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Storing Configuration settings for a database?
Следующее
От: Eric Ridge
Дата:
Сообщение: Re: Storing Configuration settings for a database?