an other PostgreSQL compatibility problem: cast to varchar necessary

This commit is contained in:
Ralf Becker 2010-10-28 08:47:52 +00:00
parent 5cd2b962ea
commit de903d8957

View File

@ -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
*