CentOS 7 pg

编程入门 行业动态 更新时间:2024-10-25 12:17:29
本文介绍了CentOS 7 pg_upgrade 权限错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试在 CentOS 7 上将 PostgreSQL 从 9.2 迁移到 10.2

I'm trying to migrate PostgreSQL from 9.2 to 10.2 on CentOS 7

我已经安装了新版本,我正在尝试实施转换:

I've installed the new version, and I'm trying to implement the changeover:

/usr/pgsql-10/bin/pg_upgrade --old-datadir /var/lib/pgsql/data/ --new-datadir /var/lib/pgsql/10/data/ \ --old-bindir /usr/bin/ --new-bindir /usr/pgsql-10/bin/

我得到的错误是:

could not open version file: /var/lib/pgsql/data/PG_VERSION Failure, exiting

我以 root 身份尝试,pg_upgrade 无法以 root 身份运行.

I try as root, and pg_upgrade cannot be run as root.

/var/lib/pgsql 属于 postgres:postgres,所以我有点不知所措.

/var/lib/pgsql belongs to postgres:postgres so I'm at a bit of a loss how I can get this done.

我必须是某个用户才能使用 pg_upgrade 升级 PostgreSQL 吗?我如何继续将其切换到 v10.2?我敢肯定这是我忽略的事情,而且很简单.

Do I have to be a certain user to upgrade PostgreSQL using pg_upgrade? How do I proceed to get this switched over to v10.2? I'm sure it's something I'm overlooking and simple.

推荐答案

您必须以拥有新旧数据目录的用户身份运行 pg_upgrade.该用户通常是 postgres.

You must run pg_upgrade as the user that owns both the new and the old data directories. That user is typically postgres.

如果 /var/lib/pgsql/data/PG_VERSION 不存在,则 /var/lib/pgsql/data 不是 PostgreSQL 数据目录.

If /var/lib/pgsql/data/PG_VERSION does not exist, /var/lib/pgsql/data is no PostgreSQL data directory.

更多推荐

CentOS 7 pg

本文发布于:2023-10-18 12:45:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1504268.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:CentOS   pg

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!