Thread

  1. improve pg_restore warning on text dump input

    Andrew Dunstan <andrew@dunslane.net> — 2012-01-03T18:43:04Z

     From time to time there are complaints because people mistakenly feed a 
    text format dump to pg_restore and get back a somewhat cryptic message 
    about the file not being a valid archive. It's been suggested that we 
    should have pg_restore run the file through psql, but that would involve 
    more work than I at least care to give the problem. However, I think we 
    should give a nicer message, suggesting the user try feeding the file to 
    psql instead. The attached small patch does that.
    
    cheers
    
    andrew
    
    
    
  2. Re: improve pg_restore warning on text dump input

    Tom Lane <tgl@sss.pgh.pa.us> — 2012-01-03T18:55:29Z

    Andrew Dunstan <andrew@dunslane.net> writes:
    >  From time to time there are complaints because people mistakenly feed a 
    > text format dump to pg_restore and get back a somewhat cryptic message 
    > about the file not being a valid archive. It's been suggested that we 
    > should have pg_restore run the file through psql, but that would involve 
    > more work than I at least care to give the problem. However, I think we 
    > should give a nicer message, suggesting the user try feeding the file to 
    > psql instead. The attached small patch does that.
    
    It would probably be better if you put this test before the one that
    insists the file is at least 512 bytes.
    
    			regards, tom lane
    
    
  3. Re: improve pg_restore warning on text dump input

    Andrew Dunstan <andrew@dunslane.net> — 2012-01-03T19:09:28Z

    
    On 01/03/2012 01:55 PM, Tom Lane wrote:
    > Andrew Dunstan<andrew@dunslane.net>  writes:
    >>    From time to time there are complaints because people mistakenly feed a
    >> text format dump to pg_restore and get back a somewhat cryptic message
    >> about the file not being a valid archive. It's been suggested that we
    >> should have pg_restore run the file through psql, but that would involve
    >> more work than I at least care to give the problem. However, I think we
    >> should give a nicer message, suggesting the user try feeding the file to
    >> psql instead. The attached small patch does that.
    > It would probably be better if you put this test before the one that
    > insists the file is at least 512 bytes.
    >
    > 			
    
    
    Hmm, yeah. I guess we're pretty much certain that these markers can't 
    reasonably appear at the start of a tar archive.
    
    cheers
    
    andrew