MDL-17020 dml: native pgsql driver - fixed error detection on connect

This commit is contained in:
skodak 2008-10-28 15:37:15 +00:00
parent 1fe1d10454
commit 9a4f9e334a

View file

@ -102,10 +102,12 @@ class pgsql_native_moodle_database extends moodle_database {
}
$status = pg_connection_status($this->pgsql);
if ($status === PGSQL_CONNECTION_BAD) {
if ($status === false or $status === PGSQL_CONNECTION_BAD) {
$this->pgsql = null;
return false;
}
pg_set_client_encoding($this->pgsql, 'utf8');
// find out the bytea oid
$sql = "SELECT oid FROM pg_type WHERE typname = 'bytea'";