Generating a UUID in Postgres for Insert statement?
The answer by Craig Ringer is correct. Here's a little more info for Postgres 9.1 and later... You can only install an extension if it has already been built for your Postgres installation (your cluster in Postgres lingo). For example, I found the uuid-ossp extension included as part of the installer for Mac OS X kindly provided by EnterpriseDB.com.
https://stackoverflow.com/questions/12505158/generating-a-uuid-in-postgres-for-insert-statement