Re: [HACKERS] pg_dump end comment

2004-03-31 Thread scott.marlowe
On Wed, 31 Mar 2004, Philip Warner wrote:

 At 12:13 AM 31/03/2004, Bruce Momjian wrote:
 Yes, they have to check for a proper exit from pg_dump, but there is
 still a file sitting around after the dump, with no way to tell if it is
 accurate.
 
 Why don't we write a hash into the header or footer. Then use something like:
 
  pg_restore --verify dump-file
 
 if file integrity is the objective.

I like this idea.  Nice to be able to check the md5 sig to make sure a 
backup is not corrupted OR short.


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [HACKERS] pg_dump end comment

2004-03-30 Thread Gavin Sherry
On Tue, 30 Mar 2004, Bruce Momjian wrote:

 Tom Lane wrote:
  Christopher Kings-Lynne [EMAIL PROTECTED] writes:
   This might seem a bit silly, but is there any chance we could add a
   comment at the end of pg_dump text output that says '-- End of dump'?
 
  Sure --- while you're at it, put a beginning of dump at the start.
 
  Is it worth adding the database name and/or other command-line
  parameters given to pg_dump?
 
  One thing to think about is the difference between a bare pg_dump and a
  pg_dump/pg_restore sequence.  Should these always generate identical
  text output?  (They do as of CVS tip, I believe, though this was not
  always true before.)
 
  Possibly this is all gilding the lily though...

 I like an end-of-dump marker for folks who want to check if the dump got
 truncated somehow.  I can see how to do that for text dumps, but what
 about for tar or custom dumps?

Wouldn't it be more effective to test for non zero return status as this
handles -Fc cases, etc, which would be non-trivial to test.

Gavin

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] pg_dump end comment

2004-03-30 Thread Tom Lane
Gavin Sherry [EMAIL PROTECTED] writes:
 On Tue, 30 Mar 2004, Bruce Momjian wrote:
 I like an end-of-dump marker for folks who want to check if the dump got
 truncated somehow.  I can see how to do that for text dumps, but what
 about for tar or custom dumps?

 Wouldn't it be more effective to test for non zero return status as this
 handles -Fc cases, etc, which would be non-trivial to test.

In the tar and custom archive formats, it's fairly obvious if the file
was truncated: you'll have table-of-contents entries that point past
the end of file.  The only case that really needs an endmarker is
textual scripts --- both straight from pg_dump, and produced by
pg_restore.

regards, tom lane

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [HACKERS] pg_dump end comment

2004-03-30 Thread Bruce Momjian
Gavin Sherry wrote:
 On Tue, 30 Mar 2004, Bruce Momjian wrote:
 
  Tom Lane wrote:
   Christopher Kings-Lynne [EMAIL PROTECTED] writes:
This might seem a bit silly, but is there any chance we could add a
comment at the end of pg_dump text output that says '-- End of dump'?
  
   Sure --- while you're at it, put a beginning of dump at the start.
  
   Is it worth adding the database name and/or other command-line
   parameters given to pg_dump?
  
   One thing to think about is the difference between a bare pg_dump and a
   pg_dump/pg_restore sequence.  Should these always generate identical
   text output?  (They do as of CVS tip, I believe, though this was not
   always true before.)
  
   Possibly this is all gilding the lily though...
 
  I like an end-of-dump marker for folks who want to check if the dump got
  truncated somehow.  I can see how to do that for text dumps, but what
  about for tar or custom dumps?
 
 Wouldn't it be more effective to test for non zero return status as this
 handles -Fc cases, etc, which would be non-trivial to test.

Yes, they have to check for a proper exit from pg_dump, but there is
still a file sitting around after the dump, with no way to tell if it is
accurate.

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

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [HACKERS] pg_dump end comment

2004-03-30 Thread Philip Warner
At 12:13 AM 31/03/2004, Bruce Momjian wrote:
Yes, they have to check for a proper exit from pg_dump, but there is
still a file sitting around after the dump, with no way to tell if it is
accurate.
Why don't we write a hash into the header or footer. Then use something like:

pg_restore --verify dump-file

if file integrity is the objective.




Philip Warner| __---_
Albatross Consulting Pty. Ltd.   |/   -  \
(A.B.N. 75 008 659 498)  |  /(@)   __---_
Tel: (+61) 0500 83 82 81 | _  \
Fax: (+61) 03 5330 3172  | ___ |
Http://www.rhyme.com.au  |/   \|
 |----
PGP key available upon request,  |  /
and from pgp.mit.edu:11371   |/ 

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faqs/FAQ.html


Re: [HACKERS] pg_dump end comment

2004-03-30 Thread Christopher Kings-Lynne
I like an end-of-dump marker for folks who want to check if the dump got
truncated somehow.  I can see how to do that for text dumps, but what
about for tar or custom dumps?
Wouldn't it be more effective to test for non zero return status as this
handles -Fc cases, etc, which would be non-trivial to test.
That assumes you are there at the time of dump...

Chris

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faqs/FAQ.html


Re: [HACKERS] pg_dump end comment

2004-03-29 Thread Tom Lane
Christopher Kings-Lynne [EMAIL PROTECTED] writes:
 This might seem a bit silly, but is there any chance we could add a 
 comment at the end of pg_dump text output that says '-- End of dump'?

Sure --- while you're at it, put a beginning of dump at the start.

Is it worth adding the database name and/or other command-line
parameters given to pg_dump?

One thing to think about is the difference between a bare pg_dump and a
pg_dump/pg_restore sequence.  Should these always generate identical
text output?  (They do as of CVS tip, I believe, though this was not
always true before.)

Possibly this is all gilding the lily though...

regards, tom lane

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] pg_dump end comment

2004-03-29 Thread Bruce Momjian
Tom Lane wrote:
 Christopher Kings-Lynne [EMAIL PROTECTED] writes:
  This might seem a bit silly, but is there any chance we could add a 
  comment at the end of pg_dump text output that says '-- End of dump'?
 
 Sure --- while you're at it, put a beginning of dump at the start.
 
 Is it worth adding the database name and/or other command-line
 parameters given to pg_dump?
 
 One thing to think about is the difference between a bare pg_dump and a
 pg_dump/pg_restore sequence.  Should these always generate identical
 text output?  (They do as of CVS tip, I believe, though this was not
 always true before.)
 
 Possibly this is all gilding the lily though...

I like an end-of-dump marker for folks who want to check if the dump got
truncated somehow.  I can see how to do that for text dumps, but what
about for tar or custom dumps?

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

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org