zend-db icon indicating copy to clipboard operation
zend-db copied to clipboard

PDO, PostgreSQL and bool

Open GeeH opened this issue 9 years ago • 2 comments

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7284 User: @mbn18 Created On: 2015-03-01T17:06:51Z Updated At: 2015-03-02T13:53:18Z Body PDO cast bool values to string so when such value is passed to PostgreSQL it fail: Example:

$value = false;
$sql = "INSERT INTO table (bool_field) VALUES (?);
$this->getAdapter()->query($sql)->execute([$values]);

To go around the problem I issue:

$value = ($value) ? true : '0';

Is it possible to cast such values in the driver?

Related info


Comment

User: @Ocramius Created On: 2015-03-02T13:53:18Z Updated At: 2015-03-02T13:53:18Z Body Eventually related:

  • doctrine/dbal#527
  • doctrine/dbal#564
  • doctrine/dbal#632
  • doctrine/dbal#625
  • doctrine/dbal#670

GeeH avatar Jun 28 '16 13:06 GeeH

Related to #125

froschdesign avatar Jul 20 '16 06:07 froschdesign

This repository has been closed and moved to laminas/laminas-db; a new issue has been opened at https://github.com/laminas/laminas-db/issues/114.

michalbundyra avatar Jan 16 '20 19:01 michalbundyra