array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.pg-get-pid.php', 1 => 'pg_get_pid', ), 'up' => array ( 0 => 'ref.pgsql.php', 1 => 'PostgreSQL 関数', ), 'prev' => array ( 0 => 'function.pg-get-notify.php', 1 => 'pg_get_notify', ), 'next' => array ( 0 => 'function.pg-get-result.php', 1 => 'pg_get_result', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/pgsql/functions/pg-get-pid.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)
pg_get_pid — バックエンドのプロセス ID を得る
pg_get_pid() は、バックエンド(データベースサーバ
のプロセス)のプロセス ID を取得します。プロセス ID は、
NOTIFY
メッセージが他のプロセスから送信されている
かどうかを調べるために有用です。
バックエンドのデータベースのプロセス ID 。
バージョン | 説明 |
---|---|
8.1.0 |
connection は、PgSql\Connection クラスのインスタンスを期待するようになりました。
これより前のバージョンでは、リソース を期待していました。
|
例1 PostgreSQL バックエンドの PID
<?php
$conn = pg_pconnect("dbname=publisher");
if (!$conn) {
echo "An error occurred.\n";
exit;
}
// バックエンドのプロセスIDを取得。このプロセスIDをpg_get_notify()で使用
$pid = pg_get_pid($conn);
?>