mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-17020 dml: native pgsql driver - fixed error detection on connect
This commit is contained in:
parent
1fe1d10454
commit
9a4f9e334a
1 changed files with 6 additions and 4 deletions
|
@ -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'";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue