To dump a database of the same name as the user:
-% pg_dump > db.out
+$ pg_dump > db.out
To reload this database:
-% psql -e database < db.out
+$ psql -e database < db.out
To dump all databases:
-% pg_dumpall > db.out
+$ pg_dumpall > db.out
To reload this database:
-% psql -e template1 < db.out
+$ psql -e template1 < db.out
the new password for pg_guest:
- % pg_passwd passwd
+ $ pg_passwd passwd
Username: pg_guest
Password:
Re-enter password:
The following lines show the sample usage of the option:
-% psql -h hyalos -u unv
+$ psql -h hyalos -u unv
Username: pg_guest
Password:
Welcome to the POSTGRESQL interactive sql monitor:
Then do:
-% pg_dumpall -s >db.out
+$ pg_dumpall -s >db.out
to dump out your old database's table definitions without any data.
Do
-% make install
+$ make install
to install the new binaries.
Change your working directory to the
pgsql main directory, and type:
-% pg_upgrade -f db.out data.old
+$ pg_upgrade -f db.out data.old
The program will do some checking to make sure everything is properly
configured, and will run your db.out script to recreate all the databases
process already running on the same port number. The easiest way to
determine this is by using the command
-% ps -ax | grep postmaster
+$ ps -ax | grep postmaster
on BSD-based systems, or
-% ps -e | grep postmast
+$ ps -e | grep postmast
for System V-like or POSIX-compliant systems such as HP-UX.
should be used instead. Using
-% kill -KILL
+$ kill -KILL
or its alternative form
-% kill -9
+$ kill -9
values, type:
-% nohup postmaster >logfile 2>&1 &
+$ nohup postmaster >logfile 2>&1 &
This command will start up
postmaster
To start
postmaster with a specific port:
-% nohup postmaster -p 1234 &
+$ nohup postmaster -p 1234 &
This command will start up
postmaster
using psql, you would need to run it as
-% psql -p 1234
+$ psql -p 1234
or set the environment variable PGPORT:
-% setenv PGPORT 1234
-% psql
+$ setenv PGPORT 1234
+$ psql