From lucas.r.hope at gmail.com Fri Feb 10 03:36:33 2012 From: lucas.r.hope at gmail.com (Lucas Hope) Date: Fri, 10 Feb 2012 14:36:33 +1100 Subject: [postmodern-devel] Regression in handling integer dates and timestamps Message-ID: Hi there, 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 => # (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 => # -- --------------------------------------------------- Dr Lucas Hope - lucas.r.hope at skype Machine Learning and Software Engineering Consultant Melbourne, Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucas.r.hope at gmail.com Fri Feb 10 04:00:35 2012 From: lucas.r.hope at gmail.com (Lucas Hope) Date: Fri, 10 Feb 2012 15:00:35 +1100 Subject: [postmodern-devel] Regression in handling integer dates and timestamps In-Reply-To: References: Message-ID: Additional: My notes say that it succeeded on ~/quicklisp/dists/quicklisp/software/postmodern-20110619-git and failed on ~/quicklisp/dists/quicklisp/software/postmodern-20110829-git . -Luke On Fri, Feb 10, 2012 at 2:36 PM, Lucas Hope wrote: > Hi there, > > 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 > => # > > (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 > => # > > > -- > --------------------------------------------------- > Dr Lucas Hope - lucas.r.hope at skype > Machine Learning and Software Engineering Consultant > Melbourne, Australia > -- --------------------------------------------------- Dr Lucas Hope - lucas.r.hope at skype Machine Learning and Software Engineering Consultant Melbourne, Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: From marijnh at gmail.com Fri Feb 10 07:47:41 2012 From: marijnh at gmail.com (Marijn Haverbeke) Date: Fri, 10 Feb 2012 08:47:41 +0100 Subject: [postmodern-devel] Regression in handling integer dates and timestamps In-Reply-To: References: Message-ID: It could be that simple-date is being accidentally (or intentionally) loaded. Could you check whether the :simple-date package is present? That will register handlers for serializing date and time values, which might cause the behaviour you describe. These two patches might be to blame: https://github.com/marijnh/Postmodern/commit/f35a1124476d39d651baddbe1ba67917f1149833 https://github.com/marijnh/Postmodern/commit/ce1fd7a23b2e523dcc7b3f96fd60b486c5f17117 Best, Marijn From lucas.r.hope at gmail.com Tue Feb 14 04:12:42 2012 From: lucas.r.hope at gmail.com (Lucas Hope) Date: Tue, 14 Feb 2012 15:12:42 +1100 Subject: [postmodern-devel] Regression in handling integer dates and timestamps In-Reply-To: References: Message-ID: Hi Marijn, (ql:quickload "postmodern") (find-package :simple-date) => nil Alas, not so simple. Previously I'd had problems with simple-date always loading, and I worked around it with: (setf cl-postgres:*sql-readtable* (cl-postgres:default-sql-readtable))) => # But the erroneous behaviour I reported happens with or without that command. -Luke On Fri, Feb 10, 2012 at 6:47 PM, Marijn Haverbeke wrote: > It could be that simple-date is being accidentally (or intentionally) > loaded. Could you check whether the :simple-date package is present? > That will register handlers for serializing date and time values, > which might cause the behaviour you describe. These two patches might > be to blame: > > > https://github.com/marijnh/Postmodern/commit/f35a1124476d39d651baddbe1ba67917f1149833 > > https://github.com/marijnh/Postmodern/commit/ce1fd7a23b2e523dcc7b3f96fd60b486c5f17117 > > Best, > Marijn > > _______________________________________________ > postmodern-devel mailing list > postmodern-devel at common-lisp.net > http://lists.common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel > -- --------------------------------------------------- Dr Lucas Hope - lucas.r.hope at skype Machine Learning and Software Engineering Consultant Melbourne, Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: From marijnh at gmail.com Tue Feb 14 15:18:59 2012 From: marijnh at gmail.com (Marijn Haverbeke) Date: Tue, 14 Feb 2012 16:18:59 +0100 Subject: [postmodern-devel] Regression in handling integer dates and timestamps In-Reply-To: References: Message-ID: Did you verify that those older version of cl-postgres work with your current set-up (schema, postgres server etc)? If I revert to the version from June last year, I get the exact same error.