PostgreSQL 9.0.13 doing a pg_restore but no evidence that disk space is being used -


i'm trying restore pg_dump taken command server.

sudo -u postgres pg_dump --verbose --format=custom --file=pg-backup.sql -u postgres salesdb 

after copied on pg-backup.sql file i'm trying restore command

sudo -u postgres pg_restore --verbose --jobs=`nproc` -f pg-backup.sql 

the pg-backup.sql file 13gb. pg-restore has been running 4 hours, scrolling data screen whole time. no errors.

but when execute statement psql session

select pg_size_pretty(pg_database_size('salesdb')); 

i 5377 kb in size. what? should @ least 1gb now. i'm totally lost. data scrolling screen , can't prove going anywhere. no disk usage.

help

try without "-f" flag in pg_restore command. also, might want try creating empty salesdb database , pass in "-d salesdb". note db name fold lowercase unless created within double-quotes.

added example steps show db grows in size restore running

-- sample pg_dump command pg_dump -f testdb.out -fc src_test_db  -- create db restore createdb sometestdb  -- restore 4 parallel jobs, "testdb.out" file, db "sometestdb" time pg_restore --dbname=sometestdb --jobs=4 testdb.out  -- in window, every few seconds, can see db growing psql -d postgres -c "select pg_size_pretty(pg_database_size('sometestdb'))"  pg_size_pretty  ----------------  4920 mb  psql -d postgres -c "select pg_size_pretty(pg_database_size('sometestdb'))"  pg_size_pretty  ----------------  4920 mb  psql -d postgres -c "select pg_size_pretty(pg_database_size('sometestdb'))"  pg_size_pretty  ----------------  5028 mb  psql -d postgres -c "select pg_size_pretty(pg_database_size('sometestdb'))"  pg_size_pretty  ----------------  5371 mb 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -