Replacing uuid-ossp with uuid-freebsd - Mailing list pgsql-general

From Piotr Gasidło
Subject Replacing uuid-ossp with uuid-freebsd
Date
Msg-id CAF8akQuz-p4X3q4F1bYnzx7XH4CX6PTnxO16AsVoEi9BAzmzCA@mail.gmail.com
Whole thread Raw
Responses Re: Replacing uuid-ossp with uuid-freebsd  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: Replacing uuid-ossp with uuid-freebsd  (Jan de Visser <jan@de-visser.net>)
List pgsql-general
Hello,

I've moved from Linux to FreeBSD. I've used uuid-ossp. Now I need to
aply patch to make it work under FreeBSD. This is rather dirty hack.
So I need to replace it once and for all with uuid-freebsd module. But
because in my database I use uuid type and uuid_* functions is not
easy:

test_uuid=# \d test
                 Table "public.test"
 Column | Type |              Modifiers
--------+------+-------------------------------------
 id     | uuid | not null default uuid_generate_v4()

test_uuid=# drop extension "uuid-ossp";
ERROR:  cannot drop extension uuid-ossp because other objects depend on it
DETAIL:  default for table test column id depends on function uuid_generate_v4()
HINT:  Use DROP ... CASCADE to drop the dependent objects too.

test_uuid=# create extension "uuid-freebsd";
ERROR:  function "uuid_nil" already exists with same argument types
test_uuid=#

I can do this:

test_uuid=# CREATE OR REPLACE FUNCTION uuid_generate_v4()
RETURNS uuid
AS '/usr/local/lib/postgresql/uuid-freebsd.so', 'uuid_generate_v4'
VOLATILE STRICT LANGUAGE C;
CREATE FUNCTION

But THIS is now dirty hack - extension uuid-ossp is still there
(according to \dx) and I use functions from other, unregistered
extension.

I think, that I need do some low level hacking on pg_catalog. Any
hints how to do it cleanly (eq. replace functions, drop uuid-ossp and
add uuid-freebsd).

--
Piotr Gasidło


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Reg: BULK COLLECT
Next
From: Adrian Klaver
Date:
Subject: Re: Replacing uuid-ossp with uuid-freebsd