[GENERAL] Would you add a --dry-run to pg_restore? - Mailing list pgsql-general

From Edmundo Robles
Subject [GENERAL] Would you add a --dry-run to pg_restore?
Date
Msg-id CAOXzpYCUOsha4XevsgLWH+r=ttx9LWSb_Ovcdrj3SHoc900bCQ@mail.gmail.com
Whole thread Raw
Responses Re: [GENERAL] Would you add a --dry-run to pg_restore?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: [GENERAL] Would you add a --dry-run to pg_restore?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [GENERAL] Would you add a --dry-run to pg_restore?  (Steve Atkins <steve@blighty.com>)
List pgsql-general
I mean,  to   verify the integrity of backup  i do:

gunzip -c backup_yesterday.gz | pg_restore  -d my_database  && echo "backup_yesterday is OK"

but my_database's size, uncompresed,  is too big  more than 15G  and sometimes  i  have  no space  to restore it, so always i must declutter my  disk first. 

By the way i have programmed  backups on many databases so,  i must check the integrity one by one  deleting the database  to avoid  disk space issues. By the way the restores takes too long time an average of 1 hour by  backup.

Will be great to have a dry  run option, because   the time  to verify  reduces a lot and  will save space on disk, because just  execute  with no write to disk.

if pg_restore have a dry  option i  will do:

(gunzip -c  mydata.gz | pg_restore -d mydata --dry  &&  echo "mydata0 is ok")&
(gunzip -c  my_other_data.gz | pg_restore -d my_other_data --dry  &&  echo "my_other_data is ok")&
(gunzip -c  my_another_data.gz | pg_restore -d my_another_data --dry  &&  echo "my_another_data is ok")&
wait


and  the time to  verify only will take 1 hour  instead of  3 hours.

pgsql-general by date:

Previous
From: Alexander Farber
Date:
Subject: [GENERAL] Do not INSERT if UPDATE fails
Next
From: Scott Marlowe
Date:
Subject: Re: [GENERAL] Question about loading up a table