Re: [SQL] CURRENT_TIMSTAMP

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Raymond Chui <raymond(dot)chui(at)noaa(dot)gov>
Cc: <pgsql-general(at)postgresql(dot)org>, <pgsql-sql(at)postgresql(dot)org>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: [SQL] CURRENT_TIMSTAMP
Date: 2002-12-02 21:27:36
Message-ID: 20021202132429.A57292-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general pgsql-sql

On Mon, 2 Dec 2002, Raymond Chui wrote:

> I created a column, dada type timstamp with time zone
> and with default CURRENT_TIMSTAMP
> it shows me the default is
>
> default ('now'::text)::timstamp(6) with time zone
>
> Then when I insert a row, the default timestamp value is
>
> yyyy-mm-dd HH:MM:ss.mmmmm+00
>
> where mmmmm is milliseconds.
> How do I make default only yyyy-mm-dd HH:MM:ss+00 ?

As already suggested you probably want a timestamp with time zone(0)
column, but if you really want the ability to insert partial seconds but
the default to not have partial seconds, you can use
CURRENT_TIMESTAMP(0) I believe.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message David F. Skoll 2002-12-02 22:10:00 What kind of index to use for many rows with few unique values?
Previous Message Nick Fankhauser 2002-12-02 19:49:45 Re: pg_restore error: function plpgsql_call_handler already exists with same argument types

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2002-12-02 21:30:13 Re: protecting prosrc (was Re: [GENERAL] USAGE on schema
Previous Message Joe Conway 2002-12-02 21:24:31 Re: protecting prosrc (was Re: [GENERAL] USAGE on schema

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2002-12-03 07:06:16 Re: Question about slow Select when using 'IN'.
Previous Message Jean-Luc Lachance 2002-12-02 19:54:10 Re: Min and Max