From: | Rory Campbell-Lange <rory(at)campbell-lange(dot)net> |
---|---|
To: | Joel Burton <joel(at)joelburton(dot)com> |
Cc: | Postgresql Novice List <pgsql-novice(at)postgresql(dot)org> |
Subject: | Re: auto update dates |
Date: | 2002-05-24 15:12:53 |
Message-ID: | 20020524151253.GA1887@campbell-lange.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Thanks for the pointers, Joel.
On 24/05/02, Joel Burton (joel(at)joelburton(dot)com) wrote:
> > On 23/05/02, Joel Burton (joel(at)joelburton(dot)com) wrote:
> > > current_time returns timezone information, but you're trying to
> > > store this in a field that is time w/o timezone information.
> > > either coerce this data yourself, or make the field hold timezone
> > > info.
> > ERROR: Cannot cast type 'timestamp with time zone'
> > How do I get around this? I can see various time functions with and
> > without time zone data, but I don't know how to utilise them.
> SELECT cast(current_timestamp as time with time zone);
> will do nicely. See the Date/Time functions in the documentation for
> more help.
select to_char(timestamp 'now', 'YYYY/MM/DD'); => 2002/05/24 Brilliant!
OK, I'm now pointing my local apache to serve up the postgres docs.
Sorry for taking up unnecessary bandwidth.
Cheers, Rory
--
Rory Campbell-Lange
<rory(at)campbell-lange(dot)net>
<www.campbell-lange.net>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Ansley | 2002-05-24 15:55:04 | Using CASE with a boolean value |
Previous Message | Patrick Hatcher | 2002-05-24 14:48:16 | Re: COPY returns Bad timestamp external rep.. |