postgresql for DEBIAN ---------------------- PostgreSQL is the successor to Postgres95, which in turn succeeded POSTGRES. PostgreSQL is a relational database with object-oriented extensions. It implements the greater part of SQL-92 and is intended to implement it in full; in addition it supports its own extended facilities. Most of the documentation is in the separate package postgresql-doc. TAKE SPECIAL NOTE of the instructions in README.Debian.migration (/usr/share/doc/postgresql/README.Debian.migration.gz) about upgrading your PostgreSQL system to a later version. Failure to do so could destroy your data!!! Version 7.1 was released upstream in April 2001. Configuration ============= Configuration of the backend is done by editing the configuration files /etc/postgresql/postmaster.conf and /etc/postgresql/postgresql.conf. The environment for the postgres user is automatically set up to include /etc/postgresql/postgresql.env; this file can be modified to set the value of PGHOST, for example. Database access control ======================= Access control is first of all governed by whether the postmaster uses the -i option (which allows TCP/IP connections). If this option is not used, only Unix socket connections are used, which limits access to processes running on the same machine. Next, the configuration file /etc/postgresql/pg_hba.conf allows a finer-grained control of access by user and by host. As of 7.1release-3, the default access policy for the Debian packages is that users connecting through Unix sockets are authenticated against their Unix login names. (That is, they can connect to PostgreSQL only with names that match their Unix login names.) Kerberos authorisation is not compiled into this release. + Speed ===== To give the maximum possible assurance of data integrity, PostgreSQL, by default, does an fsync() after some write operation This has an adverse effect on performance. If you consider that you can rely on the operating system's regular sync, you can disable PostgreSQL's fsync and achieve an increase in throughput. The speed difference is considerably less in 7.1 than in earlier releases and so you may well not consider it worthwhile to disable fsync() calls. To disable fsync(), set FSYNC to `off' in /etc/postgresql/postmaster.conf. In Debian, this option is on by default. Debian-specific features ======================== There are certain differences between the Debian version of PostgreSQL and the upstream version. There are two reasons for this. First, because Debian policy requires certain things to be done in a manner different from that used by the upstream developers, and second, because I perceive a difference between a piece of software that is put onto a machine by an ordinary user and one that is installed, as part of a distribution, by the system administrator. 1. Environment variables: Debian forbids packages to depend on users' setting environment variables. For this reason, certain front-end programs, especially psql, are run through a wrapper that sets up the environment. 2. Default database: the upstream version defaults to a database whose name is the same as the name of the PostgreSQL user who is trying to access it. I do not think this is appropriate to a distribution, so in Debian, the database must be specified on the command line or in the environment variable PGDATABASE. 3. Initialising the postmaster: the upstream version uses a program called pg_ctl, that was introduced at release 7.0, to start up and stop the postmaster. I do not feel that this sits very comfortably with Debian's way of starting backend processes, so I have continued to use the procedure I developed for previous versions, whereby /etc/init.d/postgresql calls postgresql-startup or start-stop-daemon. I will be borrowing nice features from pg_ctl to incorporate in the init.d script. 4. Initial environment: Debian stores its setup files in /etc/postgresql. These files are postmaster.conf, pg_hba.conf and postgresql.env, and any files referenced by pg_hba.conf. They are self-documented, so you are advised to leave the coments alone if you edit them. Where necessary, there are symbolic links to the locations where the upstream code expects to find them. 5. Location of socket: in previous versions the socket file was located in /tmp/. It has now been moved to /var/run/postgresql/ so as to avoid problems with packages such as tmpreaper and to be more consistent with Debian policy. This location can be altered by setting UNIX_SOCKET_DIRECTORY in postgresql.conf. 6. Unix socket authentication is provided (authentication type "peer"). This works just like ident, but for Unix sockets; this provides a more secure method of authentication than ident, and does not require administrators to run identd on their servers. This authentication method has been submitted to the upstream developers, but is not currently part of the upstream release.