diff --git a/code/PostgreSQLQuery.php b/code/PostgreSQLQuery.php index 7951350..e3dc27d 100644 --- a/code/PostgreSQLQuery.php +++ b/code/PostgreSQLQuery.php @@ -81,7 +81,13 @@ class PostgreSQLQuery extends Query $record[$k] = $v; $type = pg_field_type($this->handle, $i); if (isset(self::$typeMapping[$type])) { - settype($record[$k], self::$typeMapping[$type]); + if ($type === 'bool' && $record[$k] === 't') { + $record[$k] = 1; + + // Note that boolean 'f' will be converted to 0 by this + } else { + settype($record[$k], self::$typeMapping[$type]); + } } }