From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | thomas(at)pgsql(dot)com |
Cc: | PostgreSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: date/time improvements for 7.2 |
Date: | 2001-10-19 03:13:17 |
Message-ID: | 9669.1003461197@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Thomas Lockhart <lockhart(at)fourpalms(dot)org> 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
From | Date | Subject | |
---|---|---|---|
Next Message | Hiroshi Inoue | 2001-10-19 03:14:09 | Re: ODBC SQLBindParameter and UNICODE strings |
Previous Message | Tom Lane | 2001-10-19 01:34:31 | Re: VACUUM vs VACUUM ANALYZE |