php8.5
Home/ Manual/ pdo / pgsql/ Pdo\Pgsql::getPid

Pdo\Pgsql::getPid

PHP function Edit on GitHub ✎

(PHP 8 >= 8.4.0)

Get the PID of the backend process handling this connection

Description

Pdo\Pgsql::getPid(): int

Returns the PID of the backend process handling this connection. Note that the PID belongs to a process executing on the database server host, not the local host.

Parameters Parameters

Return Values

Returns the PID as an int.

Examples

Pdo\Pgsql::getPid example

php
<?php
$db = new Pdo\Pgsql('pgsql:dbname=test host=localhost', $user, $pass);
echo $db->getPid();
?>

The above example will output something similar to:

output
12345

See Also

Source: reference/pdo_pgsql/pdo/pgsql/getpid.xml · from the official PHP manual (php/doc-en)