From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ferry, Craig <crferry@wescodist.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Scripting postgres commands
Date: Wed, 19 Dec 2007 12:04:10 -0500
Message-ID: <24284.1198083850@sss.pgh.pa.us> (raw)
In-Reply-To: <6B6D3063DF0A7A4DB8A989D40C61BEB33817FB@EMAIL02.wescodist.com>
References: <6B6D3063DF0A7A4DB8A989D40C61BEB33817FB@EMAIL02.wescodist.com>
"Ferry, Craig" <crferry@wescodist.com> writes:
> I can run the following command from a command prompt with no problem on my database.
> /usr/bin/vacuumdb --verbose --analyze --all -U postgres
> But if I try to execute it via a bash shell script, I receive the following error. The role does exist in the database.
> does not existnot connect to database postgres: FATAL: role "postgres
> I am new to postgresql so any help would be greatly appreciated.
Given the curious formatting of the complaint, it looks like what the
database is actually seeing as the requested username is "postgres\r"
(ie, there's a carriage return or perhaps a newline character tacked
onto the name). Better check your quoting in the shell script.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, crferry@wescodist.com
Subject: Re: Scripting postgres commands
In-Reply-To: <24284.1198083850@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox