Installing "uuid-ossp" library in Postgres 9.1. (new Extension feature) - Mailing list pgsql-general

From Basil Bourque
Subject Installing "uuid-ossp" library in Postgres 9.1. (new Extension feature)
Date
Msg-id C5EBF511-835E-4F24-A4E4-6CC0119F48E4@me.com
Whole thread Raw
Responses Re: Installing "uuid-ossp" library in Postgres 9.1. (new Extension feature)  (John R Pierce <pierce@hogranch.com>)
List pgsql-general
The "uuid-ossp" library enables you to generate UUID values server-side in Postgres.
http://www.postgresql.org/docs/current/static/uuid-ossp.html

The technique to install this library changed as of Postgres 9.1, because of the new Extension feature. Installing and
uninstallingare now easier. I have an overview on my blog, but I'm posting the brief steps here for posterity. 

To see what extensions are already installed in your Postgres, run this SQL:
  select * from pg_extension;

To see if the "uuid-ossp" extension is available, run this SQL:
  select * from pg_available_extensions;

To install/load the extension, run this SQL:
  CREATE EXTENSION "uuid-ossp";

I found the quote marks to be required despite the doc being contrary.

Doc on loading extensions:
http://www.postgresql.org/docs/current/static/sql-createextension.html

My blog post on this topic:
http://crafted-software.blogspot.com/2011/10/extensions-in-postgres.html

To install this library in versions of Postgres before 9.1:
http://crafted-software.blogspot.com/2011/10/using-uuid-library-in-postgres.html

--Basil Bourque

pgsql-general by date:

Previous
From: Gavin Flower
Date:
Subject: Re: how to find primary key field name?
Next
From: John R Pierce
Date:
Subject: Re: Installing "uuid-ossp" library in Postgres 9.1. (new Extension feature)