libpq: Remove PQservice()
authorMichael Paquier <michael@paquier.xyz>
Wed, 9 Jul 2025 03:46:13 +0000 (12:46 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 9 Jul 2025 03:46:13 +0000 (12:46 +0900)
commitfef6da9e9c8790fa915942af2ada190c33fcf98c
tree455bbc3844dc54548ecb29af282930b66acb31e3
parent93001888d85c21a5b9ab1fe8dabfecb673fc007c
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
doc/src/sgml/libpq.sgml
src/bin/psql/command.c
src/bin/psql/common.c
src/bin/psql/common.h
src/bin/psql/prompt.c
src/interfaces/libpq/exports.txt
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/libpq-fe.h