Installing "uuid-ossp" library in Postgres 9.1. (new Extension feature)
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
On 10/12/11 7:10 PM, Basil Bourque wrote:
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.
probably because of the minus sign... otherwise, thats parsed as uuid
minus ossp :-/
--
john r pierce N 37, W 122
santa cruz ca mid-left coast