pg_connect parameter order? [message #1176] |
Wed, 28 November 2007 07:52 |
chrisvwn
Messages: 3 Registered: November 2007
|
Junior Member |
|
|
Hi,
I almost pulled my hair out installing radicore since i kept getting the error that the audit schema did not exist. but through farther debugging, i realized that although the system was connecting to postgresql, it was connecting to the wrong database - the postgresql default db.
the way i solved this was to change the code in dml.pgsql.inc and changing the order of parameters for the connection from pg_connect("host=$host,user=$user,pass=$pass,db=$db") to pg_connect("host=$host,db=$db,user=$user,pass=$pass") - not the exact syntax but you can see the change in the location of the dbase parameter.
worked for me.
postgresql 8.2.3
php 5.2.1
cheers
|
|
|
Re: pg_connect parameter order? [message #1177 is a reply to message #1176] |
Wed, 28 November 2007 10:15 |
AJM
Messages: 2369 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
I am using PHP 5.2.5 and PostgreSQL 8.2.3, and I have never encountered this problem. I can connect to the 'radicore' database (as specified in $GLOBALS['PGSQL_dbname'] in the config.inc file) and access any schema within that database without any problem whatsoever.
The manual does not indicate any sequence in which the arguments in the connection string should be specified, and as they are named arguments it should not matter anyway. I have tried altering the sequence, but every sequence yields exactly the same result - they all work the same.
If your debugging revealed that you were connecting to the postgresql default db instead of the 'radicore' db, then what value did you have in $GLOBALS['PGSQL_dbname']? Did you actually create a db with this name? Did you create all the radicore schemas (menu, audit, dict, workflow) within this db?
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
|