Personal tools
You are here: Home FAQ How to ... Install PostgreSQL & pgAdmin

Install PostgreSQL & pgAdmin

by Kuiyu Chang last modified Aug 25, 2008 04:42 PM

PostgreSQL has more SQL (SQL99) features than mySQL, and a more liberal license (see comparison) If your project needs to talk to a heavyweight DBMS, consider PostgreSQL.

  • Under Linux simply install the appropriate deb/rpm packages
  • Under windows, you could first install cygwin, then use cygwin setup tool to install the postgresql packages
  • Highly recommended: install one of the many GUI clients such as the open source pgAdmin (works for windows, linux, mac, etc.)
  • To access postgresql database from python, install PyGreSQL
    • On linux, simply install the pygresql package
    • On cygwin, you need to download openssl source, then modify your setup.py to include /usr/src/openssl/include, and install using distutils:
        python setup.py install
      
  • An underused feature of PostgreSQL is its ability to define functions in just about any language you like. Java, Perl, Python, TCL, among others, as well as PL/PGSQL. This is done using the plpython module that comes with postgresql. See example.
  • You are strongly recommended to use pgAdmin to access your postgresql db, using the psql terminal is too unproductive. To allow remote access to your postgresql instance, you need to add the following line to your /etc/postgresql/{versionnumber}/main/pg_hba.conf settings file and restart postgresql by typing as root /etc/init.d/postgresql restart. Any changes to pg_hba.conf will require a restart for the change to take place:
      host      all  all  155.69.140.125      255.255.255.255          trust
                          ^ replace 155.69.140.125 with your pgAdmin client IP address
    
  • To debug DB connections, you should do a listing of the file:
        tail /etc/postgresql/{versionnumber}/main/log/
    
Document Actions
« January 2009 »
January
MoTuWeThFrSaSu
1234
567891011
12131415161718
19202122232425
262728293031