I've been making a bit of progress on adding a day field to the Interval struct (thanks to the help of this list and the find folks on IRC). Selects and basic math seem to be working, and the code is passing more regression tests than it was before.

I'm running into a bit of a problem with storing the data in relations. For example:

test=# select '1 year 13 mons 2 days 26:03'::interval;
           interval
-------------------------------
2 years 1 mon 2 days 26:03:00
(1 row)

test=# create table interval_tbl (f1 interval);
CREATE TABLE
test=# insert into interval_tbl (f1) values ('1 year 13 mons 2 days 26:03'::interval);
INSERT 0 1
test=# select * from interval_tbl;
       f1
-----------------
2 days 26:03:00
(1 row)

It appears that the data isn't being stored properly. I think I need to make adjustments to AdjustIntervalForTypmod() in timestamp.c, but I could very easily be wrong. I'm unfamiliar with what this code is supposed to do and typmods in general. I've searched the mailing lists for hints but haven't found anything that has appeared particularly helpful. Would someone be able to give me a bit of background on typmod (and possibly related information) or suggest where I might find more information?

Thanks for any assistance.

Michael Glaesemann
grzm myrealbox com


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
     joining column's datatypes do not match

Reply via email to