Postgres on Ubuntu

31 Aug 2006 . . Comments

#Linux #Databases

I was setting my computer up for a database systems class I’m taking this semester. I got to the point of getting PostgreSQL 8.1, pgAdmin III, and the JDBC drivers installed, but I couldn’t figure out how to connect to the darn thing. I knew it created the account postgres, but since I was installing through apt-get, there wasn’t any point that I set the password.

I finally broke down and started reading the documentation (which is excellent by the way), but all of the documents about the initial configuration were on compiling from the sources. I finally got tired of clicking “Next” in the docbook files and stumbled across a post at hocuspok.us.

The step I was missing (and I’m sure I would have eventually found) was running:

$ sudo su postgres -c psql template1
template1=# ALTER USER postgres WITH PASSWORD '$password$';
template1=# \q

Even after just playing with this for a couple of hours, I’m seriosly thinking of changing my development DB from MySQL to PostgreSQL. Pretty impressive!