With a fresh install (no tables in the database) this warning appears with the progress bar:

Warning: PDO::__construct(): SQLSTATE[IM001]: Driver does not support this function: driver does not support setting attributes in DatabaseConnection->__construct() (line 289 of /home/ ... /public_html/postgres/includes/database/database.inc).

And the above error and this error appear after Set up database and before Install profile:

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: http://www. ... .com/postgres/install.php?profile=standard&locale=en&id=1&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ")" LINE 1: SELECT * FROM menu_router WHERE path IN () ORDER BY fit DESC... ^: SELECT * FROM {menu_router} WHERE path IN () ORDER BY fit DESC LIMIT 1 OFFSET 0; Array ( ) in menu_get_item() (line 426 of /home/..../public_html/postgres/includes/menu.inc).

PHP Version 5.2.14, PostGres 8.4.4, Apache/2.2.16, CENTOS 5.5 x86_64 (pdo_pgsql for 8.4.4, module version 1.0.2, revision $Id: pdo_pgsql.c,v 1.7.2.11 2006/03/14 10:49:18 edink Exp $ ).

On my home setup, the install works perfectly:

PHP Version 5.3.1, PostGres 8.4.4, Apache/2.2.14, OS X 10.4.11 (pdo_pgsql for 8.3.4, module version 1.0.2, $Id: pdo_pgsql.c 277898 2009-03-28 01:58:49Z mbeccati $)

Looks to me like I need to look at my version of pdo_pgsql, in addition to my version of PHP?

Comments

damien tournoud’s picture

PHP Version 5.2.14, PostGres 8.4.4, Apache/2.2.16, CENTOS 5.5 x86_64 (pdo_pgsql for 8.4.4, module version 1.0.2, revision $Id: pdo_pgsql.c,v 1.7.2.11 2006/03/14 10:49:18 edink Exp $ )

I haven't looked at the sources for a while, but 2006 seems unlikely for a PHP 5.2.14 pdo_pgsql.c. Where does your PDO come from? Could that be a case of a PECL-installed PDO? If so, why hasn't our requirement test picked it up?

shunting’s picture

I had my ISP upgrade PHP to PHP Version 5.3.2 (different from my original comments), and then I had them reinstall pdo_psql. Here is what phpinfo says:

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

When I install, I get this warning:

Warning: PDO::__construct(): SQLSTATE[IM001]: Driver does not support this function: driver does not support setting attributes in DatabaseConnection->__construct() (line 289 of /home/[example]/public_html/postgres/includes/database/database.inc).

The installation completes in the progress bar, and then fails with this error:

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: http://www.[example].com/postgres/install.php?profile=standard&locale=en&id=1&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ")" LINE 1: SELECT * FROM menu_router WHERE path IN () ORDER BY fit DESC... ^: SELECT * FROM {menu_router} WHERE path IN () ORDER BY fit DESC LIMIT 1 OFFSET 0; Array ( ) in menu_get_item() (line 426 of /home/[example]/public_html/postgres/includes/menu.inc).

What more information would help?

mark trapp’s picture

Status: Closed (works as designed) » Active

This is still an issue in 7.x-dev, and does arise from using the PDO_PGSQL PECL package. Notably, PECL is the only way that I know of to get PostgreSQL support without having to recompile PHP in Mac OS X, and is documented around the internet as the way to add PostgreSQL support to Mac OS X's PHP build.

While it might cause an installation failure, it only causes the warning elsewhere (like if you're accessing a PostgreSQL database as a secondary database via db_set_active()):

Warning: PDO::__construct(): SQLSTATE[IM001]: Driver does not support this function: driver does not support setting attributes in DatabaseConnection->__construct() (line 299 of /path/to/drupal/includes/database/database.inc).

Outside of the installation process, it doesn't seem to affect the ability to use the database system: results are returned correctly and data is added back into the database correctly.

This doesn't seem to be PHP or PostgreSQL version specific: I've hit this on PHP 5.2.x and 5.3.x as well as PostgreSQL 8.4.x and 9.0.x.

It may be the case that not compiling PHP with PDO PostgreSQL support is just plain not supported (which would mean users using the default Mac OS X/Mac OS X server stack are out of luck), but figured I'd update this with the reduction.

damien tournoud’s picture

Title: Installation fails before Install Profile step with PostGres 8.4.4 and PHP 5.2.14, possibly due to pdo_pgsql version » PDO_PGSQL PECL package does not support PDO::setAttribute
Version: 7.0-beta3 » 7.x-dev
Component: install system » database system
Status: Active » Closed (works as designed)

PDO PECL is not supported by either PHP nor Drupal.

shunting’s picture

Status: Active » Closed (works as designed)

Tried again with the postgres 8.4.4, php 5.3.2 on a CentOS/cPanel installation, with Drupal 7.8.

Error message

* Warning: PDO::__construct() [pdo.--construct]: SQLSTATE[IM001]: Driver does not support this function: driver does not support setting attributes in DatabaseConnection->__construct() (line 304 of /home/wwwnonvi/public_html/includes/database/database.inc).
* PDOException: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ")" LINE 1: SELECT * FROM menu_router WHERE path IN () ORDER BY fit DESC... ^: SELECT * FROM {menu_router} WHERE path IN () ORDER BY fit DESC LIMIT 1 OFFSET 0; Array ( ) in menu_get_item() (line 450 of /home/wwwnonvi/public_html/includes/menu.inc).

I can't get beyond this error, so, showstopper. As far as my ISP's staff knows, the PECL version of pdo_pgsql is NOT used.

jaywhy13’s picture

I'm having the same issue.. did you manage to get this resolved?

liam morland’s picture

Issue tags: +PostgreSQL
joshf’s picture

For anyone using Jose Gonzalez's homebrew php recipe, you can simply

brew rm php54
brew install php54 --with-pgsql

Replace 54 with 53 or 55 depending on your version.