(PHP 4, PHP 5, PHP 7, PHP 8)
pg_close — 关闭 PostgreSQL 连接
   pg_close() 关闭与指定 connection
   实例关联的 PostgreSQL 数据库的非持久连接。
  
注意:
通常不需要使用 pg_close(),因为打开的非持久连接会在脚本结束时自动关闭。
connectionAn PgSql\Connection instance.
When connection is null, the default connection is used.
The default connection is the last connection made by pg_connect()
or pg_pconnect().
As of PHP 8.1.0, using the default connection is deprecated.
   总是返回 true 。
  
| 版本 | 说明 | 
|---|---|
| 8.2.0 | 现在返回类型为 true;之前是 bool。 | 
| 8.1.0 | 现在 connection参数接受 PgSql\Connection
  实例,之前接受 资源(resource)。 | 
| 8.0.0 | connection现在可以为 null。 | 
示例 #1 pg_close() 示例
<?php
$dbconn = pg_connect("host=localhost port=5432 dbname=mary")
   or die("Could not connect");
echo "Connected successfully";
pg_close($dbconn);
?>
以上例程会输出:
Connected successfully
