How to use createdb command with newly created user?

Поиск
Список
Период
Сортировка
От 毛毛
Тема How to use createdb command with newly created user?
Дата
Msg-id 540f69f.2ec4.1904668b6c4.Coremail.krave@163.com
обсуждение исходный текст
Ответы Re: How to use createdb command with newly created user?
Список pgsql-general
Hi,

I tried to create a user with CREATEDB permission.
Then I wanted to run command line tool `createdb` with this newly created user.

So I ran SQL first to create a user:

```
CREATE USER Baba WITH PASSWORD 'xxx' CREATEDB;
```

Then I run the following command on PowerShell on Windows 10:

```
 createdb -U Baba -W test_db
```

But no mater how I tried, the password always failed.

If I specify the user as postgres, the defaut user, everything works fine.

```
createdb -U postgres -W test_db_1
```

Do you have any suggestions?

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Stack Smashing Detected When Executing initdb
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: How to use createdb command with newly created user?