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

Home » RADICORE » How To » Check for empty $schema in dml.psql.class.inc
Re: Check for empty $schema in dml.psql.class.inc [message #7258 is a reply to message #7254] Thu, 07 February 2019 07:15 Go to previous messageGo to previous message
pdv is currently offline  pdv
Messages: 15
Registered: January 2019
Junior Member
Tony,

I realize the differences between MySQL and PostgreSQL, but it remains confusing.
I want to access existing postgresql-dbs and I had 2 options: install radicore in each of them in a separate schema, like this:

db1
---schema-radicore
------menu
------dict
....
---schema1
------table11
------table12
---....

db2
---schema-radicore
---.....

Or to install radicore in a separate pgsql-database, which I prefer:

db-radicore
---schema-public
------menu
------dict
....
db1
---schema1
------table11
------table12
...
db2
---schema2
------table21
------table22
---.....

This means I need at least 2 connections, one for a particular db and one for radicore.
This is my config.inc to access a pgsql-database bxtests with schema public (which I renamed to bxtests):

if (preg_match('/^(127.0.0.1|localhost|desktop|laptop)$/i', $_SERVER['SERVER_NAME'])) {
global $servers;
// server 0
$servers[0]['dbhost'] = 'localhost';
$servers[0]['dbengine'] = 'pgsql';
$servers[0]['dbusername'] = 'user1';
$servers[0]['dbuserpass'] = 'password1';
$servers[0]['dbport'] = '';
$servers[0]['dbsocket'] = '';
$servers[0]['dbprefix'] = '';
$servers[0]['dbnames'] = 'bxtests';
$servers[0]['PGSQL_dbname'] = 'bxtests';
$servers[0]['switch_dbnames'] = array('bxtests' => 'public'); // the PostgreSQL schema is 'public'
$servers[0]['ssl_key'] = '';
$servers[0]['ssl_cert'] = '';
$servers[0]['ssl_ca'] = '';
$servers[0]['ssl_capath'] = '';
$servers[0]['ssl_cipher'] = '';
// server 1
$servers[1]['dbhost'] = 'localhost';
$servers[1]['dbengine'] = 'pgsql';
$servers[1]['dbusername'] = 'user2';
$servers[1]['dbuserpass'] = 'password2';
$servers[1]['dbport'] = '';
$servers[1]['dbsocket'] = '';
$servers[1]['dbprefix'] = '';
$servers[1]['PGSQL_dbname'] = 'radicore';
$servers[1]['dbnames'] = '*';
} // if

With this server-configuration, when importing databases (schemas) I found that $schema was empty; I have not been able to clarify this, since I had not yet installed XDebug. I'll look at this again.


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: Wed May 01 12:45:36 EDT 2024

Total time taken to generate the page: 0.01067 seconds