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

Home » RADICORE » RADICORE Installation Issues » pg_connect parameter order?
pg_connect parameter order? [message #1176] Wed, 28 November 2007 07:52 Go to next message
chrisvwn is currently offline  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 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2350
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?


Re: pg_connect parameter order? [message #1178 is a reply to message #1177] Fri, 30 November 2007 05:18 Go to previous messageGo to next message
chrisvwn is currently offline  chrisvwn
Messages: 3
Registered: November 2007
Junior Member
That's very true. With named arguments the order should not matter. I have $GLOBALS['PGSQL_dbname'] = 'radicore'. I actually haven't found out if this is a bug in that release since after changing the order, I managed to log onto radicore immediately and it's working fine now. I will try changing the order back and posting what results I get.

Cheers
Re: pg_connect parameter order? [message #1184 is a reply to message #1176] Thu, 06 December 2007 01:46 Go to previous messageGo to next message
chrisvwn is currently offline  chrisvwn
Messages: 3
Registered: November 2007
Junior Member
i have confirmed that the error repeats if the order of arguments is changed back. i am not sure about my postgres version, since it does not even have the REPLACE function - the help does not include such a command. this means that some of the scripts that are included with radicore won't run giving me a syntax error. is it just me? i am using postgresql 8.2.3 that comes with fedora core 7.

cheers
Re: pg_connect parameter order? [message #1185 is a reply to message #1184] Thu, 06 December 2007 04:38 Go to previous message
AJM is currently offline  AJM
Messages: 2350
Registered: April 2006
Location: Surrey, UK
Senior Member
The order of the arguments does not have any effect of either of my PCs, and no-one else who uses Radicore with PostgreSQL has reported such a problem.

There is no REPLACE INTO instruction in PostgreSQL. All those scripts were created from a MySQL database, so will need to be modified for postgreSQL and Oracle. See note 7 in http://www.radicore.org/installation.php


Previous Topic: Hi all,
Next Topic: Problem with IIS
Goto Forum:
  


Current Time: Mon Jun 24 09:46:07 EDT 2024

Total time taken to generate the page: 0.01077 seconds