From FreeBSDwiki
Revision as of 02:16, 18 July 2005 by Smortex (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PostgreSQL is an open source object-relationnal database management system released under the terms of the BSD licence. It is based on postgres, developped at the University of California at Berkeley Computer Science Department (Juste like BSD). It features many stuff MySQL lacks, such as transactional integrity or complex queries.



You can choose to install PostgreSQL from the port tree...


... or the packages ...

pkg_add -r postgresql80-client postgresql80-server

Additionnaly, you may want to install postgresql support to PHP. Depending on your PHP version, install :

# or

(You can also install it from packages)

Configuring PostgreSQL

Creating a cluster

What is called cluster in PostgreSQL is the database disk area. The first step is to enable PostgreSQL, witch is done in /etc/rc.conf : add the following line at the end :


Then, run :

/usr/local/etc/rc.d/ initdb

If everything is good, you can now start PostgreSQL :

/usr/local/etc/rc.d/ start

Creating databases

There are two ways to create databases :

  • The createdb command (in a shell).
  • The CREATE DATABASE query.

I will explain this latter .... --Smortex 02:16, 18 Jul 2005 (EDT)

Creating users

There are two ways to create users :

  • The createuser command (in a shell).
  • The CREATE USER query.

I will explain this latter .... --Smortex 02:16, 18 Jul 2005 (EDT)

PostgreSQL Website

Personal tools