Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZmjT0-0005Qh-1l for pgsql-admin@arkaria.postgresql.org; Thu, 15 Oct 2015 14:25:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZmjSz-0007kM-K5 for pgsql-admin@arkaria.postgresql.org; Thu, 15 Oct 2015 14:25:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZmjRL-0005rD-Vx for pgsql-admin@postgresql.org; Thu, 15 Oct 2015 14:23:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZmjRI-0000TB-CU for pgsql-admin@postgresql.org; Thu, 15 Oct 2015 14:23:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t9FENQU3000960; Thu, 15 Oct 2015 10:23:26 -0400 From: Tom Lane To: "Geo P.C." cc: pgsql-admin@postgresql.org Subject: Re: Accessing Extension with out Superuser privilege In-reply-to: <539.1444917734@sss.pgh.pa.us> References: <539.1444917734@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 15 Oct 2015 10:02:14 -0400" Date: Thu, 15 Oct 2015 10:23:26 -0400 Message-ID: <959.1444919006@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org I wrote: > "Geo P.C." writes: >> In PostgreSQL server we created an extension with this command CREATE >> EXTENSION "uuid-ossp"; >> For our drupal site with user "drupal_user" we are trying to access this >> but getting an error as "function uuid_generate_v4() does not exist" >> When we give privilege for user "drupal_user" as Superuser we are able to >> access it. > It sounds like your superuser account has a default search_path that > includes the schema this function is in, but your drupal_user account > has a different default search_path that doesn't. You could put the > extension in a different schema, or change drupal_user's search_path. Ah, scratch that (-ENOCAFFEINE). What seems more likely on re-reading this is that drupal_user lacks USAGE privilege on whatever schema contains the uuid-ossp functions. Depending on which PG version you're using, I believe that unreadable schemas in your search_path are silently skipped. You could confirm that by trying to call the function using an explicitly schema-qualified function name, and seeing if you get a permissions error about the schema. regards, tom lane -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin