Check for empty $schema in dml.psql.class.inc [message #7250] |
Wed, 06 February 2019 12:42 |
pdv
Messages: 15 Registered: January 2019
|
Junior Member |
|
|
Hi,
I'm new and trying to access some existing PostgreSQL databases with Radicore and on macos. Sofar I met a few problems which I could only solve by changing the code. I'll describe them in separate messages.
The first problem is similar to the one reported in the thread "SQLSRV Driver", message #4722. I could only connect to the database when hard coding the dbname (which is the postgresql schema).
The problem is in the following code in dml.pgsql.class.inc:
if (!empty($this->dbname) AND !empty($schema)) {
$result = $this->connect($schema) or trigger_error($this, E_USER_ERROR);
} else {
trigger_error('No value supplied for PGSQL_dbname', E_USER_ERROR);
} // if
This code fails because $schema is empty, e.g. when querying for the list of databases. $this->dbname refers here to the PGSQL_dbname. I removed the check on $schema.
The error message is also misleading in this case since PGSQL_dbname was not empty.
Regards,
Patrick
|
|
|