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

Adding WHERE clause to pg_dump

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Adding WHERE clause to pg_dump
Date: 2008-07-25 15:19:41
Message-ID: 1216999182.3894.930.camel@ebony.2ndQuadrant (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Attached patch implements WHERE clauses for pg_dump.

This is useful for producing data samples of a database

e.g. pg_dump -w "ctid < '(1000,1)' or random() < 0.1"

and can also be used for taking incremental backups, if data columns
exist to make a partial dump sensible.

e.g. pg_dump -w "last_update_timestamp > ...."

Columns such as this are very common because of optimistic locking
techniques in many databases.

This is designed to be used in conjunction with the TOM utility, and the
forthcoming patch to implement stats hooks. Taken together these
features will allow the ability to take a cut-down database environment
for testing, yet with statistics matching the main production database.

It was easier to write it and then discuss, since I needed to check the
feasibility of the idea before presenting it.

 Simon Riggs 
 PostgreSQL Training, Services and Support

Attachment: pg_dump_where.v1.patch
Description: text/x-patch (8.6 KB)


pgsql-hackers by date

Next:From: Ryan BradetichDate: 2008-07-25 15:23:57
Subject: Re: [RFC] Unsigned integer support.
Previous:From: Alvaro HerreraDate: 2008-07-25 14:42:03
Subject: Re: Do we really want to migrate plproxy and citext intoPG core distribution?

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