문제

I am finding myself with the issue of needing to execute the postgres createuser.exe from a batch script and cannot get it to stop prompting me with the following:

Enter name of role to add:

my batch script looks like this:

echo calling createuser! createuser username %super_user% -s -U Super_Postgres s -q

Where %super_user% is a command line argument. Any help would be greatly appreciated, this is the documentation that I am referring too: postgres

도움이 되었습니까?

해결책

"username" should go at the end, after the options. You have it as the first parameter.

다른 팁

from the documentation http://www.postgresql.org/docs/8.4/static/app-createuser.html

The following is from the documentation listed above

To create the same user joe using the server on host eden, port 5000, avoiding the prompts and taking a look at the underlying command:

$ createuser -h eden -p 5000 -S -D -R -e joe
CREATE ROLE joe NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;

To create the user joe as a superuser, and assign a password immediately:

$ createuser -P -s -e joe Enter password for new role: xyzzy Enter it again: xyzzy
CREATE ROLE joe PASSWORD 'md5b5f5ba1a423792b526f799ae4eb3d59e' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top