Re: Streaming Replication Configuration - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: Streaming Replication Configuration
Date
Msg-id 4EEA25DC.9070900@iol.ie
Whole thread Raw
In response to Streaming Replication Configuration  (Carlos Mennens <carlos.mennens@gmail.com>)
List pgsql-general
On 15/12/2011 16:41, Carlos Mennens wrote:
> carlos@db1:~$ psql -c "SELECT pg_start_backup('label', true)"
> psql: FATAL:  database "carlos" does not exist
>
> Now I'm showing they want me to use the -c switch to connect but no
> database is defined so is it implied that I need to add 'postgres'
> maintenance database in there or something else?
>

Yes, depending on your setup you may need both -U <user name> and the
database name also - if neither is specified, psql tries to connect to a
database named after the current OS user, and tries to connect as a user
with the same name as the current OS user also.

So if you're logged in as "carlos", then the above command is the same as:

  psql -U carlos -c "...." carlos

HTH,

Ray.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

pgsql-general by date:

Previous
From: David Johnston
Date:
Subject: Re: Double Denormalizing in Postgres
Next
From: Gabriele Bartolini
Date:
Subject: Re: Streaming Replication Configuration