/** * Connect to the db */ public function connect() { parent::connect(); // Money type has a fixed precision of 10 in PostgreSQL 8.2 and below, and as of // PostgreSQL 8.3 it has a fixed precision of 19. PostgreSQLColumn.extract_precision // should know about this but can't detect it there, so deal with it here. Horde_Db_Adapter_Postgresql_Column::$moneyPrecision = $this->postgresqlVersion() >= 80300 ? 19 : 10; $this->_configureConnection(); }
public function testDefaultString() { $col = new Horde_Db_Adapter_Postgresql_Column('name', '', 'character varying(255)'); $this->assertEquals('', $col->getDefault()); }
/** * Connect to the db. * * @throws Horde_Db_Exception */ public function connect() { if ($this->_active) { return; } parent::connect(); $this->_lastQuery = $sql = "SET datestyle TO 'iso'"; $retval = $this->_connection->exec($sql); if ($retval === false) { $error = $this->_connection->errorInfo(); throw new Horde_Db_Exception($error[2]); } // Money type has a fixed precision of 10 in PostgreSQL 8.2 and below, and as of // PostgreSQL 8.3 it has a fixed precision of 19. PostgreSQLColumn.extract_precision // should know about this but can't detect it there, so deal with it here. Horde_Db_Adapter_Postgresql_Column::$moneyPrecision = $this->postgresqlVersion() >= 80300 ? 19 : 10; $this->_configureConnection(); }