pgsql: libpq: Remove PQservice() - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: libpq: Remove PQservice()
Date
Msg-id E1uZLlc-005MHx-31@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fc3edb52fbb9b773442ce0a89116f893aaa766af

Modified Files
--------------
doc/src/sgml/libpq.sgml           | 20 --------------------
src/bin/psql/command.c            |  7 ++++++-
src/bin/psql/common.c             | 35 +++++++++++++++++++++++++++++++++++
src/bin/psql/common.h             |  1 +
src/bin/psql/prompt.c             |  8 ++++++--
src/interfaces/libpq/exports.txt  | 11 +++++------
src/interfaces/libpq/fe-connect.c |  8 --------
src/interfaces/libpq/libpq-fe.h   |  1 -
8 files changed, 53 insertions(+), 38 deletions(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pgsql: Fix up misuse of "volatile" in contrib/xml2.
Next
From: Michael Paquier
Date:
Subject: pgsql: doc PG 18 relnotes: Remove item about PQservice()