Table data exclusion patch for pg_dump

From: Vadim Trochinsky <me(at)vadim(dot)ws>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Table data exclusion patch for pg_dump
Date: 2009-05-01 02:22:11
Message-ID: 200905010622.11667.me@vadim.ws
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello!

This is a patch that allows choosing not to dump the data for the selected
tables.

The intended usage is to make backups smaller and faster, by allowing skipping
unneeded data, while still generating a backup that can be restored and obtain
a fully working application.

I use it to avoid dumping log data, and the content of tables that keep data
that has a short lifetime (which in the event of a restore would have expired
by then anyway)

The patch adds the -d and -D arguments:
-d --data=TABLE dump data for the named table(s)
-D --exclude-data=TABLE do NOT dump data for the named table(s)

I believe the patch to be complete, though I'm very new to the postgresql
codebase and might have missed something.

The patch applies to HEAD, compiles and worked properly in my tests.

Attachment Content-Type Size
exclude_table_data_v1.patch text/x-patch 6.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2009-05-01 03:00:55 Re: Restore deleted rows
Previous Message Itagaki Takahiro 2009-05-01 02:01:09 Re: Creating a tablespace directory in recovery