From: Michael M Slusarz Date: Wed, 26 May 2010 22:11:00 +0000 (-0600) Subject: Postgres DB fixes X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=165a205c51b543f0065a300decb372cb59fb2bb1;p=horde.git Postgres DB fixes --- diff --git a/framework/Db/lib/Horde/Db/Adapter/Pdo/Pgsql.php b/framework/Db/lib/Horde/Db/Adapter/Pdo/Pgsql.php index 07779bed1..15c6b2b31 100644 --- a/framework/Db/lib/Horde/Db/Adapter/Pdo/Pgsql.php +++ b/framework/Db/lib/Horde/Db/Adapter/Pdo/Pgsql.php @@ -138,8 +138,13 @@ class Horde_Db_Adapter_Pdo_Pgsql extends Horde_Db_Adapter_Pdo_Base * @param int $idValue * @param string $sequenceName */ - public function insert($sql, $arg1=null, $arg2=null, $pk=null, $idValue=null, $sequenceName=null) + public function insert($sql, $arg1 = null, $arg2 = null, $pk = null, + $idValue = null, $sequenceName = null) { + if ($this->_write) { + return $this->_write->insert($sql, $arg1, $arg2, $pk, $idValue, $sequenceName); + } + // Extract the table from the insert sql. Yuck. $temp = explode(' ', $sql, 4); $table = str_replace('"', '', $temp[2]); diff --git a/framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php b/framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php index 53c18e6bb..7ca6940b5 100644 --- a/framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php +++ b/framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php @@ -61,7 +61,7 @@ class Horde_Db_Adapter_Postgresql_Schema extends Horde_Db_Adapter_Base_Schema if (!$column) return parent::quote($value, $column); - if (is_string($value) && $column->getType() == 'binary' && method_exists($column, 'stringToBinary')) { + if (is_string($value) && ($column->getType() == 'binary')) { /*@TODO test blobs/bytea fields with postgres/pdo and figure out how this should work */ return $this->quotedStringPrefix() . "'" . $column->stringToBinary($value) . "'";