select generatee_uuid() gives error

3,133 views
Skip to first unread message

johnbendi

unread,
Nov 26, 2014, 4:27:44 AM11/26/14
to idem...@googlegroups.com
I'm on postgresql 9.3.5. i have run the CREATE EXTENSION "uuid-ossp" command and running it again reports that it exists. 

to confirm the installation I issue in the psql console the command 

psql> select generate_uuid();

and get :

ERROR:  function uuid_generate_v4() does not exist
LINE 1: SELECT uuid_generate_v4()::char(36)
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
QUERY:  SELECT uuid_generate_v4()::char(36)
CONTEXT:  PL/pgSQL function generate_uuid() line 3 at RETURN



-John

johnbendi

unread,
Nov 26, 2014, 7:17:21 AM11/26/14
to idem...@googlegroups.com
What does this mean? 

idempiere=# \dx+

      Objects in extension "plpgsql"
            Object Description             
-------------------------------------------
 function plpgsql_call_handler()
 function plpgsql_inline_handler(internal)
 function plpgsql_validator(oid)
 language plpgsql
(4 rows)

   Objects in extension "uuid-ossp"
          Object Description          
--------------------------------------
 function uuid_generate_v1()
 function uuid_generate_v1mc()
 function uuid_generate_v3(uuid,text)
 function uuid_generate_v4()
 function uuid_generate_v5(uuid,text)
 function uuid_nil()
 function uuid_ns_dns()
 function uuid_ns_oid()
 function uuid_ns_url()
 function uuid_ns_x500()
 schema adempiere
(11 rows)



adempiere=# select generate_uuid();

ERROR:  function generate_uuid() does not exist
LINE 1: select generate_uuid();
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts



idempiere=# select uuid_generate_v4();
           uuid_generate_v4           
--------------------------------------
 0fa9b29c-5a8a-4622-b7ea-e69b52609ef1
(1 row)

johnbendi

unread,
Nov 26, 2014, 8:13:40 AM11/26/14
to idem...@googlegroups.com
I have got extension "uuid-ossp" installed in public schema. How can i effectively change this to adempiere schema. I have tried to alter the extension but to no avail. I tried the dropping the extension as well so that I can recreate it from the adempiere schema but it refused. So how can I effectively change the extension so that adempiere user can call it succesfully. 

The alter schema command didn't report any errors but logging into the database with the adempiere user

Hiep Lq

unread,
Nov 26, 2014, 8:24:33 AM11/26/14
to johnbendi
‎Run CREATE EXTENSION "uuid-ossp‎" as guide. Run with adempiere user.

Sent from my BlackBerry 10 smartphone.
From: johnbendi
Sent: Wednesday, November 26, 2014 21:13
Subject: [idempiere] Re: select generatee_uuid() gives error

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/0ada45d3-a779-465c-97de-50a2356a21bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

johnbendi

unread,
Nov 26, 2014, 9:50:47 AM11/26/14
to idem...@googlegroups.com
In case one runs into this same error as me. Simply issue the psql command:

ALTER EXTENSION "uuid-ossp" SET SCHEMA adempiere;

-John
Reply all
Reply to author
Forward
0 new messages