php8.5
Home/ Manual/ pgsql / functions/ pg_service

pg_service

PHP function Edit on GitHub ✎

(PHP 8 >= 8.5.0)

Gets the service name of the connection

Description

pg_service(PgSql\Connection|null $connection = null): string

Returns the name of the connection service used to establish the connection, as defined in the connection service file.

This function is only available if PHP has been built against libpq 18 or later.

Parameters

connection

Connection-with-nullable-default

Return Values

A string containing the service name of the connection, or an empty string if no service was used.

See Also

Source: reference/pgsql/functions/pg-service.xml · from the official PHP manual (php/doc-en)