php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42450 pdo_pgsql: persistent connections fails on PostgreSQL server restart
Submitted: 2007-08-27 20:56 UTC Modified: 2009-05-03 01:00 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: davojan at mail dot ru Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.2.4 OS: *
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-08-27 20:56 UTC] davojan at mail dot ru
Description:
------------
When using PDO pgSQL with persistent connections and restarting the PostgreSQL server, which the PDO has been connected with, PDO raises exception (see below). So I need to restart PHP to reset persistent connections.

The bug was reproduced in two different environments:
Apache2 (multi-threaded) + mod_php + WinXP
lighttpd + PHP(FastCGI) + FreeBSD

MySQL persistent connections in the same situation works fine...

Reproduce code:
---------------
<?php
$db = new PDO( 'pgsql:host=localhost port=5432 dbname=test user=user password=secret', 'user', 'secret', array( PDO::ATTR_PERSISTENT => true ) );
echo 'ok';
?>

# /usr/local/etc/rc.d/postgresql restart

and again the above php script

Expected result:
----------------
ok

Actual result:
--------------
Unknown exception: SQLSTATE[57P01]: Admin shutdown: 7 FATAL: <closing connection on admin command> (this is my translation from russian message) server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-28 08:14 UTC] davojan at mail dot ru
I've tried the latest version under WinXP. The first try to open persistent connection after PostgreSQL server restart fails in the same way as above. The following connections is OK.

Could you please repair the first connection too? :)
 [2007-08-28 09:15 UTC] davojan at mail dot ru
New information: not only the first try. Rather first try to use of any of the old (being created before restart) persistent connections fails.

P.S.: Sorry for my English. I hope you understand me :)
 [2007-08-31 05:15 UTC] davojan at mail dot ru
The same problem in php-5.2.4 release. Checked under WinXP.
 [2009-04-25 14:48 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-05-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 12:01:27 2024 UTC