Development with PostgreSQL databases

From Earlham CS Department
Revision as of 12:28, 3 September 2019 by Craigje (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

We have some datasets that we use for development of various kinds - visualizations, research, presentations, webpages, and so forth. Our preferred database flavor for this is PostgreSQL, an open-source relational database system. We run an instance at the following host:

bowie.cs.earlham.edu

Use port 5432 (the firewall will block any attempt to connect to any other port on this server) and a PostgreSQL user account to get in and begin making queries.

This page should help you use those databases as part of backend development.

Authenticating

VERY IMPORTANT SECURITY NOTE

Do not hardcode your username and password into source code. Full stop. Instead read from an external file. Do not place this external file under version control, do not post it to any website (do not pass "Go", do not collect $200...).

How to actually do it

Most languages have a PostgreSQL library (e.g. psycopg2 in Python). Check its documentation.

If you do not already have a user account, email the admins and ask for one to be created for you (or your group).