简体   繁体   English

postgresql initdb.exe 选项标志在命令行中不起作用

[英]postgresql initdb.exe option flags not working in command line

in cmd.exe command line i go to the directory where there's initdb.exe and then i run :cmd.exe命令行中,我转到有initdb.exe的目录,然后运行:

initdb.exe -D "C:/data/" -U postgres -E UTF8

then the database is created with this message (in french, but i translated it in english for here) :然后用这条消息创建数据库(用法语,但我在这里用英语翻译了它):

The files belonging to this database system will be owned by user "MyComputerUserName".
This user must also own the server process.

The database cluster will be initialized with locale "French_France.1252".
The default text search configuration will be set to "french".

My problem is that the command line flag for the user is not set to postgres and i get a 1252 Encoding instead of utf8 .我的问题是用户的命令行标志未设置为postgres并且我得到1252 Encoding 而不是utf8 But for a strange reason, the directoty flag work well and the data directory is created.但是出于一个奇怪的原因,directoty 标志运行良好并且创建了data目录。

i tried to launch cmd.exe either with or without admin rights, but i get the same problem.我试图在有或没有管理员权限的情况下启动 cmd.exe,但我遇到了同样的问题。

i use the version postgresql-13.1-1-windows-x64-binaries我使用版本postgresql-13.1-1-windows-x64-binaries

any ideas on why the command line not working correctly?关于为什么命令行不能正常工作的任何想法? (´・ω・`)? (´・ω・`)?

Thanks for your help.谢谢你的帮助。

There is nothing wrong here (or at least, no evidence of it).这里没有错(或者至少,没有证据证明)。 -U controls the name of the boot-strap superuser within PostgreSQL, while the message tells you the name of the OS user who will own the files. -U 控制 PostgreSQL 中引导程序超级用户的名称,而该消息告诉您将拥有文件的操作系统用户的名称。 It is not a contradiction for those to be different.那些不同的人并不矛盾。

UTF8 is an encoding, while "French_France.1252" is a locale. UTF8 是一种编码,而“French_France.1252”是一种语言环境。 Again, it is not a contradiction for those to be different.再说一次,那些不同的人并不矛盾。 Indeed they have to be different, as there is no locale named 'UTF8'.事实上,它们必须不同,因为没有名为“UTF8”的语言环境。

If you start up the database, I think you will find that the superuser's name is postgres the encoding is UTF8.如果你启动数据库,我想你会发现超级用户的名字是postgres,编码是UTF8。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM