P OSTGRE SQL

manlybluegooseData Management

Nov 27, 2012 (4 years and 9 months ago)

266 views

I
NTRODUCTION TO
P
OSTGRE
SQL
This practical lab is designed to walk you through the user interface of our PostgreSQL database.
Please follow the steps given and ask your tutor if there is anything you don’t understand,
1.1 Connecting to the PostgreSQL Server
To log on to our database server, you have to start its front-end application called
pgAdmin III

You find this program in the Windows start menu at:
Start  Programs  pgAdmin III 1.12  pgAdmin III
There is also a shortcut icon for
pgAdmin
on the task bar.
You now see pgAdmin’s main window:
Note:
the following step is only required the first time you log in to our server!
Select the ‘New Server Registration...’ icon on the left corner of the pgAdmin window. The
following requester will open, into which you have to provide the connection details for
your account:
INFO2120/2820, Lab
ONE
Please use your
SIT login name
instead of ‘abcd9999’
1.2 Opening the SQL Editor
After you have started
pgAdmin
and connected to our database server, you can start running SQL
commands on your database.
1.
First you have to select your own database on the ‘Object Browser’ on the left hand side.
This is again only needed the first time you log in - if you ticked the ‘Restore env?’ option on above’s
registration window, then pgAdmin will automatically remember your settings whenever you start it.
2.
After you have selected your own database, you can start the SQL editor:
Note:
You can only open the SQL editor when your own database is selected!
3. Finally the actual SQL editor opens:
INFO2120/2820, Lab
ONE