> test=> select timefield::int8 from timetest;
> int8
> ---------
> 934931603
> 934931604
> 934931605
> (3 rows)
hmmm, as you did, i tried timefield::int4, and got the same results.
i hadn't tried timefield::int8.
i suspect this would be more efficient than date_part('epoch', timefield).
> What version of PostgreSQL, BTW? This is 6.5: int8 and numeric support got a
> lot better vs. 6.4
i am using 6.5, soon gonna upgrade to 6.5.1.
thanx, this will make my code much more efficient.
also, is there a reverse to this?
ie. how does one inject unix time_t data into an abstime field.
i currently pass my raw data through a filter, which converts it
to 'yyyy-mm-dd HH:MM:SS'.
then i bring it in using: "COPY tb USING STDIN;"
it would be nice if i could do a batch of:
"INSERT INTO tb (time_t, data1, date2) VALUES (934931604, 'aa', 'bb');"
--
[ Jim Mercer Reptilian Research jim@reptiles.org +1 416 410-5633 ]
[ The telephone, for those of you who have forgotten, was a commonly used ]
[ communications technology in the days before electronic mail. ]
[ They're still easy to find in most large cities. -- Nathaniel Borenstein ]