我正在尝试将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
我收到错误
Performing Consistency Checks
-----------------------------
Checking cluster versions ok
Checking database user is the install user
database user "postgres" is not the install user
Failure, exiting
最后在没有-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
那怎么来
Checking database user is the install user ok
答案 0 :(得分:3)
旧的PostgreSQL集群显然是用
创建的byte[] originalBytes = ...
String string = new BigInteger(originalBytes).toString();
...
byte[] decodedBytes = new BigInteger(string).toByteArray();
但新群集与另一个超级用户进行了联系。
您必须使用与旧群集相同的超级用户名创建新群集。
答案 1 :(得分:0)
我得到这个是因为目标数据库包含一个额外的用户。
这以前是我安装和升级初始化脚本的一部分。我从升级 initdb 中删除了它,升级成功完成。