postgresql - Postgres 导入问题 - 巨大的表显示 0 行
问题描述
我有一个数据库导入问题。基本上,我在 postgres 9.6(生产)上这样做:
/usr/bin/pg_dump mydb | /bin/gzip | /usr/bin/ssh root@1.2.3.4 "cat > /root/20210130.sql.gz"
在远程机器上,我正在像这样在 Postgres 11 上导入:
step 1: import schema from a beta machine with Postgres 11
step 2: import data from that export like this: time zcat 20210130.sql.gz | psql mydb
我遇到的问题是其中一张表有 0 行,即使它使用了大量磁盘空间。
在原始数据库中:
table_schema | table_name | row_estimate | total | index | toast | table
--------------------+--------------------------+--------------+------------+------------+------------+------------
public | test | 5.2443e+06 | 18 GB | 13 GB | 8192 bytes | 4864 MB
在新数据库中:
table_schema | table_name | row_estimate | total | index | toast | table
--------------------+--------------------------+--------------+------------+------------+------------+------------
public | test | 0 | 4574 MB | 4574 MB | 8192 bytes | 16 kB
这里发生了什么?我该如何解决?
我无法再次导入整个数据库,因为导入需要大约 7 个小时。
解决方案
推荐阅读
- google-data-studio - google-data-studio 将大多数维度值分组到其他类别中
- python - 当控制台显示“在 http://127.0.0.1:5000/ 上运行”时,浏览器上出现错误 404
- mysql - MySQL查询给出错误你不能指定目标表
- jquery - 从 WooCommerce 可变产品的变体中自动选择第一个可用选项
- ios - SwiftUI 文本字段文本颜色问题
- javascript - javascript 上的二进制搜索
- c - 发送日期和时间作为 TCP 服务器欢迎消息
- javascript - 对现有请求提出请求
- javascript - 在对象数组中创建具有相同键平均值的新数组
- sql - 在 Oracle PL SQL 中的 CONNECT_BY_ROOT 之后显示直接父级