How to dump a postgres db excluding one specific table?

According to the docs, there is an option to --exclude-table which excludes tables from the dump by matching on a pattern (i.e. it allows wildcards):

-T table
–exclude-table=table Do not dump any tables matching the table pattern. The pattern is interpreted according to the same rules as for
-t. -T can be given more than once to exclude tables matching any of several patterns.

When both -t and -T are given, the behavior is to dump just the tables
that match at least one -t switch but no -T switches. If -T appears
without -t, then tables matching -T are excluded from what is
otherwise a normal dump.

There are a few examples here.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)