Website:Postgres

=PostgreSQL=

UGCS runs a PostgreSQL version 8.2 database server for its users on poseidon. Each user has a database with the same name as their username, and can log in with their Kerberos tokens. The database is also accessible from any PHP or CGI scripts. If you absolutely need a MySQL database, contact us. We will only consider requests for MySQL databases that have a substantial technical reason for using MySQL over Postgres.

To log in to your database from any UGCS computer, run: user@to:~$ psql -h postgres Postgres will automatically use your Kerberos tokens to log you in.

How to connect from PHP
To connect to the database from a PHP script, use  with a blank URI. The default username, host, and database will work, and you will be authenticated with the kerberos token that your cgi script has.

Using PHP's pgsql extension: $result = pg_connect("host=postgres user= _cgi dbname= ") or die('Could not connect to database: ' . pg_last_error);

Using Pear::MDB2 require_once 'MDB2.php' $mdb2 =& MDB2::connect('pgsql:// _cgi@postgres/ ');