Here is a new patch series version.
I have created a new internal function for converting integers to
numeric, to make the implementation a bit more elegant and compact.
I have also created a new date_part(..., date) in C, and added more test
coverage for that.
Other than some of the semantic issues mentioned in the previous
message, this version looks pretty good to me in principle.
I have done some performance tests to assess the impact of changing from
float to numeric. I did tests like this:
create table t1 (a int, b timestamp with time zone);
insert into t1 select generate_series(1, 10000000), current_timestamp +
random() * interval '1000 days';
select extract(dow from b) from t1 \g /dev/null
select extract(epoch from b) from t1 \g /dev/null
There appears to be about a 20% increase in run time for these tests.
These are obviously extreme tests, so I think that would be okay. More
tests and testing ideas are welcome.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services