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

Re: [HACKERS] pg_dump --comment?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jon Jensen <jon(at)endpoint(dot)com>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>,Chris Campbell <chris(at)bignerdranch(dot)com>,PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] pg_dump --comment?
Date: 2004-06-04 05:03:20
Message-ID: 200406040503.i5453Kp11894@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Jon Jensen wrote:
> On Fri, 28 May 2004, Christopher Kings-Lynne wrote:
> 
> > > I've encountered a situation where I'd like to store some information 
> > > about the database when I do a pg_dump. For instance, the timestamp of 
> > > the dump. And some other information that I pull from the database.
> > 
> > I think every dump should dump the timestamp regardless...
> 
> That would cause me a lot of trouble. Every night I do a pg_dump on all my
> databases to a temporary file. Then I use cmp to compare that dump to last
> night's dump. If they're identical I just delete the new dump so that only
> the old one remains, with its original timestamp. That way rsync doesn't
> see any change, and doesn't waste any time comparing it when we do
> backups. It's also handy to see the last day the dump changed by looking
> at the file's timestamp.
> 
> Granted, this is only of interest on databases that don't change at all, 
> but on a multi-user system we have a surprising number of databases that 
> don't change at all for days (alongside the ones that change all the time, 
> of course).
> 
> However, I would like to see an option to include the timestamp if someone 
> wants it.

The following patch adds start/stop times for pg_dump and pg_dumpall
when verbose output is selected:

	--
	-- PostgreSQL database cluster dump
	-- Started on 2004-06-04 01:01:35 EDT
	--
	
	--
	-- PostgreSQL database dump
	-- Started on 2004-06-04 01:01:36 EDT
	--
	
	--
	-- PostgreSQL database dump complete
	-- Completed on 2004-06-04 01:01:36 EDT
	--
	
	--
	-- PostgreSQL database cluster dump complete
	-- Completed on 2004-06-04 01:01:36 EDT
	--

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2004-06-04 05:10:08
Subject: Re: [HACKERS] pg_dump --comment?
Previous:From: Jan WieckDate: 2004-06-04 05:01:19
Subject: Slony-I goes BETA

pgsql-patches by date

Next:From: Tom LaneDate: 2004-06-04 05:10:08
Subject: Re: [HACKERS] pg_dump --comment?
Previous:From: Bruce MomjianDate: 2004-06-04 04:10:50
Subject: Re: small fix in FAQ

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