Subject: pg_restore problem to load constraints with tables

From: Fabrice Chapuis <[email-masked]>
Date: Tue, 20 Feb 2024 15:44:47 +0100

Hi,
When a table is reloaded wit pg_restore, it is recreated without indexes or
constraints. There are automatically skipped. Is there a reason for this?

g_restore -j 8 -v -d zof /shared/pgdump/aq/backup/dbtest/shtest --no-owner
--role=test -t  mytable 2>&1 | tee -a dbest.log

pg_restore: skipping item 7727 SEQUENCE SET xxx_seq
pg_restore: skipping item 5110 INDEX xxxxx_cons
pg_restore: skipping item 5143 CONSTRAINT xxx
pg_restore: skipping item 5670 FK CONSTRAINT xxx

Thanks for your feedback

Fabrice

---

From: Tom Lane <[email-masked]>
Date: Tue, 20 Feb 2024 10:58:50 -0500

> constraints. There are automatically skipped. Is there a reason for this?

[ shrug ] That's how the -t switch is defined.  If you want something
else, you can use the -l and -L switches to pick out a custom
collection of objects to restore.

			regards, tom lane