我正在尝试将postgres从9.5升级到9.6.
brew upgrade postgresql
成功,但在跑步时
pg_upgrade -b /usr/local/Cellar/postgresql/9.5.3/bin/ -B /usr/local/Cellar/postgresql/9.6.1/bin/ -d /usr/local/var/postgres -D /usr/local/var/postgres9.6 -U postgres
Run Code Online (Sandbox Code Playgroud)
我收到一个错误
Performing Consistency Checks
-----------------------------
Checking cluster versions ok
Checking database user is the install user
database user "postgres" is not the install user
Failure, exiting
Run Code Online (Sandbox Code Playgroud)
当没有-U postgres
在最后尝试它甚至更奇怪
Performing Consistency Checks
-----------------------------
Checking cluster versions ok
Checking database user is the install user ok
Checking database connection settings ok
Checking for prepared transactions ok
Checking for reg* system OID user data types ok
Checking for contrib/isn with bigint-passing mismatch ok
Checking for roles starting with 'pg_' ok
Creating dump of global objects ok
Creating dump of database schemas
ok
Checking for presence of required libraries ok
Checking database user is the install user
database user "dimid" is not the install user
Run Code Online (Sandbox Code Playgroud)
那怎么来的
Checking database user is the install user ok
Run Code Online (Sandbox Code Playgroud)
旧的 PostgreSQL 集群显然是用
initdb -U dimid
Run Code Online (Sandbox Code Playgroud)
但是新集群是由不同的超级用户安装的。
您必须使用与旧集群相同的超级用户名创建新集群。
特别是对于自制的 postgresql 安装,initdb 的默认用户是 $USER——所以如果你最初只是按照说明进行操作并执行类似的操作
initdb /usr/local/var/postgres -E utf8
Run Code Online (Sandbox Code Playgroud)
安装用户是您的 Unix 用户名。就我而言,它是 'rob',所以只需在 pg_upgrade 中添加 '-U rob' 也可以:
pg_upgrade -b /usr/local/Cellar/postgresql/9.5.4_1/bin -B /usr/local/Cellar/postgresql/9.6.2/bin -d /usr/local/var/postgres95 -D /usr/local/var/postgres -U rob
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1966 次 |
最近记录: |