前两天pg11刚出来,打算测试一下,想将测试库升级到pg11,之前测试库的版本是pg9.6,后面我将它升到了pg10,打算在pg10的版本基础上升级到pg11。

  但执行时,多次报出:

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* data types in user tables ok
Checking for contrib/isn with bigint-passing mismatch ok
Checking for presence of required libraries ok
Checking database user is the install user Only the install user can be defined in the new cluster.

所以就搜了一下代码,在src/bin/pg_upgrade/check.c中找到该报错的原因

    /*
* We only allow the install user in the new cluster because other defined
* users might match users defined in the old cluster and generate an
* error during pg_dump restore.
*/
if (cluster == &new_cluster && atooid(PQgetvalue(res, , )) != )
pg_fatal("Only the install user can be defined in the new cluster.\n");

pg_upgrade升级时,只允许使用安装新集群时所用的用户,这是因为在旧集群中存在的用户在执行pg_dump和restore时,可能会报错。

后面又查了一下环境变量,发现环境变量中配置了一个测试库的用户,而不是postgres用户。怀疑无论是在做initdb还是pg_upgrade时,都不应该走环境变量的用户,而且在执行pg_upgrade时,已经明确指定了使用postgres,那么可能出在initdb上,但重新测试发现无论initdb时,指没指定是否是postgres用户,都是按照postgres来初始化的,它是跟着操作系统用户走的。后来又重试了几遍,发现执行检测没问题,但到了实际执行时,总会报Only the install user can be defined in the new cluster的错误,然后删掉生成pg11版本的表空间数据,删掉初始化的新集群,再重新初始化,然后执行pg_ugrade的检测和实际执行就又变正常了,至此感觉碰到了bug。反复操作了三四次都是同样的结果。

如有知道原因的请告知一下,谢谢。

另外,在安装pg11时,注意参数--wal-segsize放在了initdb部分,需要在做初始化时设置,在编译部分已经没有这个参数了。

pg_upgrade升级报错:Only the install user can be defined in the new cluster的更多相关文章

  1. [已解决]报错: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Users/mac/Ana

    报错代码: pip3 install gerapy 报错内容: Could not install packages due to an EnvironmentError: [Errno 13] Pe ...

  2. VMware station 安装报错 failed to install the hcmon driver

    VMware station 安装报错 failed to install the hcmon driver 1.将 C:\Windows\System32\drivers 下的hcmon.sys改名 ...

  3. pve apt-get update error 升级报错-文章未完工和验证

    pve: apt-get update error 升级报错 提示如下报错 Hit: http://security.debian.org buster/updates InRelease Hit: ...

  4. 使用SpringMVC报错 Error creating bean with name 'conversionService' defined in class path resource [springmvc.xml]

    使用SpringMVC报错 Error creating bean with name 'conversionService' defined in class path resource [spri ...

  5. electron-vue报错:Webpack ReferenceError: process is not defined

    electron-vue报错:Webpack ReferenceError: process is not defined 博客说明 文章所涉及的资料来自互联网整理和个人总结,意在于个人学习和经验汇总 ...

  6. FreeSWITCH安装报错“You must install libyuv-dev to build mod_fsv”的解决方案

    昨天下午安装FreeSWITCH时遇到该问题时,整了一个下午都没解决,也走了许多弯路.如果直接通过yum安装libyuv-devel时,会报错说找不到该安装包.后来又通过FreeSWITCH官网的网上 ...

  7. build.xml编译报错Specified VM install not found: type Standard VM, name jdk1.7.0_45

    build.xml编译打包时报错: 解决方法: build.xml  ——  右键 ——  Run As —— External Tools Configuration 在这个页面的顶端就会看到有红叉 ...

  8. cordova AndroidStudio3.0 升级报错问题

    http://blog.csdn.net/z_Xiaozuo/article/details/78962701 ionic3 打包 安卓项目遇到的问题,当时比较冲忙升级了下android studio ...

  9. PandaSeq安装报错ltld required, install libtool library

    PandaSeq安装 $ ./autogen.sh && ./configure && make && sudo make install PandaS ...

随机推荐

  1. 关于SQL while 循环嵌套 外部循环数据无法进入内部循环

    下面一般是,作为SQL新手第一次写循环嵌套的办法,但是大家会发现一个问题,那就是变量@i总是不能进入第二个循环. declare @i int ,@j int, @k int set @j = 1 - ...

  2. java 实验一

       步骤 耗时h 百分比% 需求分析 0.3h 7.5 设计 2.5h 62.5 代码实现 0.5h 12.5 测试 0,2h 5 分析总结 0.5h 12.5 实验一 截图 实验二: 实验三 实现 ...

  3. 2017-2018-2 1723 『Java程序设计』课程 结对编程练习_四则运算 第二周

    一.结对对象 姓名:侯泽洋 学号:20172308 担任角色:驾驶员(侯泽洋) 伙伴第二周博客地址 二.本周内容 (一)继续编写上周未完成代码 1.本周继续编写代码,使代码支持分数类计算 2.相关过程 ...

  4. Chapter 9 软件实现

    软件实现包括代码设计.设计审查.代码编写.代码走查.代码编译和单元测试等活动.程序设计语言有很多,从机器语言到高级语言一直发展.软件编码需要遵循一些规范,JAVA代码有适当的空行,代码行及行内空格.分 ...

  5. Hibernate的使用技巧②

    1.Hibernate统计记录的数量 Criteria c = session.createCriteria(User.class.getName());        c.setProjection ...

  6. Structs2笔记①--structs的背景、structs2框架的意义、第一个helloworld

    Struts2的背景 由出色稳定的框架struts1和webwork框架整合而来的 吸取了两大框架的优点 提高了开发的效率和规范性 更好的实现了MVC架构 解除了与servlet的强耦合性 使用str ...

  7. srTCM和trTCM介绍

    本文是用于QoS Meter功能的算法的RFC的阅读笔记.DPDK的QoS_meter示例程序用的就是这个算法. srTCM srTCM的英文全称是Single Rate Three Color Ma ...

  8. web国际化,在不同的浏览环境,显示不同的语言

    所谓国际化就是支持多种语言,web应用在不同的浏览环境中可以显示出不同的语言.假设我们正在开发一个支持多国语言的Web应用程序,要求系统能够根据客户端的系统的语言类型返回对应的界面:英文的操作系统返回 ...

  9. 转 彻底理解js中的&&和||

    javascript中,&&和||的用法比较神奇,经常用在对象上,例如a || b,如果a不存在,则返回b.a && b,如果a存在,则返回b,否则返回a. 光这样看, ...

  10. syntax error:unexpected end of file

    将window上编辑的xxy1.sh脚本上传到linux上,并执行的时候提示 xxy1.sh: line 17: syntax error: unexpected end of file 但是通过ca ...