Re: How to use createdb command with newly created user? - Mailing list pgsql-general

From David G. Johnston
Subject Re: How to use createdb command with newly created user?
Date
Msg-id CAKFQuwb-Kp4dnE+EM2WCeJ8tuai-Lx_Ja2Gb8mEOkNRe9h8Vww@mail.gmail.com
Whole thread Raw
In response to How to use createdb command with newly created user?  (毛毛 <krave@163.com>)
Responses Re: How to use createdb command with newly created user?
Re:Re: How to use createdb command with newly created user?
List pgsql-general


On Sun, Jun 23, 2024, 11:43 毛毛 <krave@163.com> wrote:
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?


You named the user "baba" all lower-case but your createdb command uses Baba and in the OS the case-folding of identifiers does not happen.  Baba != baba  is your issue.

David J.

pgsql-general by date:

Previous
From: 毛毛
Date:
Subject: How to use createdb command with newly created user?
Next
From: Tom Lane
Date:
Subject: Re: How to use createdb command with newly created user?