PostgreSQL

mikeryan's picture

I'm doing my first project using PostgreSQL (I've always used MySQL in the past). Hints, tips, etc.:

First, I found a Mac OS X binary. At this writing the version of PostgreSQL is 8.2.3. The instructions say it is only tested on Mac OS X 10.4 (Tiger), but it works fine for me on 10.5 (Leopard).

To access a database from a shell:

psql -U username -h localhost -d databasename

To export a database to SQL, for loading onto another pgsql server:

pg_dump -C -O -h localhost -U username databasename >filename

To import from an export performed as above (I expected to use pg_restore, but no...)

psql -h localhost -U username -f filename