Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » Check for empty $schema in dml.psql.class.inc
Check for empty $schema in dml.psql.class.inc [message #7250] Wed, 06 February 2019 12:42 Go to previous message
pdv is currently offline  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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: convert_parent_id_to_child_id
Next Topic: Frequently Asked Questions (FAQ)
Goto Forum:
  


Current Time: Thu Nov 21 14:38:06 EST 2024

Total time taken to generate the page: 0.03295 seconds