Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display host, user and port in PostgreSQL

I am aiming to use R to connect to a database within PostgreSQL, for which I need to know the database host, port and user.

Do you know how I can find these details within PostgreSQL?

Thanks.

like image 531
G. Young Avatar asked Oct 31 '25 03:10

G. Young


1 Answers

If you are using psql and already logged into the database, you can use the below command to display connection info

\conninfo

like image 181
Shiva Avatar answered Nov 01 '25 17:11

Shiva



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!