Re: Re: How to use createdb command with newly created user?
От | Ron Johnson |
---|---|
Тема | Re: Re: How to use createdb command with newly created user? |
Дата | |
Msg-id | CANzqJaCkH5BqXKi8zB8QCSbxBrv8W=GNf-HfADg4thm2V9zqTw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re:Re: How to use createdb command with newly created user? (毛毛 <krave@163.com>) |
Ответы |
Re:Re: Re: How to use createdb command with newly created user?
|
Список | pgsql-general |
Better to run now, and save yourself hassle in the future:
ALTER ROLE "Baba" RENAME TO baba;
Also, use a .pgpass file: https://www.postgresql.org/docs/14/libpq-pgpass.html
On Sun, Jun 23, 2024 at 3:22 PM 毛毛 <krave@163.com> wrote:
Thank you! You are right!
After putting quotes around the username, it works!
在 2024-06-24 02:47:44,"David G. Johnston" <david.g.johnston@gmail.com> 写道:
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 по дате отправления: