[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PostgreSQL 6.4

Craig Sanders wrote:
  >i read in the postgresql 6.4 announcement yesterday that it includes a new
  >program called pg_upgrade.
  >    PostgreSQL 6.4               Mon Oct 26 11:40:42 EST 1998
  >    =========================================================
  >    A dump/restore is required for those wishing to migrate data
  >    from previous releases of PostgreSQL.  You may also use the new
  >    pg_upgrade utility to avoid a dump/reload.
  >have you tried this?  is it safe to use for an automated upgrade?
  >BTW, i have some non-critical postgresql servers if you need a guinea-pig
Yes, I did see this after answering the previous message.  I will recast
the update procedure to use it.

This is its man-page:
pg_upgrade(UNIX)            PostgreSQL           pg_upgrade(UNIX)

       pg_upgrade  - allows upgrade from a previous release with­
       out reloading data

       pg_upgrade [-f input_file] old_data_dir

       pg_upgrade is a utility  for  upgrading  from  a  previous
       PostgreSQL release without reloading all the data.  First,
       to be safe, back up your data directory.  Then, use:

            pg_dumpall -s -z >db.out

       to dump out your  old  database  definitions  without  any
       data.  Stop the postmaster and all backends.

       Then  rename  (using mv) your old pgsql /data directory to
       /data.old and do a make install to install the  new  bina­
       ries.   Run initdb to create a new template1 database con­
       taining the system tables for the new release.  Start  the
       new postmaster, cd to the pgsql main directory, and type:

            pg_upgrade -f db.out data.old

       The  system  will do some checking to make sure everything
       is properly configured, and run your db.out script to cre­
       ate  all  the  databases  and  tables you had, but with no
       data.  It will then move the  data  files  from  /data.old
       into  the  proper /data directory.  You can then check out
       the data.  You can delete the /data.old directory when you
       are finished.


The main problem will be if one is short of disk space, since this will
leave two copies of the database on the system. People with enormous
databases will still have to dump to tape.

Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
               PGP key from public servers; key ID 32B8FAA1
     "No man can serve two masters; for either he will 
      hate the one, and love the other; or else he will hold
      to the one, and despise the other.  Ye cannot serve 
      God and mammon."            Matthew 6:24 

Reply to: