Re: Casting timestamp with time zone to varchar automatically

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: Casting timestamp with time zone to varchar automatically
Дата
Msg-id 20040803161842.GP88458@decibel.org
обсуждение исходный текст
Ответ на Re: Casting timestamp with time zone to varchar automatically  (Michael Glaesemann <grzm@myrealbox.com>)
Ответы Re: Casting timestamp with time zone to varchar automatically
Re: Casting timestamp with time zone to varchar automatically
Список pgsql-general
Unfortunatly, that still doesn't really answer my question. I have a
generic function that accepts varchars, and I'd like to be able to feed
it timestamps without explicitly converting. That's why I'd like to know
if there is a specific reason there's no default timestamp -> varchar
cast.

On Tue, Aug 03, 2004 at 03:57:36PM +0900, Michael Glaesemann wrote:
>
> On Aug 3, 2004, at 3:12 PM, Jim C. Nasby wrote:
>
> >Is there any reason why there isn't a predefined cast to go from a
> >timestamp to a varchar? Is there a reason not to add one?
>
> to_char should do what you need. People often need a specific form of
> timestamp if they need it to be a text value (rather than a native
> timestamp data type). to_char provides lots of flexibility
>
>
> Michael Glaesemann
> grzm myrealbox com
>

--
Jim C. Nasby, Database Consultant                  jim@nasby.net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

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