From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
---|---|
To: | Piotr Gasidło <quaker(at)barbara(dot)eu(dot)org>, pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Replacing uuid-ossp with uuid-freebsd |
Date: | 2015-05-25 14:28:46 |
Message-ID: | 5563319E.1060901@aklaver.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 05/25/2015 07:17 AM, Piotr Gasidło wrote:
> 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).
>
What version of Postgres?
So did you see the section at the bottom of this page?:
http://www.postgresql.org/docs/9.4/interactive/uuid-ossp.html
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Jan de Visser | 2015-05-25 14:31:43 | Re: Replacing uuid-ossp with uuid-freebsd |
Previous Message | Piotr Gasidło | 2015-05-25 14:17:32 | Replacing uuid-ossp with uuid-freebsd |