Index: openacs.org-dev/packages/file-storage/tcl/file-storage-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs.org-dev/packages/file-storage/tcl/file-storage-procs-postgresql.xql,v
diff -u -r1.1.1.2 -r1.1.1.3
--- openacs.org-dev/packages/file-storage/tcl/file-storage-procs-postgresql.xql	25 Jul 2002 18:47:14 -0000	1.1.1.2
+++ openacs.org-dev/packages/file-storage/tcl/file-storage-procs-postgresql.xql	25 Jul 2002 20:06:15 -0000	1.1.1.3
@@ -44,7 +44,11 @@
 
     <fullquery name="fs::get_folder_contents.select_folder_contents">
         <querytext>
-            select fc.*
+-- we use $n_past-days instead of :n_past_days becasuse he pgdriver
+-- bind variable emulation puts single-quotes around the n_past_days
+-- integer. Postgresql tries to turn '-1' into a date datatype
+-- so now()-'-1' fails but now()- -1 works fine.
+	select fc.*
             from (select fs_objects.object_id,
                          fs_objects.name,
                          fs_objects.live_revision,
@@ -54,7 +58,7 @@
                          fs_objects.url,
                          fs_objects.key,
                          fs_objects.sort_key,
-                         case when fs_objects.last_modified >= (now() - :n_past_days::timespan) then 1 else 0 end as new_p,
+                         case when fs_objects.last_modified >= (now() - $n_past_days) then 1 else 0 end as new_p,
                          acs_permission__permission_p(fs_objects.object_id, :user_id, 'admin') as admin_p,
                          acs_permission__permission_p(fs_objects.object_id, :user_id, 'delete') as delete_p,
                          acs_permission__permission_p(fs_objects.object_id, :user_id, 'write') as write_p