Installing "uuid-ossp" library in Postgres 9.1. (new Extension feature)

From: Basil Bourque <basil(dot)list(at)me(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Installing "uuid-ossp" library in Postgres 9.1. (new Extension feature)
Date: 2011-10-13 02:10:36
Message-ID: C5EBF511-835E-4F24-A4E4-6CC0119F48E4@me.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 uninstalling are 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2011-10-13 02:17:19 Re: Installing "uuid-ossp" library in Postgres 9.1. (new Extension feature)
Previous Message Andy Colson 2011-10-13 00:31:28 Re: PostGIS: Approximating a house number from street address range