Thread

  1. editing file after pg_dump

    Kevin Heflin <kheflin@shreve.net> — 1999-03-18T19:27:54Z

    I've run pg_dump on a database, which I've done many times before, to
    backup and then restore databases.
    
    However, this time before I restore the database, I'm wanting to edit one
    of the datatypes before I restore the data. As soon as I open up the file
    then save it, regardless of actually making any changes.. the restore will
    fail whenever it gets to the point of inserting the data.
    
    I'm guessing it's choking because whatever text editor I'm using is hosing
    the fields with long entries... I've tried opening the file with vi, pico,
    and Homesite on a WindowsNT box..
    
    Any suggestions on how to get around this?
    
    
    Kevin
    
    
    
    
    --------------------------------------------------------------------
    Kevin Heflin          | ShreveNet, Inc.      | Ph:318.222.2638 x103
    VP/Mac Tech           | 333 Texas St #619    | FAX:318.221.6612
    kheflin@shreve.net    | Shreveport, LA 71101 | http://www.shreve.net
    --------------------------------------------------------------------
    
    
    
  2. Re: [GENERAL] editing file after pg_dump

    Kevin Heflin <kheflin@shreve.net> — 1999-03-18T19:52:23Z

    On Thu, 18 Mar 1999, Ross J. Reedstrom wrote:
    
    > you might try dumping the schema and data separately:
    > 
    > pg_dump -a yourdb >yourdb.data
    > pg_dump -s yourdb >yourdb.schema
    > 
    > then edit the schema without touching the data, then
    > 
    > psql newdb <yourdb.schema
    > psql newdb <yourdb.data
    > 
    
    Thanks for the tip.. I'll try that.
    
    
    Kevin
    
    
    
    --------------------------------------------------------------------
    Kevin Heflin          | ShreveNet, Inc.      | Ph:318.222.2638 x103
    VP/Mac Tech           | 333 Texas St #619    | FAX:318.221.6612
    kheflin@shreve.net    | Shreveport, LA 71101 | http://www.shreve.net
    --------------------------------------------------------------------
    
    
    
  3. Re: [GENERAL] editing file after pg_dump

    Ross Reedstrom <reedstrm@rice.edu> — 1999-03-18T19:56:32Z

    Kevin Heflin wrote:
    > 
    > I've run pg_dump on a database, which I've done many times before, to
    > backup and then restore databases.
    > 
    > However, this time before I restore the database, I'm wanting to edit one
    > of the datatypes before I restore the data. As soon as I open up the file
    > then save it, regardless of actually making any changes.. the restore will
    > fail whenever it gets to the point of inserting the data.
    > 
    > I'm guessing it's choking because whatever text editor I'm using is hosing
    > the fields with long entries... I've tried opening the file with vi, pico,
    > and Homesite on a WindowsNT box..
    > 
    > Any suggestions on how to get around this?
    
    you might try dumping the schema and data separately:
    
    pg_dump -a yourdb >yourdb.data
    pg_dump -s yourdb >yourdb.schema
    
    then edit the schema without touching the data, then
    
    psql newdb <yourdb.schema
    psql newdb <yourdb.data
    
    
    For speed, you may want to split the schema where the indeces are
    created, and run that after the data load.
    
    psql newdb <yourdb.schema.tables
    psql newdb <yourdb.data
    psql newdb <yourdb.schema.indices
    
    
    HTH,
    
    Ross
    -- 
    Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
    NSBRI Research Scientist/Programmer
    Computer and Information Technology Institute
    Rice University, 6100 S. Main St.,  Houston, TX 77005
    
    
  4. FATAL 1:btree: BTP_CHAIN flag was expected (vacuum command)

    Jay W. Summet <jay@summet.com> — 1999-03-25T07:55:42Z

    When I try to vacuum, or vacuum analyze my database, I get the 
    following error:
    FATAL 1:btree: BTP_CHAIN flag was expected
    
    I've tried the following two commands:
    /usr/local/pgsql/bin/psql -c "vacuum analyze;" billing
    and
    /usr/local/pgsql/bin/psql -c "vacuum;" billing
    
    The top command used to work (for the last few years), so I assume 
    that something has changed with my data. Otherwise, the database 
    appears to be working ok.
    
    Any pointers? I'm thinking about dumping all the data and 
    re-inserting it...
    Jay Summet
    
    
  5. Re: [GENERAL] FATAL 1:btree: BTP_CHAIN flag was expected (vacuum command)

    Marc G. Fournier <scrappy@hub.org> — 1999-03-26T03:35:51Z

    On Thu, 25 Mar 1999, Jay W. Summet wrote:
    
    > When I try to vacuum, or vacuum analyze my database, I get the 
    > following error:
    > FATAL 1:btree: BTP_CHAIN flag was expected
    > 
    > I've tried the following two commands:
    > /usr/local/pgsql/bin/psql -c "vacuum analyze;" billing
    > and
    > /usr/local/pgsql/bin/psql -c "vacuum;" billing
    > 
    > The top command used to work (for the last few years), so I assume 
    > that something has changed with my data. Otherwise, the database 
    > appears to be working ok.
    > 
    > Any pointers? I'm thinking about dumping all the data and 
    > re-inserting it...
    
    Try just drop'ng and rebuilding your indices...
    
    Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
    Systems Administrator @ hub.org 
    primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org