pgsql: libpq: Remove PQservice()

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: libpq: Remove PQservice()
Date: 2025-07-09 03:46:45
Message-ID: E1uZLlc-005MHx-31@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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(at)leadboat(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2025-07-09 04:24:25 pgsql: doc PG 18 relnotes: Remove item about PQservice()
Previous Message Michael Paquier 2025-07-08 23:32:20 Re: pgsql: Fix up misuse of "volatile" in contrib/xml2.