Restore from only one table - Postgresql

Asked

Viewed 3,125 times

1

How can I re-store only one table from one bank to another?

I created the table backup from the following command in CMD:

pg_dump -f C:\Backup\Backup_table.backup -t public.lotesretornosuprimento -d BancoDados

But I’m not finding how I can make the Restore of this table only

  • https://makandracards.com/zeroglosa/27675-gerar-e-restaurar-backup-de-apenas-uma-tabela-postgres see if this helps you.

1 answer

1


How did you dump only one table, the pg_restore would only have an object to restore. Anyway there is the parameter -t to define the tables that will be restored.

pg_restore -t public.lotesretornosuprimento -d BancoDados C:\Backup\Backup_table.backup

If you want to restore only the data, without sending the commands to create the schema, use the parameter -a.

If it is necessary to recreate objects before restoring use the parameter -c.

More details about the pg_restore can be found in the postgres documentation: https://www.postgresql.org/docs/current/static/app-pgrestore.html

Browser other questions tagged

You are not signed in. Login or sign up in order to post.