Differences between revisions 20 and 21
Revision 20 as of 2009-07-19 13:01:25
Size: 3475
Editor: ?MartinPitt
Comment:
Revision 21 as of 2010-04-14 22:34:59
Size: 3529
Editor: ?PaulBoddie
Comment: Attempt to fix/update links, syntax.
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
Required packages: postgresql postgresql-client <<BR>>
`# aptitude install postgresql postgresql-client`
Required packages: postgresql postgresql-client

{{{
# aptitude install postgresql postgresql-client
}}}
Line 11: Line 14:
Please note that the procedural languages are installed separately (plpgsql comes by default). Perform search packaging database to find the list of possibilities:<<BR>>
`
# aptitude search postgresql`
Please note that the procedural languages are installed separately (plpgsql comes by default). Perform search packaging database to find the list of possibilities:

{{{
# aptitude search postgresql
}}}
Line 30: Line 36:
Log files: Installing PostgreSQL creates log directory `/var/log/posgresql/`. Starting the database engine creates log file with name `postgresql-[version]-[cluster].log`. Log files: Installing PostgreSQL creates log directory `/var/log/postgresql/`. Starting the database engine creates log file with name `postgresql-[version]-[cluster].log`.
Line 35: Line 41:
 1. `pg_dropcluster` ''version'' `main --stop`
 1. Run the initdb with your options: `pg_createcluster --locale de_DE.UTF-8` ''version'' `main --start`
 1. Run the following command:
 {{{
pg_dropcluster --stop <version> main
 }}}
 For example:
 {{{
pg_dropcluster --stop 8.3 main
 }}}
 1. Run the initdb with your options. For example:
 {{{
pg_createcluster --locale de_DE.UTF-8 --start 8.3 main
 }}}
Line 38: Line 54:
'''Note'''! The previous operation obviously deletes everything you had in cluster databases. Perform this operation right after you have installed the base package. Check the PostgreSQL manual if you need to change locale for existing database (it is not trivial operation). {{{#!wiki warning
'''Warning!'''

The previous operation obviously deletes everything you had in cluster databases. Perform this operation right after you have installed the base package. Check the PostgreSQL manual if you need to change locale for an existing database (it is not a trivial operation).
}}}
Line 47: Line 67:
 * http://techdocs.postgresql.org/guides/["GUITools"]
 * [[http://znik.wbc.lublin.pl/cgi-bin/dwww?type=file&location=%2fusr%2fshare%2fdoc%2fpostgresql%2ddoc%2fhtml%2findex%2ehtml|["PosgreSQL"]] documentation].
 * [[PostgreSQL|PostgreSQL]] http://www.commandprompt.com/ppbook/ Practical].
 * http://wiki.postgresql.org/wiki/GUI_Database_Design_Tools
 * http://wiki.postgresql.org/wiki/Community_Guide_to_PostgreSQL_GUI_Tools
 * [[http://www.commandprompt.com/ppbook/|Practical PostgreSQL]]
Line 52: Line 72:
 * [[GNOME-DB|GNOME-DB]]  * [[GNOME-DB]]

PostgreSQL has extensive and good help that should be the first source of information regarding this database product. This page outlines main differences to generic PostgreSQL installation used by Debian.


Installation

Required packages: postgresql postgresql-client

# aptitude install postgresql postgresql-client

Recommended packages:

  • postgresql-doc - PostgreSQL documentation.
  • pgadmin3 - PostgreSQL administration GUI.

Please note that the procedural languages are installed separately (plpgsql comes by default). Perform search packaging database to find the list of possibilities:

# aptitude search postgresql

Documentation

To get an overview about Debian's PostgreSQL architecture, instructions for a quick start, and pointers to the programs and manpages, have a look at /usr/share/doc/postgresql-common/README.Debian.gz.

pg_ctl replacement

pg_ctl is a PostgreSQL command line control program that can be used to control the database. Debian has made a Perl-wrapper for the pg_ctl called /usr/bin/pg_ctlcluster. Use the pg_ctlcluster whenever you need the pg_ctl. To customize the behavior check the /etc/postgresql/[version]/[cluster]/pg_ctl.conf

Debian installs SysV-init compatible (standard) start-up script /etc/init.d/postgresql-[version]. It can be used to start and stop the system as well. It calls pg_ctlcluster internally.

File locations

Debian splits the database configuration from the database files, opposed to generic PostgreSQL installation that puts everything under same directory. Note that Debian allows multiple clusters and even different versions of PostgreSQL to co-exist in same host.

Configuration files: /etc/postgresql/[version]/[cluster]/
Binaries: /usr/lib/postgresql/[version]
Data files: /var/lib/postgresql/[version]/[cluster]

Log files: Installing PostgreSQL creates log directory /var/log/postgresql/. Starting the database engine creates log file with name postgresql-[version]-[cluster].log.

Changing Debian default installation

Debian PostgreSQL installation automatically calls the initdb i.e. it initializes the cluster with default encoding and locale. Encoding can be changed later but the locale cannot. To change the locale (an possibly other options in initdb), delete the existing default cluster and create a new one:

  1. Take root privileges.
  2. Run the following command:
    pg_dropcluster --stop <version> main
    For example:
    pg_dropcluster --stop 8.3 main
  3. Run the initdb with your options. For example:
    pg_createcluster --locale de_DE.UTF-8 --start 8.3 main

Warning!

The previous operation obviously deletes everything you had in cluster databases. Perform this operation right after you have installed the base package. Check the PostgreSQL manual if you need to change locale for an existing database (it is not a trivial operation).

Check the Locale page to see how to add more locales.


See: