1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

libpq: Add service name to PGconn and PQservice()

This commit adds one field to PGconn for the database service name (if
any), with PQservice() as routine to retrieve it.  Like the other
routines of this area, NULL is returned as result if the connection is
NULL.

A follow-up patch will make use of this feature to be able to display
the service name in the psql prompt.

Author: Michael Banck
Reviewed-by: Greg Sabino Mullane
Discusion: https://postgr.es/m/6723c612.050a0220.1567f4.b94a@mx.google.com
This commit is contained in:
Michael Paquier
2024-12-18 14:53:42 +09:00
parent 3f06324705
commit 4b99fed754
5 changed files with 33 additions and 1 deletions

View File

@ -2530,6 +2530,26 @@ char *PQport(const PGconn *conn);
</listitem>
</varlistentry>
<varlistentry id="libpq-PQservice">
<term><function>PQservice</function><indexterm><primary>PQservice</primary></indexterm></term>
<listitem>
<para>
Returns the service of the active connection.
<synopsis>
char *PQservice(const PGconn *conn);
</synopsis>
</para>
<para>
<xref linkend="libpq-PQservice"/> returns <symbol>NULL</symbol> if the
<parameter>conn</parameter> argument is <symbol>NULL</symbol>.
Otherwise, if there was no service provided, it returns an empty string.
</para>
</listitem>
</varlistentry>
<varlistentry id="libpq-PQtty">
<term><function>PQtty</function><indexterm><primary>PQtty</primary></indexterm></term>