port mysql_example to PostgreSQL

I ported the SQL in mysql_example to use PortgreSQL for an example of large datasets using that database.