php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36701 pgsql driver
Submitted: 2006-03-12 00:41 UTC Modified: 2006-03-14 16:29 UTC
From: marcin at artigo dot pl Assigned:
Status: Closed Package: PDO related
PHP Version: 5CVS-2006-03-12 (snap) OS: win xp
Private report: No CVE-ID: None
 [2006-03-12 00:41 UTC] marcin at artigo dot pl
Description:
------------
I cannot get pgsql driver to work
phpinfo says:

PDO drivers 	no value

PDO Driver for PostgreSQL	enabled


Looks like for some reason pgsql driver isnt seen, while others seem to work fine:

PDO drivers 	oci, firebird


As a result I cannot create a PDO object with pgsql DSN - an exception is thrown - "could not find driver".

Tested with latest snap and pgsql 8.1

Reproduce code:
---------------
extension=php_pdo.dll
extension=php_pdo_pgsql.dll

Expected result:
----------------
Something like

PDO drivers    pgsql 

would be appreciated.

Actual result:
--------------
could not find driver

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-12 09:17 UTC] tony2001@php.net
And you do have Postgres client libraries installed, do you?
 [2006-03-12 11:03 UTC] marcin at artigo dot pl
pg_connect works fine and phpinfo says

PostgreSQL(libpq) Version 8.0.1

so i guess it is, isnt it?
 [2006-03-12 11:18 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2006-03-12 11:31 UTC] marcin at artigo dot pl
I assume you mean the DSN, well I tried many variations, but with the same result, let me give you this one:

$this->oConn = new PDO(sprintf('pgsql:host=%s;dbname=%s;user=%s;password=%s', $aConfig['host'], $aConfig['name'], $aConfig['user'], $aConfig['pass']));
 [2006-03-13 12:42 UTC] edink@php.net
Seems like php_pdo_pgsql.dll was not included in the latest snaps due to a build problem. Please grab the next snap, verify that the file is there and try again.
 [2006-03-13 18:26 UTC] marcin at artigo dot pl
It was included, the file is in place.
But I tried today's snap, no difference, the same with old 5.1.2RC. It looks like PDO does not detect it for some reason:

extension=php_pdo.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_mysql.dll
extension=php_pdo_sqlite.dll
extension=php_pdo_oci.dll


PDO
PDO support	enabled
PDO drivers 	mysql, sqlite, oci
Where is pgsql? Why is it not here too?


But somehow its below with others:

pdo_mysql
PDO Driver for MySQL, client library version	4.1.7

PDO_OCI
PDO Driver for OCI 8 and later	enabled

pdo_pgsql
PDO Driver for PostgreSQL	enabled

pdo_sqlite
PDO Driver for SQLite 3.x	enabled
PECL Module version 	1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6 2006/01/01 12:50:12 sniper Exp $
SQLite Library 	3.2.8undefined
 [2006-03-14 11:53 UTC] edink@php.net
I have just tested latest CVS snapshot of 5.1.3-dev and everthing works fine here. I have also added some more verbose output to phpinfo() so you can verify that the driver is at the latest version.

Please try completely clean system with only pdo and pdo_pgsql extensions enabled. You should from the next snapshot see something like this in phpinfo:

PDO Driver for PostgreSQL	enabled
PostgreSQL(libpq) Version 	8.1.3
Module version 	1.0.2
Revision 	$Id: pdo_pgsql.c,v 1.7.2.11 2006/03/14 10:49:18 edink Exp $

 [2006-03-14 16:29 UTC] marcin at artigo dot pl
I dont know what u've changed but it works perfectly now.

PDO drivers 	pgsql, mysql, sqlite, oci

Just installed latest snap, strange:)
Thank you!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC