= 4.3.0, PHP 5, PHP 7, PHP 8)pg_get_pid — Ping 數(shù)據(jù)庫連接說明pg_get_pid(resource $connection): intpg_get_pid() 取得后端(數(shù)據(jù)庫服務(wù)器進(jìn)程)的 PID。PID 用來檢查">

pg_get_pid

(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)

pg_get_pidPing 數(shù)據(jù)庫連接

說明

pg_get_pid(resource $connection): int

pg_get_pid() 取得后端(數(shù)據(jù)庫服務(wù)器進(jìn)程)的 PID。PID 用來檢查其它進(jìn)程是否發(fā)送了 NOTIFY 消息。

示例 #1 PostgreSQL 后端 PID

<?php 
$conn 
pg_pconnect("dbname=publisher");
if (!
$conn) {
    echo 
"An error occured.\n";
    exit;
}

// Backend process PID. Use PID with pg_get_notify()
$pid pg_get_pid($conn);
?>

參見 pg_get_notify()。