Re: timestamp resolution? - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: timestamp resolution?
Date
Msg-id 3BBBF81E.C3EA31C7@fourpalms.org
Whole thread Raw
In response to timestamp resolution?  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Responses Re: timestamp resolution?
List pgsql-hackers
> Is this an expected behavior? I could not see why t1 and t2 are
> showing different time resolutions...

Even stranger, this only happens on the first call to CURRENT_TIMESTAMP
after starting a backend (example below), and stays that way if I just
do "select current_timestamp". Something must not be initialized quite
right, but I don't know what. Any guesses?
                       - Thomas

(backend already connected and have just dropped t1)

thomas=# create table t1 (d1 timestamp(2), d2 timestamp(2) default
current_timestamp);
CREATE
thomas=# insert into t1 values (current_timestamp);
INSERT 16572 1
thomas=# select * from t1;           d1             |            d2             
---------------------------+---------------------------2001-10-04 05:37:12.09+00 | 2001-10-04 05:37:12.09+00
(1 row)

thomas=# \q
myst$ psql
...
thomas=# insert into t1 values (current_timestamp);
INSERT 16573 1
thomas=# select * from t1;           d1             |            d2             
---------------------------+---------------------------2001-10-04 05:37:12.09+00 | 2001-10-04 05:37:12.09+002001-10-04
05:37:40+00   | 2001-10-04 05:37:39.72+00
 
(2 rows)

thomas=# insert into t1 values (current_timestamp);
INSERT 16574 1
thomas=# select * from t1;           d1             |            d2             
---------------------------+---------------------------2001-10-04 05:37:12.09+00 | 2001-10-04 05:37:12.09+002001-10-04
05:37:40+00   | 2001-10-04 05:37:39.72+002001-10-04 05:38:08.33+00 | 2001-10-04 05:38:08.33+00
 
(3 rows)


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: timestamp resolution?
Next
From: Michael Meskes
Date:
Subject: Re: My last ECPG commit