[drupal-support] Fatal error: Call to undefined function: pg_connect()

Chris Johnson chris at tinpixel.com
Thu Feb 24 15:41:26 UTC 2005


Which version of Drupal are you using?  Are you sure you don't have a more 
site specific configuration file which is setting $db_url differently than the 
setting in conf.php?

There is only one way for database.pgsql.inc to get included and called, and 
that is if $db_type is not "mysql" (see approximatley line 108 of 
includes/database.inc depeneding on your version -- I'm looking at 4.5.2).

Please carefully re-read the INSTALL.txt file for whichever version of Drupal 
you have installed.  Also view the following links:

http://drupal.org/node/260
http://drupal.org/node/3710
http://drupal.org/node/275

--
Chris Johnson


emdeex wrote:
> No thats not it, the database is set correctly in includes/conf.php.
> -----------
> # $db_url = "mysql://user:password@hostname/database";
> # $db_url = "pgsql://user:password@hostname/database";
> $db_url = "mysql://mydbuser:mypassword@myhost/mydatabasename";
> ----------
> 
> Thats why I dont get why its calling the pg_connect.
> 
> Anyone else know why?
> 
> 
> On Wed, 23 Feb 2005 19:42:58 -0800, Djun Kim <Djun.Kim at cielosystems.com> wrote:
> 
>>Hi emdee,
>>
>>     which database Drupal will use depends on the database
>>specified in your site configuration file.  This is probably
>>a file called conf.php in the 'includes' directory of your
>>drupal installation.  There is a variable 'db_url'; in your
>>case it should look something like
>>
>>$db_url = "mysql://user:passwd@localhost/databasename";
>>
>>where user is the user that the drupal code runs as (usually
>>it's the same as the user that the web server runs as).
>>
>>    Probably when your configuration was restored, the wrong
>>db_url was selected.
>>
>>    Good luck.
>>
>>    Djun
>>
>>Quoting emdeex <emdeex at gmail.com>:
>>
>>
>>>I've just had a server restored and now my drupal database is giving
>>>this error when I try to access the site:
>>>
>>>Fatal error: Call to undefined function: pg_connect() in
>>>/home/stonetil/public_html/includes/database.pgsql.inc on line 28
>>>
>>>I see that this is a PostgreSQL database connection routine, but I
>>>don't have postgresql installed.  Ive always used MySQL.
>>>
>>>Why is drupal calling this routine, and how can I make it go back to
>>>using MySQL?
>>>
>>>The include database.inc seems to indicate that Drupal is looking to
>>>set an active database, why?  Can I override it?
>>>
>>>thanks
>>>emdee
>>>--
>>>[ Drupal support list | http://lists.drupal.org/ ]
>>>
>>
>>--
>>Djun M. Kim, Director                           djun.kim at cielosystems.com
>>Cielo Systems Inc.                              http://www.cielosystems.com
>>Strategic Software Research                     Tel:   (604) 739-3941
>>302 - 1298 10th Avenue West                     FAX:   (604) 739-3943
>>Vancouver, BC, V6H 1J4                          Mobile:(778) 895-1379
>>





More information about the drupal-support mailing list