Re: Error 42501 permission denied for schema

From: akp geek <akpgeek(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>, osvaldo(dot)kussama(at)gmail(dot)com
Subject: Re: Error 42501 permission denied for schema
Date: 2010-03-26 15:59:35
Message-ID: 2024a9fb1003260859g7d5290dbpb8241812d5a767bc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sorry for the confusion that I have caused

- roles > role1 , role2
- schemas > schema1, schema2
- GRANT USAGE ON SCHEMA schema1 TO role2;
- create function fnc_name(IN i_id numeric)
- function is created using role2

I ended up getting the error

ERROR: permission denied for schema schema1
SQL state: 42501

Appreciate your help.

On Fri, Mar 26, 2010 at 11:45 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> akp geek <akpgeek(at)gmail(dot)com> writes:
> > I have 2 schemas , schema1 and schema 2.
>
> > 1. GRANT USAGE ON SCHEMA schema1 TO schema2;
>
> You seem to be confusing schemas and users --- they are not the same
> thing at all. The above grants the right to lookup objects in schema1
> to the user (a/k/a role) named schema2; who doesn't necessarily have
> anything to do with objects in schema2.
>
> Also, although you failed to show the specific command that was failing,
> I suspect what you are actually running into is lack of CREATE
> permission not USAGE permission.
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-03-26 16:04:51 Re: Large index operation crashes postgres
Previous Message Tom Lane 2010-03-26 15:45:54 Re: Error 42501 permission denied for schema