Re: timestamp resolution? - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: timestamp resolution?
Date
Msg-id 3BBCA07E.676AAE07@fourpalms.org
Whole thread Raw
In response to timestamp resolution?  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Responses Re: timestamp resolution?
List pgsql-hackers
...
> Ah, I've got it.  Two problems: AdjustTimestampForTypmod is one brick
> shy of a load, and the hardwired calls to timestamp_in and friends
> weren't passing all the parameters they should.  (Can anyone think of
> a way for DirectFunctionCall to do any checking?)

OK, I found the second item last night, but am not sure why
AdjustTimestampForTypmod needs more fixes.

I'm going through gram.y and fixing up the implementations of
CURRENT_TIMESTAMP et al. One point folks will run into is that
CURRENT_TIMESTAMP *should* return time to the second, not fractions
thereof, and CURRENT_TIMESTAMP(p) should be used to get something more
precise. Another issue I just noticed is that the result of

create table t1 (d timestamp(2) default current_timestamp);

gives me two decimal points of fractional seconds (after fixups for
Tatsuo's reported troubles) but I would think that it should round to
the second. Looks like we are "type folding" past the typmod attributes.
Comments?
                     - Thomas


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: [COMMITTERS] pgsql/src/backend parser/parse_coerce.c utils/ ...
Next
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql/src/backend parser/parse_coerce.c utils/ ...