Re: Who am I? Where am I connected? - Mailing list pgsql-general

From Ganesh Korde
Subject Re: Who am I? Where am I connected?
Date
Msg-id CAPNyb0VMHxnpaWj_+FF_tigmMZH5fi+aqRtCubsKNDMyz3iOug@mail.gmail.com
Whole thread Raw
In response to Who am I? Where am I connected?  (Dominique Devienne <ddevienne@gmail.com>)
List pgsql-general
 \conninfo will show you desired details

Regards,
Ganesh Korde.

On Wed, 18 May 2022, 3:38 pm Dominique Devienne, <ddevienne@gmail.com> wrote:
LibPQ has various defaults for the host, user, and DB name.
There's also the password file, the service file and service name.
In the example below, I can connect with a "naked" psql invocation.

Once connected, can I find out all aspects of the connection string?
Or where they came from, like a pgpass.conf or service file?

How to get the host, port, db name once connected?
SHOW and pg_settings does not appear to be it, at first glance.

Thanks, --DD

c:\Users\ddevienne>psql
psql (12.1, server 14.2)
WARNING: psql major version 12, server major version 14.
         Some psql features might not work.
WARNING: Console code page (437) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.
Type "help" for help.

ddevienne=>


pgsql-general by date:

Previous
From: Erik Wienhold
Date:
Subject: Re: Who am I? Where am I connected?
Next
From: Christoph Moench-Tegeder
Date:
Subject: Re: Who am I? Where am I connected?