Re: Streaming Replication Configuration

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Carlos Mennens <carlos(dot)mennens(at)gmail(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Streaming Replication Configuration
Date: 2011-12-15 16:52:44
Message-ID: 4EEA25DC.9070900@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 15/12/2011 16:41, Carlos Mennens wrote:
> carlos(at)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(at)iol(dot)ie

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gabriele Bartolini 2011-12-15 16:53:06 Re: Streaming Replication Configuration
Previous Message David Johnston 2011-12-15 16:42:27 Re: Double Denormalizing in Postgres