1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-18 17:42:25 +03:00

libpq: Remove PQservice()

This routine has been introduced as a shortcut to be able to retrieve a
service name from an active connection, for psql.  Per discussion, and
as it is only used by psql, let's remove it to not clutter the libpq API
more than necessary.

The logic in psql is replaced by lookups of PQconninfoOption for the
active connection, instead, updated each time the variables are synced
by psql, the prompt shortcut relying on the variable synced.

Reported-by: Noah Misch <noah@leadboat.com>
Discussion: https://postgr.es/m/20250706161319.c1.nmisch@google.com
Backpatch-through: 18
This commit is contained in:
Michael Paquier
2025-07-09 12:46:13 +09:00
parent 93001888d8
commit fef6da9e9c
8 changed files with 53 additions and 38 deletions

View File

@ -2740,26 +2740,6 @@ 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>