Thread

  1. backup

    dubois <dubois@bol.com.br> — 2001-01-08T11:40:36Z

      Hi!
    
      I want to make a backup copy of a
    database...
    What I have to do?
    
      Do I have just to copy the directory
    at
    
    /var/lib/pgsql/base ?
    
      And to recover the database, I just
    have
    to unpack it again at 
    
    /var/lib/pgsql/base..
    
      Is that right?
    
      Thanks for any help...
    
      Regards,
    
      Andre'.
    
    
    -----------------------
    Andr Rauber Du Bois
    M.s.C. student at PPGC/UFRGS
    dubois@inf.ufrgs.br
    
     
    __________________________________________________________________________
    Compras com facilidade e segurana?
    ShoppingBOL
    http://shopping.bol.com.br
    
    
    
    
  2. Re: backup

    Tom Lane <tgl@sss.pgh.pa.us> — 2001-01-08T15:38:13Z

    "dubois"<dubois@bol.com.br> writes:
    >   I want to make a backup copy of a
    > database...
    > What I have to do?
    
    pg_dumpall is the recommended answer.
    
    >   Do I have just to copy the directory
    > at
    > /var/lib/pgsql/base ?
    
    This is NOT sufficient.
    
    Copying the entire $PGDATA directory (not only the base/ subdirectory)
    is sufficient, if and only if the database is completely idle while you
    do it --- I'd recommend stopping the postmaster to be sure.  Otherwise
    you will get inconsistent files.  In particular, you WILL have problems
    if $PGDATA/pg_log is out of sync with any table data file.
    
    			regards, tom lane
    
    
  3. Re: backup

    Anthony E . Greene <agreene@pobox.com> — 2001-01-08T23:12:40Z

    On Mon, 08 Jan 2001 10:38:13 Tom Lane wrote:
    >Copying the entire $PGDATA directory (not only the base/ subdirectory)
    >is sufficient, if and only if the database is completely idle while you
    >do it --- I'd recommend stopping the postmaster to be sure.  Otherwise
    >you will get inconsistent files.  In particular, you WILL have problems
    >if $PGDATA/pg_log is out of sync with any table data file.
    
    You will also need to insure that the version of PostgreSQL used in the
    recovery process is that same as that used before the failure. The binary
    files are not completely portable across versions.
    
    -- 
    Anthony E. Greene <agreene@pobox.com> <http://www.pobox.com/~agreene/>
    PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
    Chat:  AOL/Yahoo: TonyG05    ICQ: 91183266
    Linux. The choice of a GNU Generation. <http://www.linux.org/>