Thread

  1. Re: [HACKERS] drop before create in pg_dump

    Tom Lane <tgl@sss.pgh.pa.us> — 1999-01-15T23:44:32Z

    Brook Milligan <brook@trillium.NMSU.Edu> writes:
    > pg_dump won't drop stuff before trying to create it; this makes
    > dropping a single table (say) and recreating it difficult to automate
    > since it is subject to error if all the stuff doesn't get dropped
    > properly.  The following patch causes pg_dump to emit DROP ...
    > statements prior to emitting CREATE ... statements.
    
    I think that ought to be driven by a switch to pg_dump ...
    much of the time, I would *want* pg_dump's script to fail
    if there's already an existing item of the given name.
    
    I see your concern, I just don't think it's the only scenario.
    
    			regards, tom lane
    
    
  2. Re: [HACKERS] drop before create in pg_dump

    Bruce Momjian <maillist@candle.pha.pa.us> — 1999-01-16T03:50:51Z

    > Brook Milligan <brook@trillium.NMSU.Edu> writes:
    > > pg_dump won't drop stuff before trying to create it; this makes
    > > dropping a single table (say) and recreating it difficult to automate
    > > since it is subject to error if all the stuff doesn't get dropped
    > > properly.  The following patch causes pg_dump to emit DROP ...
    > > statements prior to emitting CREATE ... statements.
    > 
    > I think that ought to be driven by a switch to pg_dump ...
    > much of the time, I would *want* pg_dump's script to fail
    > if there's already an existing item of the given name.
    > 
    > I see your concern, I just don't think it's the only scenario.
    
    I agree.  I don't like it removing stuff before creating it.  pg_dump
    already does a lot.  But I do agree it is difficult to automate
    destroy/create.
    
    
    -- 
      Bruce Momjian                        |  http://www.op.net/~candle
      maillist@candle.pha.pa.us            |  (610) 853-3000
      +  If your life is a hard drive,     |  830 Blythe Avenue
      +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
    
    
  3. Re: [HACKERS] drop before create in pg_dump

    Brook Milligan <brook@trillium.nmsu.edu> — 1999-01-17T22:11:47Z

       Brook Milligan <brook@trillium.NMSU.Edu> writes:
       > pg_dump won't drop stuff before trying to create it; this makes
       > dropping a single table (say) and recreating it difficult to automate
       > since it is subject to error if all the stuff doesn't get dropped
       > properly.  The following patch causes pg_dump to emit DROP ...
       > statements prior to emitting CREATE ... statements.
    
       I think that ought to be driven by a switch to pg_dump ...
       much of the time, I would *want* pg_dump's script to fail
       if there's already an existing item of the given name.
    
    A switch is fine.  Is there any concensus as to what it should be,
    since the two that come to mind (-D and -d) are both used?
    
    Cheers,
    Brook
    
    
  4. Re: [HACKERS] drop before create in pg_dump

    Bruce Momjian <maillist@candle.pha.pa.us> — 1999-01-18T04:51:14Z

    >    Brook Milligan <brook@trillium.NMSU.Edu> writes:
    >    > pg_dump won't drop stuff before trying to create it; this makes
    >    > dropping a single table (say) and recreating it difficult to automate
    >    > since it is subject to error if all the stuff doesn't get dropped
    >    > properly.  The following patch causes pg_dump to emit DROP ...
    >    > statements prior to emitting CREATE ... statements.
    > 
    >    I think that ought to be driven by a switch to pg_dump ...
    >    much of the time, I would *want* pg_dump's script to fail
    >    if there's already an existing item of the given name.
    > 
    > A switch is fine.  Is there any concensus as to what it should be,
    > since the two that come to mind (-D and -d) are both used?
    
    -c for clean.
    
    -- 
      Bruce Momjian                        |  http://www.op.net/~candle
      maillist@candle.pha.pa.us            |  (610) 853-3000
      +  If your life is a hard drive,     |  830 Blythe Avenue
      +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026