po zmianie wersji na PHP 5 i PostgreSQL 8.2

przy zapytaniu do bazy
  1. <?php
  2. $SQL = "select * from exclude_time "; 
  3. $SQL.= "where to_timestamp((select current_date) || (select current_time), 'YYYY-DD-MMHH24:MI:SS') between ";
  4. $SQL.= "to_timestamp(exclude_time_from_date || exclude_time_from_time, 'YYYY-DD-MMHH24:MI:SS') and ";
  5. $SQL.= "to_timestamp(exclude_time_to_date || exclude_time_to_time, 'YYYY-DD-MMHH24:MI:SS') and ";
  6. $SQL.= "exclude_time_page_id = $PageId";
  7. ?>


wyskoczył mi błąd w postaci

  1. Database error: Invalid SQL: select * from exclude_time where to_timestamp((select current_date) || (select current_time), 'YYYY-DD-MMHH24:MI:SS') between to_timestamp(exclude_time_from_date || exclude_time_from_time, 'YYYY-DD-MMHH24:MI:SS') and to_timestamp(exclude_time_to_date || exclude_time_to_time, 'YYYY-DD-MMHH24:MI:SS') and exclude_time_page_id = 15
  2. PostgreSQL Error: 1 (ERROR: operator does not exist: date || time with time zone at character 69 HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.)
  3. Session halted.

Doradźcie co z tym zrobić.