Answers:
您会在initdb
下面找到/usr/lib/postgresql/x.y/bin/
。另请参阅/usr/share/doc/postgresql-common/README.Debian.gz
以获取有关在Debian和Ubuntu上进行安装的更多信息。
initdb
是基本命令,但Debian和Ubuntu用户应使用pg_createcluster及其相关命令集。此外,由于标准安装已经为您创建了一个包含服务器和默认/模板数据库的默认集群,因此通常不需要执行initdb
OR操作。Peter上面提到的自述文件值得您花时间阅读。pg_createcluster
apt-get install postgresql
从root 1.passwd postgres输入密码,然后从2.su postgres 3.psql输入以下步骤。4.创建用户名的用户,例如“ CREATE USER SAM;”。5.创建数据库sam; 现在注销6.type psql给您的用户
Please note that you can of course also use the upstream tools for creating clusters, such as initdb(1). However, please note that in this case you cannot expect *any* of above pg_* tools to work, since they use different configuration settings and file locations. If in doubt, then do *not* use initdb, but only pg_createcluster. Since merely installing postgresql-X.Y will already set up a default cluster which is ready to work, most people do not need to bother about initdb or pg_createcluster at all.