From d97111833c92b62405fabe186dc0ecbf88266a92 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 10 Jul 2012 13:50:45 +0000 Subject: [PATCH] * PostgreSQL: fixed SQL error using egw_db::unix_timestamp(): No function matches the given name and argument types --- phpgwapi/inc/class.egw_db.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.egw_db.inc.php b/phpgwapi/inc/class.egw_db.inc.php index a5b1aefb97..b27e580093 100644 --- a/phpgwapi/inc/class.egw_db.inc.php +++ b/phpgwapi/inc/class.egw_db.inc.php @@ -1248,7 +1248,7 @@ class egw_db return "UNIX_TIMESTAMP($expr)"; case 'pgsql': - return "DATE_PART('epoch',$expr)"; + return "EXTRACT(EPOCH FROM CAST($expr AS TIMESTAMP))"; case 'mssql': return "DATEDIFF(second,'1970-01-01',($expr))"; @@ -1270,7 +1270,7 @@ class egw_db return "FROM_UNIXTIME($expr)"; case 'pgsql': - return "(timestamp with time zone 'epoch' + ($expr) * interval '1 sec')"; + return "(TIMESTAMP WITH TIME ZONE 'epoch' + ($expr) * INTERVAL '1 sec')"; case 'mssql': // we use date(,0) as we store server-time return "DATEADD(second,($expr),'".date('Y-m-d H:i:s',0)."')";