pg_dump Table and Schema Pattern Tester
pg_dump -t, -T, -n and -N take patterns, not plain names: unquoted letters fold to lower case, * and ? are wildcards, a dot splits schema from table, and a pattern without a schema only matches tables on your search_path. This tester converts each pattern the same way pg_dump does (PostgreSQL 14 and later), shows the SQL condition it runs, lists the tables it matches in your own object list, and prints the final set of tables that would be dumped, together with a correctly quoted command. Everything runs in your browser.
Do more than pg_dump table and schema pattern tester — meet Chat2DB
Chat2DB is an AI-powered SQL client for Windows, macOS and Linux. Write SQL in natural language, format and optimize queries automatically, and manage MySQL, PostgreSQL, Oracle and 20+ other databases in one workspace.
How to use
- Run the SQL shown under the object list in your database and paste its output, or keep the sample list. Set the database name and your search_path (SHOW search_path;).
- Type the patterns you plan to pass to -t, -T, -n, -N or --exclude-table-data, one per line, and choose whether --strict-names is on.
- Read the per-pattern matches and notes, check the final list of dumped tables, then copy the quoted pg_dump command.
Frequently asked questions
Why does pg_dump -t say no matching tables were found?
The usual causes are case folding (-t Orders looks for orders; use -t '"Orders"'), a table outside the search_path (-t invoices does not find sales.invoices; use -t sales.invoices), the shell expanding or stripping characters (always single-quote the pattern), and partitions, which -t parent does not include. With several -t switches pg_dump only fails when none of them matches, unless you add --strict-names.
How do I use wildcards with pg_dump -t?
Use * for any sequence of characters and ? for one character, and put the pattern in single quotes so the shell leaves it alone: pg_dump -t 'public.order*'. Regular expression syntax also works outside double quotes, for example -t 'sales.invoices_20(25|26)' or -t 'audit_202[56].log'. Inside double quotes every character is literal.
Does pg_restore -t accept the same patterns?
No. pg_restore -t, -n and -I compare plain names exactly; wildcards and schema-qualified names are not supported there. To restore a subset with patterns, use pg_restore -l to write the table of contents to a file, edit it, and restore with pg_restore -L.
