PHP 8.4.6 Released!

pg_get_pid

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

pg_get_pidバックエンドのプロセス ID を得る

説明

pg_get_pid(PgSql\Connection $connection): int

pg_get_pid() は、バックエンド(データベースサーバー のプロセス)のプロセス ID を取得します。プロセス ID は、 NOTIFY メッセージが他のプロセスから送信されている かどうかを調べるために有用です。

パラメータ

connection

PgSql\Connection クラスのインスタンス。

戻り値

バックエンドのデータベースのプロセス 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);
?>

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant