pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: libpq: Remove PQservice()
Date: Wed, 09 Jul 2025 03:46:45 +0000
Message-ID: <E1uZLlc-005MHx-31@gemulon.postgresql.org> (raw)

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(-)



view thread (2+ messages)

Message-ID: <E1uZLlc-005MHx-31@gemulon.postgresql.org>
Permalink:  ../E1uZLlc-005MHx-31@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uZLlc-005MHx-31@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: libpq: Remove PQservice()
  In-Reply-To: <E1uZLlc-005MHx-31@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox