From: | Gabriele Bartolini <Gabriele(dot)Bartolini(at)2ndQuadrant(dot)it> |
---|---|
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:53:06 |
Message-ID: | c94f37a1bbe7c96a42c9f6bed6dc346d@2ndquadrant.it |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi Carlos,
On Thu, 15 Dec 2011 11:41:07 -0500, Carlos Mennens
<carlos(dot)mennens(at)gmail(dot)com> wrote:
> carlos(at)db1:~$ psql -c "SELECT pg_start_backup('label', true)"
> psql: FATAL: database "carlos" does not exist
By default (unless changed at compile time or using environment
variables), a client connection is instantiated using the system user.
In your case 'carlos'. Another default setting is to use the same
database as the username (in your case 'carlos' again).
This is what is happening in your case.
For more info, I suggest that you look at the 'Usage' section in this
page: http://www.postgresql.org/docs/9.1/static/app-psql.html
Anyway, in order to execute pg_start_backup/pg_stop_backup in 9.1 you
need replication role (or superuser).
> 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?
If the user carlos in your database has replication privileges, you can
try and execute the commands by connecting to the postgres database (if
your pg_hba.conf file allows you to do that, but that's another issue).
Ciao,
Gabriele
--
Gabriele Bartolini - 2ndQuadrant Italia
PostgreSQL Training, Services and Support
Gabriele(dot)Bartolini(at)2ndQuadrant(dot)it - www.2ndQuadrant.it
From | Date | Subject | |
---|---|---|---|
Next Message | Gabriele Bartolini | 2011-12-15 16:54:35 | Re: Streaming Replication Configuration |
Previous Message | Raymond O'Donnell | 2011-12-15 16:52:44 | Re: Streaming Replication Configuration |