# pg\_restore -L & pg\_staging

DevFeed: [pg\_restore -L & pg\_staging](<https://devfeed.tech/articles/pg-restore-l-pg-staging-34440.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2011/08/pg_restore-l-pg_staging/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2011-08-29T16:05:00Z

Content type: tutorial

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Database](<https://devfeed.tech/topics/database.md>), [configuration](<https://devfeed.tech/topics/configuration.md>)

Tags: [configuration](<https://devfeed.tech/tags/configuration.md>), [pg-dump](<https://devfeed.tech/tags/pg-dump.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [sql](<https://devfeed.tech/tags/sql.md>)

## AI overview

This tutorial explains how to use pg_restore list files and the pg_staging tool to selectively restore objects from PostgreSQL custom-format dumps. It covers editing restore lists to exclude tables, schemas, data, triggers, and related functions.

## Source excerpt

On the PostgreSQL Hackers mailing lists, Andrew Dunstan just proposed some new options for pg_dump and pg_restore to ease our lives. One of the answers was talking about some scripts available to exploit the pg_restore listing that you play with using options -l and -L, or the long name versions --list and --use-list. The pg_staging tool allows you to easily exploit those lists too. The pg_restore list is just a listing of one object per line of all objects contained into a custom dump, that is one made with pg_dump -Fc. You can then tweak this listing in order to comment out some objects (prepending a ; to the line where you find it), and give your hacked file back to pg_restore --use-list so that it will skip them.