forked from extern/egroupware
an other PostgreSQL compatibility problem: cast to varchar necessary
This commit is contained in:
parent
5cd2b962ea
commit
de903d8957
@ -1251,7 +1251,7 @@ class egw_db
|
||||
case 'mssql':
|
||||
return "DATEDIFF(second,'1970-01-01',($expr))";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1312,10 +1312,10 @@ class egw_db
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cast a column or sql expression to integer, necessary at least for postgreSQL
|
||||
*
|
||||
*
|
||||
* @param string $expr
|
||||
* @return string
|
||||
*/
|
||||
@ -1329,6 +1329,22 @@ class egw_db
|
||||
return $expr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cast a column or sql expression to varchar, necessary at least for postgreSQL
|
||||
*
|
||||
* @param string $expr
|
||||
* @return string
|
||||
*/
|
||||
function to_varchar($expr)
|
||||
{
|
||||
switch($this->Type)
|
||||
{
|
||||
case 'pgsql':
|
||||
return 'CAST('.$expr.' AS varchar)';
|
||||
}
|
||||
return $expr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correctly Quote Identifiers like table- or colmnnames for use in SQL-statements
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user