Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dennis Gearon <gearond(at)cvc(dot)net>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-general(at)postgresql(dot)org
Subject: Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...
Date: 2003-02-18 05:04:21
Message-ID: 20964.1045544661@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dennis Gearon <gearond(at)cvc(dot)net> writes:
> So, will this work correctly? ( I am still waiting for SSH
> access to my site to play with Postgres ):
> create table test_timestamp(
> created timestamp DEFAULT CURRENT_TIMESTAMP::timestamptz NOT NULL
> );

I think you want

created timestamptz DEFAULT CURRENT_TIMESTAMP NOT NULL

CURRENT_TIMESTAMP is already timestamptz, you need not cast it. But you
do want the column to be type timestamptz not timestamp.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sean Chittenden 2003-02-18 05:05:02 Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...
Previous Message Tom Lane 2003-02-18 04:54:59 Re: Index not used with IS NULL