The department offers a PostgreSQL database account to anyone who has a computer science account for use with class related projects or their own personal projects. The database may be accessed via a command line application (psql) or through student created applications. The department does not automatically create a database account for everyone; instead each student must request a database account. This how-to describes how to request a database account and how to connect to the database via a command line application. This how-to does not describe how to connect your application to the database for information on how to do this consult the documentation for your platform (php, java, asp, .net, etc.) or your TA / Instructor.
After submitting the request it will take a day or two for it to be processed. Once it is processed you initial database password will be set to your student ID number.
There are several ways to connect to the PostgreSQL database. You may connect via a command line application which allows you to directly enter SQL queries or have your application connect to the database.
> psql -h database.cs.tamu.edu
|
Welcome to psql 7.4.1, the PostgreSQL interactive terminal.
|
From this prompt you may enter SQL queries to access the database. Remember to quit psql use the \q command.
Once you get your database account activated, one of the first things you will want to do is change the initial password to something more secure. To change your password first login as described above, and enter the following SQL query.
ALTER USER username WITH PASSWORD 'new_password';
|
An example of this would be "ALTER USER vkj6393 WITH PASSWORD 'a4tgk3c';"
If you forget your password or have any problem changing it, visit the helpdesk in room 210 for assistance.
For more information on how to use psql, the features of PostgreSQL, or general information about SQL visit these website.
The overall PostgreSQL documentation site.
The manual page for psql.
Several APIs to PostgreSQL including JDBC, libpq - C Library, and ECPG - Embedded SQL in C.
Monday - Friday:
7 am - Midnight
Saturday:
10 am - 7 pm
Sunday:
12 pm - Midnight
Hours subject to change during holidays, emergencies, and summer semester.