note 126935 deleted from function.pg-pconnect by danbrown
| From: | danbrown@php.net | Date: | Sun, 03 Apr 2022 21:06:34 +0000 |
| Subject: | note 126935 deleted from function.pg-pconnect by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218008@lists.php.net to get a copy of this message | ||
Note Submitter: mirabilos
----
The advice from https://www.php.net/manual/en/function.pg-pconnect.php#36332
is very dated or outright wrong.
Even in PHP 5.0.0 the pgsql module has automatically set up a shutdown hook to reset *and* ROLLBACK
any persistent connections (that is, those created from pconnect) on shutdown.
However, you still might want to set pgsql.auto_reset_persistent because this checks the incoming
connections as well (by doing a âSELECT 1;â and checking for errors, auto-resetting if
so). Small overhead but probably very much worth it. Unfortunately, it cannot be set by ini_set()
for some reason (the uses in the code would allow that), so change the server config for it⦠or
call pg_ping() afterwards.