In order to access PostgreSQL, you will need to create an account with the
DBMS itself. Using this form you can
select a database username and password for PostgreSQL access. Please be
aware that PostgreSQL accounts are generally valid for particular classes
only and may deleted at the end of any given semester
without additional notice. In other words, do not assume your PostgreSQL
account will continue to exist for any length of time beyond a given
semester.

I have installed a
web-based portal
for accessing the databases on my server. You can log in using the
database account you created per the instructions above.

PostgreSQL provides a command-line client interface - psql
You can use this on most any system that has the PostgreSQL client
tools installed.
However, you may find one of the GUI-clients easier
to use - see section on Usefull Tools below.

Here is a quick tutorial on using the
PostgreSQL DBMS via the command-line interface
that should be sufficient to get you started. Note that the
commands and SQL shown below can be entered into most any
client, command-line or GUI.

The easiest way to access PostgreSQL databases is via
the interactive SQL command-line client program called
psql

$ psql -U dhansen -h dhansen.cs.georgefox.edu company

at the
command prompt (Note: you need to provide different valuus for the username,
database name, and hostname depending on who you are and where the PostgreSQL
server is running).

To learn the full syntax of the psql command, use the
--help flag when you execute the program:

psql is a simple, interactive SQL front-end to PostgreSQL.
You type SQL statements (use as many lines as you want), end them
with either \g or a semi-colon (;), and PostgreSQL executes
the query and the results are displayed by psql.

To quit a psql session type \q.

You can get help on psql commands with the \?
command, and you can get help on SQL by typing
\h.

Note that you can not destroy a database you're currently working with.
You can use the \c dbname command to change the database
you are working with (you can always set your current database to the
pre-existing template1 database initially, until you
create your own database).

A PostgreSQL database can be accessed by programs written in a number
of languages including C/C++, Java, PHP, PERL, etc. An
ODBC (open-database connectivity) interface is also
available. The ODBC and JDBC
interfaces should be useable from a variety of computer systems.
Below are links to relevant resources. These interfaces may prove
useful to you for implementing application programs to load and access
a database.

PostgreSQL JDBC "jar" file - you
should be able to download the appropriate jarfile and use it with most any Java
development environment; make sure you download a version
compatible with the versions of PostgreSQL and Java.

JDBC Access

For an example of how to access PostgreSQL using JDBC, see
this Java program. With both this program
and the JDBC ".jar" file in the same directory (assuming you saved the
jarfile as postgresql.jar and that it is located in the
same directory as JDBCExample.java), you should be able to
execute this program with:

$ java -cp .:postgresql.jar JDBCExample

or

C:\> java -cp .;postgresql.jar JDBCExample

for Windows (note the use of the ';' character in the classpath)

When using Windows, you may also need to specify the entire path to
the java and javac executables.

PHP Access

For an example of how to access PostgreSQL using PHP, run
this PHP script whose source can be viewed here.

Note that these programs and scripts include a database username
and password! Protection of source-code is vital when your code includes
authentication information.

The data model of PostgreSQL is an extended-relational or
object-relational model that includes classes, inheritance,
behavior, rules, etc. Since the data model is a super-set
of the relational model, it should suffice for our purposes.
Be aware that PostgreSQL documentation sometimes
uses the term class instead of table or
relation. For our purposes the terms are synonymous.
For my courses, please do not use any of the
PostgreSQL-specific modeling constructs (e.g., multi-valued
attributes, inheritance, classes).

SQL Syntax & Semantics

PostgreSQL has recently been upgraded and now provides a
close approximation to the SQL92 standard. The
SQL documentation
provided with PostgreSQL is quite good and is careful to note
when PostgreSQL deviates from the SQL92 standard and which
features are not yet implemented. For the most part, most
SQL described in any text should be accepted by
PostgreSQL.