Dear all,
I would like to know if it is possible to restore data to a pre-populated db/table.
I was reading the man pages for pg_dump and pg_restore.
“The limitations of pg_restore are detailed below.
· When restoring data to a pre-existing table and the option...
Does that mean the table can exist and can be populated with data, pg_restore will append the data to the db/table without deleting/dropping the existing data?
What I need to achieve is:
1 – Download the schema from an old DB
2 – Restore the schema to a new DB
3 – Point my application to the new DB, it will populate with new data
4 – at later date do a pg_dump to dump the data from old DB – (Should I use ‘COPY’ statement instead of pg_dump?
5 – Restore the data only to the new DB – as in copying the data and appending it to existing db/tables.
What is the natural behaviour of pg_restore, does it wipe the existing data on the existing DB, or it displays ‘errors’ and carries on copying the data?
I read there are ways of copying the data using ‘COPY’ statements, does that mean I can copy the data back without wiping the existing data?
Ps Thank you very much for all help you have given to me, and all the time you spent reading and also replying to my emails.
I am learning loads, still loads to learn but I am sure some day I will be helping as well.
Thank you very much
Best regards
Renato