Index: openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql,v diff -u -r1.30 -r1.31 --- openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 18 Nov 2002 18:01:04 -0000 1.30 +++ openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 21 Dec 2002 22:28:44 -0000 1.31 @@ -44,22 +44,22 @@ --- we use $ n_past-days instead of :n_past_days becasuse he pgdriver +-- we use $ n_past-days instead of :n_past_days because the 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. +-- so now()-'-1' fails but now()- interval '-1' works fine. select fc.* from (select fs_objects.object_id, fs_objects.name, fs_objects.live_revision, fs_objects.type, - to_char(fs_objects.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, + to_char(fs_objects.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified, fs_objects.content_size, fs_objects.url, fs_objects.key, fs_objects.sort_key, fs_objects.file_upload_name, - case when fs_objects.last_modified >= (now() - $n_past_days) then 1 else 0 end as new_p, + case when fs_objects.last_modified >= (now() - interval '$n_past_days 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