前两天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. 关于go语言中的WaitGroup

    如果你刚接触Go语言并且想用它构建高并发,高性能的应用,弄明白WaitGroups是怎么回事很重要. 在本教程中,我们将掌握以下内容: WaitGroups的用途 一个WaitGroups的简单示例 ...

  2. wc命令详解

    基础命令学习目录首页 原文链接:http://www.cnblogs.com/peida/archive/2012/12/18/2822758.html Linux系统中的wc(Word Count) ...

  3. 实验1 熟悉Linux开发环境 实验报告

    参见http://www.cnblogs.com/lhc-java/p/4970269.html

  4. 20172325 2017-2018-2 《Java程序设计》第五周学习总结

    20172325 2017-2018-2 <Java程序设计>第五周学习总结 教材学习内容总结 1.布尔表达式的值只有真或假,表达式的结果决定了下一步将要执行的语句. 2.循环语句可以用在 ...

  5. Sprint计划表

    Sprint会议计划 一.Sprint  需求 准备环节:小组成员利用周六周日在网上查阅Android开发的教程,练习开发一些简单的小程序,具备一定的开发能力,在电脑上搭建Android开发环境,做好 ...

  6. 使你的WebService可以远程调试点击“调用”

    默认发布webservice时,只有在本机访问某个方法时可以点击调用,如果有参数时,也可以输入参数值,但是如果是远程访问时,点击进入一个服务时,是不显示“调用”和输入参数框的. 原来web.confi ...

  7. 深入理解mybatis

    MyBatis是目前非常流行的ORM框架,它的功能很强大,然而其实现却比较简单.优雅.本文主要讲述MyBatis的架构设计思路,并且讨论MyBatis的几个核心部件,然后结合一个select查询实例, ...

  8. 【DL.AI】《Structuring Machine Learning Projects》笔记

    一.改进模型的几个方法 Collect more data Collect more diverse training set Train algorithm longer with gradient ...

  9. asp.net 错误24

    错误 24 “xxx.Web.xxx.xxx”不包含“xxName”的定义,并且找不到可接受类型为“xxx.Web.xxxr.xxx”的第一个参数的扩展方法“xxxName”(是否缺少 using 指 ...

  10. IE8+SpringMVC文件上传防止JSON下载

    今天在IE8测试文件上传的时候发现总是提示下载,原因是上传接口返回的是json,通过以下修改就可以保证返回是json并且不会出现下载的情况: @RequestMapping(value = " ...