How to install pgsql on Solaris 10

1) Check out the OS version and architecture, such as:

bash-3.00# cat /etc/release
Solaris 10 5/08 s10s_u5wos_10 SPARC
bash-3.00# isainfo -b
64

2) Although it's not hard to build code from scratch, it's much easier to download the pre-build version. Say for this SunOS, the URL would be:
http://wwwmaster.postgresql.org/download/mirrors-ftp/binary/v9.0.4/solaris/solaris10/sparc/postgresql-9.0.4-S10.sparc-64.tar.bz2

3) Unzip the binaries at the aimed INSTALL_DIR:
bunzip2 < postgresql-9.0.4-S10.sparc-64.tar.bz2 | tar xpf -

4) For Solaris, the buildin version will be 8.1, to override it, set PATH env to INSTALL_DIR/postgres/9.0-pgdg/64/bin before /usr/bin

5) $ Init the data folder:
pg_ctl -D /usr/local/pgsql/data initdb

6) The default sa would be postgres with a NULl passwd

7) Start db:
pg_ctl start -l logfile

7) Creating a db using command:
createdb test

8) The default port used is 5432, now the server will be ready to accept connnections

9) Backup & Restore:
pg_dump -Ft mydb -f db.tar
pg_restore pg_restore -d newdb db.tar

你可能感兴趣的:(Solaris,OS,bash,PostgreSQL)