pushErrorHandler(array($this,'_pgsql_open_error')); $this->WikiDB_backend_PearDB($dbparams); $ErrorManager->popErrorHandler(); } function _pgsql_open_error($error) { if (preg_match('/^Undefined\s+index:\s+(options|tty|port)/', $error->errstr)) return true; // Ignore error return false; } /** * Pack tables. */ function optimize() { $dbh = &$this->_dbh; foreach ($this->_table_names as $table) { $dbh->query("VACUUM ANALYZE $table"); } } /** * Lock all tables we might use. */ function _lock_tables($write_lock = true) { $dbh = &$this->_dbh; $dbh->query("BEGIN WORK"); foreach ($this->_table_names as $table) { // FIXME: can we use less restrictive locking. // (postgres supports transactions, after all.) $dbh->query("LOCK TABLE $table"); } } /** * Unlock all tables. */ function _unlock_tables() { $dbh = &$this->_dbh; $dbh->query("COMMIT WORK"); } }; // (c-file-style: "gnu") // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?>