Hi,

Interesting. It seems to be happy if you give it a simple string "0 0:0:0", or, as you've uncovered, 1 millisecond.
But it doesn't like the encoding if you use (simple-date:encode-interval :anything 0)

Sabra

2011/1/23 Slobodan Milnović <slobodan.milnovic@gmail.com>
Hi,

I have an situation where I have an interval of "zero" time that I
would like to put with the other data in the table. When I try with
the (simple-date:encode-interval :millisecond 0) I get the object

> (simple-date:encode-interval :millisecond 0)
> #<SIMPLE-DATE:INTERVAL P>

But, when I try to insert this object into the table with the
insert-dao, I get the following error (I have left out other fields,
for other non-zero values of interval the insert works fine).

Database error 22007: invalid input syntax for type interval: ""
Query: INSERT INTO mytable (someinterval) VALUES (interval E'')
RETURNING somevalue
  [Condition of type CL-POSTGRES-ERROR:INVALID-DATETIME-FORMAT]

I'm using latest postmodern from the git repository
https://github.com/marijnh/Postmodern.git

For now I'll use (simple-date:encode-interval :millisecond 1), but I'm
wondering if this is an issue with postmodern or postgresql?

_______________________________________________
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel