diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php b/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php index bd18b38c52e..1b0e081024b 100644 --- a/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php +++ b/lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php @@ -37,12 +37,14 @@ class PgSqlExpressionBuilder extends ExpressionBuilder { * @return string */ public function castColumn($column, $type) { - if ($type === IQueryBuilder::PARAM_INT) { - $column = $this->helper->quoteColumnName($column); - return new QueryFunction('CAST(' . $column . ' AS INT)'); + switch ($type) { + case IQueryBuilder::PARAM_INT: + return new QueryFunction('CAST(' . $this->helper->quoteColumnName($column) . ' AS INT)'); + case IQueryBuilder::PARAM_STR: + return new QueryFunction('CAST(' . $this->helper->quoteColumnName($column) . ' AS TEXT)'); + default: + return parent::castColumn($column, $type); } - - return parent::castColumn($column, $type); } /** |