Re: problem with casting - Mailing list pgsql-sql

From Josh Berkus
Subject Re: problem with casting
Date
Msg-id 3A8C040F.E82255AE@agliodbs.com
Whole thread Raw
In response to problem with casting  ("postgresql" <pgsql@symcom.com>)
List pgsql-sql
Ted,

> responce:   can not cast type 'date' to 'text'
> 
> Did i miss-read this section. I thought I could cast the date to text. has anyone seen
> this or am I missreading the docs?

'fraid so.   You cannot cast Date as Text, because (presumably) the DB
engine doesn't know how you want to format the date.  Instead, use the
to_char builtin function, as defined in the docs:
http://www.postgresql.org/users-lounge/docs/7.0/postgres/functions2976.htm

Share & Enjoy!
-Josh Berkus

-- 
______AGLIO DATABASE SOLUTIONS___________________________                                       Josh Berkus  Complete
informationtechnology      josh@agliodbs.com   and data management solutions       (415) 565-7293  for law firms, small
businesses      fax  621-2533   and non-profit organizations.       San Francisco
 


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: [ADMIN] TPCH questions
Next
From: Peter Eisentraut
Date:
Subject: Re: [ADMIN] TPCH questions