From fef6da9e9c8790fa915942af2ada190c33fcf98c Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Wed, 9 Jul 2025 12:46:13 +0900 Subject: 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 Discussion: https://postgr.es/m/20250706161319.c1.nmisch@google.com Backpatch-through: 18 --- src/interfaces/libpq/fe-connect.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/interfaces/libpq/fe-connect.c') diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 51a9c416584..09eb79812ac 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -7461,14 +7461,6 @@ PQdb(const PGconn *conn) return conn->dbName; } -char * -PQservice(const PGconn *conn) -{ - if (!conn) - return NULL; - return conn->pgservice; -} - char * PQuser(const PGconn *conn) { -- cgit v1.2.3