array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'pdo-pgsql.getpid.php', 1 => 'Pdo\\Pgsql::getPid', 2 => 'Get the PID of the backend process handling this connection', ), 'up' => array ( 0 => 'class.pdo-pgsql.php', 1 => 'Pdo\\Pgsql', ), 'prev' => array ( 0 => 'pdo-pgsql.getnotify.php', 1 => 'Pdo\\Pgsql::getNotify', ), 'next' => array ( 0 => 'pdo-pgsql.lobcreate.php', 1 => 'Pdo\\Pgsql::lobCreate', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/pdo_pgsql/pdo/pgsql/getpid.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

Pdo\Pgsql::getPid

(PHP 8 >= 8.4.0)

Pdo\Pgsql::getPidGet the PID of the backend process handling this connection

Description

public function 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

This function has no parameters.

Return Values

Returns the PID as an int.

Examples

Example #1 Pdo\Pgsql::getPid() example

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

The above example will output something similar to:

12345

See Also