[GENERAL] createuser: How to specify a database to connect to

Поиск
Список
Период
Сортировка
От Schmid Andreas
Тема [GENERAL] createuser: How to specify a database to connect to
Дата
Msg-id 11fbd835426e49ff9909911c7d376272@bd.so.ch
обсуждение исходный текст
Ответы Re: [GENERAL] createuser: How to specify a database to connect to  (Guillaume Lelarge <guillaume@lelarge.info>)
Re: [GENERAL] createuser: How to specify a database to connect to  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi

I'm trying to add a new DB user with the following command from my client machine:
createuser -h my.host.name -U mysuperusername --pwprompt newusername

I'm getting the following message:
createuser: could not connect to database postgres: FATAL:  no pg_hba.conf entry for host "10.0.0.1", user
"mysuperusername",database "postgres", SSL on 

Now, it's true that our pg_hba.conf doesn't allow access to the postgres database. We did this intentionally, as
usuallyno one needs to connect to this database. 

So I tried to do
export PGDATABASE=sogis
before the createuser command. But no success. Does anyone know of another way to achieve what I'm trying?

I whish to do it with createuser rather than with the SQL command CREATE USER because this way I can avoid the password
forthe new user to show up anywhere in the history. 

I'm on 9.2 on Ubuntu 14.04.

Thank you very much,
Andi


В списке pgsql-general по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: [GENERAL] How to define the limit length for numeric type?
Следующее
От: Guillaume Lelarge
Дата:
Сообщение: Re: [GENERAL] createuser: How to specify a database to connect to