简体   繁体   中英

what will happen if we restore postgresql dump file on existing database?

What will happen if we restore a pgdump file of earlier time on a running db?

I have restored an older sql file over existing database does it harm to DB and its functinality ?

In general, yes, it'll screw up the database. Rows that were deleted in the past will be back. Sequences may be reset. Dropped tables can be re-created. All sorts of things.

Without more details, particularly the command used when restoring the dump and the nature of the dump, it's hard to be sure in this specific case.

If you restored with:

psql -1 -v ON_ERROR_STOP=1 -f the_dump.sql 

then it's possibly you might not have any damage, or might only have to re-set some sequences.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM