Using PostgreSQL at IMADAIn DM26, we will be using the relational database system PostgreSQL. This note explains how to connect to the system at IMADA.
dbhost
The PostgreSQL system resides on the machine
This assumes you are already logged into some other IMADA machine
(which itself can be done using ssh from e.g. a machine at home
(
If you are using
The PostgreSQL System
The system is composed of a database server part (the program
The PostgreSQL system has it own set of usernames and passwords, which are unrelated to the usernames and passwords of IMADA accounts. For all participants with an existing IMADA account, an PostgreSQL account has been created, with the same username as their IMADA account, and with a password which has been mailed to them. If you do not yet have an IMADA account, contact staff in order to get one, and then contact the lecturer for PostgreSQL account creation. If you have an account, but are unable to connect, contact the lecturer.
Creating Databases
Your first action should be to create a database. Each database is a
collection (empty at the beginning) of relations. You can create a new
database with the name
If the command Databases can be destroyed again using the command
Again, you may need to set your
Using DatabasesWhen using PostgreSQL, you connect to one database at a time. Your start a connection to a database by
This will put you in interactive mode, which allows you to define relations, insert tuples, and make queries by issuing SQL commands at the prompt.
Beside SQL commands,
Alternatively, input and output files can be specified when starting
Setting your PATH variable
If your shell is not able to find the PostgreSQL commands
If your are using
to the file
If your are using
to the file
Further InformationHere is a list of easy SQL examples (ps, pdf).
PostgreSQL comes with ample
documentation. See for
instance the
SQL
description and the
refence
section (including the
man
page of
Maintained by Rolf Fagerberg (rolf@imada.sdu.dk) | |