Re: auto update dates - Mailing list pgsql-novice

From Rory Campbell-Lange
Subject Re: auto update dates
Date
Msg-id 20020524151253.GA1887@campbell-lange.net
Whole thread Raw
In response to Re: auto update dates  ("Joel Burton" <joel@joelburton.com>)
List pgsql-novice
Thanks for the pointers, Joel.

On 24/05/02, Joel Burton (joel@joelburton.com) wrote:
> > On 23/05/02, Joel Burton (joel@joelburton.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@campbell-lange.net>
<www.campbell-lange.net>

pgsql-novice by date:

Previous
From: "Joel Burton"
Date:
Subject: Re: auto update dates
Next
From: Tom Ansley
Date:
Subject: Using CASE with a boolean value