Thomas Lockhart <[EMAIL PROTECTED]> writes: > Implement precision for the INTERVAL() type. > Use the typmod mechanism for both of INTERVAL features.
If I could figure out what the typmod of an interval type is defined to be, I'd fix format_type() to display the type name properly so that pg_dump would do the right thing. But it doesn't seem very well documented as to what the valid values are... Also: regression=# create table foo(f1 interval(6)); CREATE regression=# insert into foo values ('1 hour'); ERROR: AdjustIntervalForTypmod(): internal coding error which I think is because if (range == MASK(YEAR)) should be else if (range == MASK(YEAR)) at line 384 of timestamp.c. Also, you're going to have some problems with your plan to make 0xFFFF in the high bits mean "no range, but maybe a precision", because there are a number of places that think that any typmod < 0 is a dummy. I would strongly suggest that you arrange the coding of interval's typmod to follow that convention, rather than assume you can ignore it. Perhaps use 0x7FFF (or zero...) to mean "no range", and make sure none of the bits that are used are the sign bit? regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly