使用持久 postgres 连接时的 pg_close ?

发布于 2024-12-17 11:05:03 字数 125 浏览 4 评论 0原文

当使用 pg_pconnect 连接从 php 连接到 postgres 时, pg_close : 是否

  1. 真的关闭连接(破坏持久效果)?
  2. 将连接移交给 pconnect 池?

when using pg_pconnect connections to connect from php to postgres, does pg_close :

  1. really close the connection (ruining the persistent effect) ?
  2. hand over the connection to the pconnect pool ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

难以启齿的温柔 2024-12-24 11:05:03

它与 PHP.ini 配置有关,如果标签 pgsql.allow_persistent< /a> 设置为 true 那么 pg_close 将不会关闭连接,因为它是持久的,否则如果将其设置为 false pg_close 将关闭连接。

该文档在 pg-pconnect 上说明:

pg_close() will not close persistent links generated by pg_pconnect()

It has to do with the PHP.ini configuration, if the label pgsql.allow_persistent is set to true then pg_close will not close the connection because it is persistent, otherwise if you set it to false pg_close will close the connection.

The documentation states on pg-pconnect:

pg_close() will not close persistent links generated by pg_pconnect()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文