sách gpt4 ai đã đi

postgresql - 是否可以在不破坏现有数据库的情况下安装 Postgresql?

In lại 作者:行者123 更新时间:2023-12-04 19:11:05 28 4
mua khóa gpt4 Nike

我在 Ubuntu 18.04 上安装了 Postgresql 10,但不知何故坏了,不会重新启动。我可以重新安装它而不破坏它的数据库,以便我可以再次访问数据库吗? pg_dump 不起作用。

1 Câu trả lời

是的,你可以这么做。
默认情况下,您的数据库和其他重要文件存储在 PGDATA 中。

Traditionally, the configuration and data files used by a database cluster are stored together within the cluster's data directory, commonly referred to as PGDATA (after the name of the environment variable that can be used to define it). A common location for PGDATA is /var/lib/pgsql/data.



https://www.postgresql.org/docs/10/storage-file-layout.html

我不知道您将如何卸载 PostgreSQL,但请务必保留 PGDATA。
(yum 或 apt 不会删除 PGDATA)
重新安装 PostgreSQL 后,确保使用现有的 PGDATA 启动 PostgreSQL
pg_ctl start -D YOUR_EXISTING_PGDATA/

关于postgresql - 是否可以在不破坏现有数据库的情况下安装 Postgresql?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55581913/

28 4 0
Bài viết được đề xuất: ubuntu - 命令 'ls'看不到挂载磁盘的文件
Bài viết được đề xuất: gcc - 如何在 GCC 中打印/转换十进制浮点值?
Bài viết được đề xuất: scala - 在 Scalaz 中仅累积验证错误
Bài viết được đề xuất: ubuntu - 在匹配的 CWD 中使用 'code' 打开 VS 代码?
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com