0

If I use pg_restore to restore the complete database I get all indexes for the tables. But when I try to import a single table there are never any indexes.

to backup i run

pg_dump -Fc -w database > my_database.dump

to restore a single table i run

pg_restore -t table_name -s my_database.dump

Which only returns the create table statement and missing the indexs, where am I going wrong?

4

If you use -t, you limit the operation to the table you named. Indices are different objects and need to be selected with the -I (or --index=) selector.

1
  • How about primary keys and serial columns. These seem to get lost too. – user2375592 Sep 30 '16 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.