The following code sample used to work on postmodern-20110219-git (using quicklisp from that period). However it now breaks. I can no longer insert integers as dates or timestamps into tables. Updates don't work either, but the example below uses insert:
(ql:quickload "postmodern") ;; quicklisp version released yesterday - postmodern-20111203-git
(pomo:connect-toplevel "date_test" "snip" "snip" "localhost")
(gethash "integer_datetimes" (pomo::connection-parameters pomo:*database*))
=> "on"
=> T
(pomo:execute "create table date ( value date );")
(pomo:execute "insert into date ( value ) values ( $1 )" "2010-01-01")
(setf date (pomo:query "select * from date limit 1" :single))
=> 3471292800
(ignore-errors (pomo:execute "insert into date ( value ) values ( $1 )" date))
=> NIL
=> #<CL-POSTGRES-ERROR:INVALID-DATETIME-FORMAT {1004A00391}>
(pomo:execute "create table timestamp ( value timestamp );")
(pomo:execute "insert into timestamp ( value ) values ( $1 )" "2010-01-01")
1
1
(setf timestamp (pomo:query "select * from timestamp limit 1" :single))
=> 3471292800
(ignore-errors (pomo:execute "insert into timestamp ( value ) values ( $1 )" timestamp))
=> NIL
=> #<CL-POSTGRES-ERROR:INVALID-DATETIME-FORMAT {100403F391}>
--
---------------------------------------------------
Dr Lucas Hope - lucas.r.hope@skype
Machine Learning and Software Engineering Consultant
Melbourne, Australia