Skip site navigation (1) Skip section navigation (2)

New pg_dump options: exclude tables/schemas, multiple all,wildcards

From: Greg Sabino Mullane <greg(at)turnstep(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: New pg_dump options: exclude tables/schemas, multiple all,wildcards
Date: 2006-01-16 02:19:28
Message-ID: 1137377967.3847.26.camel@localhost.localdomain (view raw or whole thread)
Lists: pgsql-patches
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message
Attached is a patch to hopefully make pg_dump a lot more useful.
I started out by making it simply able to avoid dumping a single
table, but, inspired by David Fetter's patch last November, also
added in support for multiple items and limited wildcard matching.
-n and -N control the schemas, and -t and -T control the tables.
Wildcards can be a star at the start, the end, or on both sides
of a term. The patch acts inclusively with conflicts: the -t
option trumps the -N option.
Some examples:
To dump all tables beginning with the string "slony", plus
all tables with the word "log" inside of them:
pg_dump -t "slony*" -t "*log*"
To dump all schemas except "dev" and "qa", and all tables
except those ending in "large":
pg_dump -N "dev" -N "qa" -T "*large"
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200601152100

Attachment: pg_dump_multi.patch
Description: text/x-patch (28.4 KB)


pgsql-patches by date

Next:From: David FetterDate: 2006-01-16 04:08:57
Subject: Uninstall scripts for contrib
Previous:From: ITAGAKI TakahiroDate: 2006-01-16 02:00:33
Subject: Re: Fix overflow of bgwriter's request queue

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group