Saturday, November 22, 2008

How To Install PostgreSQL 8.1.4

11/22/2008 05:08:00 PM |

The PostgreSQL Team has released a security patch update

BEFORE YOU DO ANYTHING please read :

8.1.4 et. al. Security Release FAQ
PLEASE READ THE FAQ

Step 1 - You need “pkg-get”

You need a recent edition of Blastwave software tools, like the common package and pkg-get itself.

Please see the Blastwave HOWTO if you do not have pkg-get installed.


Step 2 - Install or Upgrade to the PostgreSQL 8.1.4 Software

If you already have PostgreSQL 8.1.3 installed or an earlier release :

# /opt/csw/bin/pkg-get -U # /opt/csw/bin/pkg-get -u postgresql


If you are installing PostgreSQL 8.1.4 with no previous edition :

# /opt/csw/bin/pkg-get -U # /opt/csw/bin/pkg-get -i postgresql


Step 3 - Perform some initial setup

A script is provided with the package to allow you to easily initialize the PostgreSQL 8.1.4 software thus :

bash-3.1# /etc/init.d/cswpostgres init
Creating PostgreSQL data directory at /opt/csw/var/pgdata...
Initialising PostgreSQL database...

WARNING: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the -A option the next time you run initdb.

bash-3.1# /etc/init.d/cswpostgres start Starting PostgreSQL...
postmaster starting


Now you may “su” to the newly created postgres user account :

bash-3.1# su - postgres Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$ /opt/csw/postgresql/bin/psql
Welcome to psql 8.1.4, the PostgreSQL interactive terminal.

Type:
\copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

postgres=# \?
General
\c[onnect] [DBNAME|- [USER]]
connect to new database (currently "postgres")
\cd [DIR] change the current working directory
\copyright show PostgreSQL usage and distribution terms
\encoding [ENCODING] show or set client encoding
\h [NAME] help on syntax of SQL commands, * for all commands
\q quit psql
\set [NAME [VALUE]] set internal variable, or list all if no parameters
\timing toggle timing of commands (currently off)
\unset NAME unset (delete) internal variable
\! [COMMAND] execute command in shell or start interactive shell

Query Buffer
\e [FILE] edit the query buffer (or file) with external editor
\g [FILE] send query buffer to server (and results to file or |pipe)
\p show the contents of the query buffer
\r reset (clear) the query buffer
\s [FILE] display history or save it to file
\w FILE write query buffer to file Input/Output
\echo [STRING] write string to standard output
\i FILE execute commands from file
\o [FILE] send all query results to file or |pipe
\qecho [STRING] write string to query output stream (see \o)

Informational
\d [NAME] describe table, index, sequence, or view
\d{t|i|s|v|S} [PATTERN] (add "+" for more detail) list tables/indexes/sequences/views/system tables \da [PATTERN] list aggregate functions
\db [PATTERN] list tablespaces (add "+" for more detail)
\dc [PATTERN] list conversions
\dC list casts
\dd [PATTERN] show comment for object
\dD [PATTERN] list domains
\df [PATTERN] list functions (add "+" for more detail)
\dg [PATTERN] list groups
\dn [PATTERN] list schemas (add "+" for more detail)
\do [NAME] list operators
\dl list large objects, same as
\lo_list
\dp [PATTERN] list table, view, and sequence access privileges
\dT [PATTERN] list data types (add "+" for more detail)
\du [PATTERN] list users
\l list all databases (add "+" for more detail)
\z [PATTERN] list table, view, and sequence access privileges (same as \dp)

Formatting
\a toggle between unaligned and aligned output mode
\C [STRING] set table title, or unset if none
\f [STRING] show or set field separator for unaligned query output
\H toggle HTML output mode (currently off)
\pset NAME [VALUE] set table output option (NAME := {format|border|expanded|fieldsep|footer|null| numericlocale|recordsep|tuples_only|title|tableattr|pager})
\t show only rows (currently off)
\T [STRING] set HTML <table> tag attributes, or unset if none
\x toggle expanded output (currently off) Copy, Large Object
\copy ... perform SQL COPY with data stream to the client host
\lo_export LOBOID FILE \lo_import FILE [COMMENT]
\lo_list
\lo_unlink LOBOID large object operations

postgres=# \dS
List of relations

Schema | Name | Type | Owner
------------+--------------------------+-------+----------
pg_catalog | pg_aggregate | table | postgres
pg_catalog | pg_am | table | postgres
pg_catalog | pg_amop | table| postgres
pg_catalog | pg_amproc | table | postgres
pg_catalog | pg_attrdef | table | postgres
pg_catalog | pg_attribute | table | postgres
pg_catalog | pg_auth_members | table | postgres
pg_catalog | pg_authid | table | postgres
pg_catalog | pg_autovacuum | table | postgres
pg_catalog | pg_cast | table | postgres
pg_catalog | pg_class | table | postgres
pg_catalog | pg_constraint | table | postgres
pg_catalog | pg_conversion | table | postgres
pg_catalog | pg_database | table | postgres
pg_catalog | pg_depend | table | postgres
pg_catalog | pg_description | table | postgres
pg_catalog | pg_group | view | postgres
pg_catalog | pg_index | table | postgres
pg_catalog | pg_indexes | view | postgres
pg_catalog | pg_inherits | table | postgres
pg_catalog | pg_language | table | postgres
pg_catalog | pg_largeobject | table | postgres
pg_catalog | pg_listener | table | postgres
pg_catalog | pg_locks | view | postgres
pg_catalog | pg_namespace | table | postgres
pg_catalog | pg_opclass | table | postgres
pg_catalog | pg_operator | table | postgres
pg_catalog | pg_pltemplate | table | postgres
pg_catalog | pg_prepared_xacts | view | postgres
pg_catalog | pg_proc | table | postgres
pg_catalog | pg_rewrite | table | postgres
pg_catalog | pg_roles | view | postgres
pg_catalog | pg_rules | view | postgres
pg_catalog | pg_settings | view | postgres
pg_catalog | pg_shadow | view | postgres
pg_catalog | pg_shdepend | table | postgres
pg_catalog | pg_stat_activity | view | postgres
pg_catalog | pg_stat_all_indexes | view | postgres
pg_catalog | pg_stat_all_tables | view | postgres
pg_catalog | pg_stat_database | view | postgres
pg_catalog | pg_stat_sys_indexes | view | postgres
pg_catalog | pg_stat_sys_tables | view | postgres
pg_catalog | pg_stat_user_indexes | view | postgres
pg_catalog | pg_stat_user_tables | view | postgres
pg_catalog | pg_statio_all_indexes | view | postgres
pg_catalog | pg_statio_all_sequences | view | postgres
pg_catalog | pg_statio_all_tables | view | postgres
pg_catalog | pg_statio_sys_indexes | view | postgres
pg_catalog | pg_statio_sys_sequences | view | postgres
pg_catalog | pg_statio_sys_tables | view | postgres
pg_catalog | pg_statio_user_indexes | view | postgres
pg_catalog | pg_statio_user_sequences | view | postgres
pg_catalog | pg_statio_user_tables | view | postgres
pg_catalog | pg_statistic | table | postgres
pg_catalog | pg_stats | view | postgres
pg_catalog | pg_tables | view | postgres
pg_catalog | pg_tablespace | table | postgres
pg_catalog | pg_trigger | table | postgres
pg_catalog | pg_type | table | postgres
pg_catalog | pg_user | view | postgres
pg_catalog | pg_views | view | postgres

(61 rows)
postgres=# \l+
List of databases
Name | Owner | Encoding | Description
-----------+----------+-----------+---------------------------
postgres | postgres | SQL_ASCII |
template0 | postgres | SQL_ASCII |
template1 | postgres | SQL_ASCII | Default template database

(3 rows)

postgres=#

AddThis Feed Button
Bookmark and Share

You Might Also Like :


0 comments: