Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice... - Mailing list pgsql-general

From Tom Lane
Subject Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...
Date
Msg-id 20964.1045544661@sss.pgh.pa.us
Whole thread Raw
In response to Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...  (Dennis Gearon <gearond@cvc.net>)
List pgsql-general
Dennis Gearon <gearond@cvc.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Index not used with IS NULL
Next
From: Sean Chittenden
Date:
Subject: Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...