Skip site navigation (1) Skip section navigation (2)

Re: Scripting postgres commands

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Ferry, Craig" <crferry(at)wescodist(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Scripting postgres commands
Date: 2007-12-19 17:04:10
Message-ID: 24284.1198083850@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-admin
"Ferry, Craig" <crferry(at)wescodist(dot)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

In response to

pgsql-admin by date

Next:From: olivier.boissard@cerene.frDate: 2007-12-19 22:23:56
Subject: Re: How to uses self query plan
Previous:From: Ferry, CraigDate: 2007-12-19 15:43:21
Subject: Scripting postgres commands

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group