小编cjo*_*nes的帖子

Improving RAM and CPU utilization by PostgreSQL 9.6

I've been running a function on the database that is going into each table, ALTER COLUMN on all columns of a certain data type, and CAST to remove trailing zeros. About 115 tables varying from a few thousand records to a few hundred thousand records. It has been running for almost 24 hours and my approximate calculation until time of completion is about 58 hours.

I have htop up and checking on it regularly.

I should mention this is a …

postgresql optimization memory centos cpu

7
推荐指数
2
解决办法
2万
查看次数

使用 pg_dump 制作数据库的精确副本的正确方法是什么?

基本上,我正在尝试制作一个 SQL 转储来制作数据库的精确副本:用户定义的函数、关系、约束、表、数据等。

这是可行的pg_dump还是psql需要使用?

我一直在使用pg_dump -U user -cOx database > pg.sql,但我并不完全清楚它是否捕获了所有内容

我正在查看pg_dump这里的所有标志:

https://www.postgresql.org/docs/11/app-pgdump.html

我能想到的唯一一个可能会这样做的,因为它并没有真正明确地说,是-s --schema-only标志,它排除了数据。我对此很好,并pg_dump为数据运行了一秒钟,但我主要想确保我正在备份用户定义的函数、关系等。

postgresql backup pg-dump postgresql-11

4
推荐指数
1
解决办法
275
查看次数