Re: Connect to specific cluster on command line - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Connect to specific cluster on command line
Date
Msg-id 8707ad0b877ae6245576452347c2efce327a4759.camel@cybertec.at
Whole thread Raw
In response to Re: Connect to specific cluster on command line  (Carsten Klein <c.klein@datagis.com>)
List pgsql-general
On Wed, 2022-05-25 at 16:48 +0200, Carsten Klein wrote:
> So, forget about the packager. With core PostgreSQL tools it is possible 
> to have more than one cluster. How do you specify what cluster to 
> connect to with psql or pg_dump? Do I have to specify the cluster's 
> corresponding Unix domain socket directory via the --host option?

With -h you specify the directory containing the socket, and
with -p (port) the name.

So you could

  psql -h /var/run/postgresql -p 5555

to use the socket /var/run/postgresql/.s.PGSQL.5555

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com



pgsql-general by date:

Previous
From: Andreas Fröde
Date:
Subject: Re: Connect to specific cluster on command line
Next
From: Tom Lane
Date:
Subject: Re: Connect to specific cluster on command line