jian he <jian.universal...@gmail.com> writes:
> I thought:
> SELECT pg_catalog.interval('1 day 01:23:45.6789'::interval, 0)
> is same as
> SELECT interval(0) '1 day 01:23:45.6789'

[ shrug ]  No, it isn't.  Interval typmods have to carry a lot
more than just the fractional precision, because of all the
weird syntactic baggage that the SQL spec has for interval
types (i.e., YEAR TO MONTH and other options).  timestamp.h
has (some of) the details about what gets packed into an
interval typmod.

Even with simpler types, there generally isn't a one-to-one
correlation between user-visible precision and the encoded
typmod.

                        regards, tom lane


Reply via email to