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