pg_dump patch: Allow -X'exclude table from dump by pattern'

Started by Giuseppe Tanzilli - CSFover 24 years ago2 messageshackers
Jump to latest
#1Giuseppe Tanzilli - CSF
g.tanzilli@gruppocsf.com

Ciao,
I had the need to exclude tables from the dump so I made this patch,
I do something like

pg_dump -X \"Test_*\" -X \"Devel*\" test

I'm not a C guru, but it work, the only thing I was unable to get rid
of is the dump of sequences for that table,

so I have to add -X tablename_id_seq

If you can suggest a way to work around it, I will try to fix it

hope it can be useful to the project

bye

--
-------------------------------------------------------
Giuseppe Tanzilli g.tanzilli@gruppocsf.com
CSF Sistemi srl phone ++39 0775 7771
Via del Ciavattino
Anagni FR
Italy

Attachments:

postgresql_pg_dump_exclude_patch_7.1.3text/plain; name=postgresql_pg_dump_exclude_patch_7.1.3Download+81-9
#2Peter Eisentraut
peter_e@gmx.net
In reply to: Giuseppe Tanzilli - CSF (#1)
Re: pg_dump patch: Allow -X'exclude table from dump by

Giuseppe Tanzilli - CSF writes:

Ciao,
I had the need to exclude tables from the dump so I made this patch,
I do something like

pg_dump -X \"Test_*\" -X \"Devel*\" test

We already have an option -t to select the table name to dump. This could
be expanded to interpret the name as a pattern of some kind (RE or LIKE
pattern). If you want to work on that I think no one would object.

--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter