pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Accessing Extension with out Superuser privilege
3+ messages / 2 participants
[nested] [flat]

* Accessing Extension with out Superuser privilege
@ 2015-10-15 13:58  Geo P.C. <pcgeopc@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Geo P.C. @ 2015-10-15 13:58 UTC (permalink / raw)
  To: pgsql-admin

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.

So please let us know with out giving Superuser privilege how we can give
permission for "drupal_user" to access extension or let me know what
additional role other than Superuser for accessing extension.

Please update us on it.

Thanks & Regards
Ge
*o*

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Accessing Extension with out Superuser privilege
@ 2015-10-15 14:02  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Geo P.C. <pcgeopc@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2015-10-15 14:02 UTC (permalink / raw)
  To: Geo P.C. <pcgeopc@gmail.com>; +Cc: pgsql-admin

"Geo P.C." <pcgeopc@gmail.com> 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.

			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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Accessing Extension with out Superuser privilege
@ 2015-10-15 14:23  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2015-10-15 14:23 UTC (permalink / raw)
  To: Geo P.C. <pcgeopc@gmail.com>; +Cc: pgsql-admin

I wrote:
> "Geo P.C." <pcgeopc@gmail.com> 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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2015-10-15 14:23 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-10-15 13:58 Accessing Extension with out Superuser privilege Geo P.C. <pcgeopc@gmail.com>
2015-10-15 14:02 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-10-15 14:23   ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox