note 126935 added to function.pg-pconnect
| From: | mirabilos at main dot php dot net | Date: | Thu, 17 Mar 2022 02:57:47 +0000 |
| Subject: | note 126935 added to function.pg-pconnect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217734@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.135 (proxied: 78.34.246.185)
----
Manual Page -- https://php.net/manual/en/function.pg-pconnect.php
Edit -- https://main.php.net/note/edit/126935
Del: integrated -- https://main.php.net/note/delete/126935/integrated
Del: useless -- https://main.php.net/note/delete/126935/useless
Del: bad code -- https://main.php.net/note/delete/126935/bad+code
Del: spam -- https://main.php.net/note/delete/126935/spam
Del: non-english -- https://main.php.net/note/delete/126935/non-english
Del: in docs -- https://main.php.net/note/delete/126935/in+docs
Del: other reasons-- https://main.php.net/note/delete/126935
Reject -- https://main.php.net/note/reject/126935
Search -- https://main.php.net/manage/user-notes.php