Documentation:Postgres

From UGCS
Revision as of 07:05, 28 September 2009 by Jdhutchin@ugcs.caltech.edu (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Postgres

UGCS provides a Postgres database for each user. We currently run Postgres 8.3.

To use a database, you must first create it by running

setup_postgres

on any of the shell servers.

You can access your database through the command line on a shellserver our through scripts running on the webserver. For security, we only support kerberos authentication, so no password is necessary.

From a shellserver:

psql -h postgres 

From PHP:

$conn = pg_connect("dbname=<username> host=postgres user=<username>_cgi");
$db2 = MDB2::connect("psql://<username>_cgi@postgres/<username>")

If you are having difficulty connecting, make sure that your program is not trying to use a blank password. Many popular applications require a quick patch to work correctly; contact us if you need assistance.

See Also

Personal tools