From: Adrian Klaver <adrian.klaver@aklaver.com>
To: sekhar chandra <sekharclouddbengineer@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Fwd: not able to give usage access to public schema
Date: Sat, 13 Jun 2020 10:43:39 -0700
Message-ID: <5302c3f0-5bef-6d1f-6bf3-7926fa70358f@aklaver.com> (raw)
In-Reply-To: <CAB7a7NbTVESHYw9urwDk0pnzms=wJUcR-0uCWCO0NCd+gAkBTA@mail.gmail.com>
References: <CAB7a7NamePJDb2EXp+WogHxw3GoVFN62TsbnnYP9tYZrHgmYgg@mail.gmail.com>
<CAB7a7NaYcD9U+uWrMni7zstsQJSf2e9KKcyp5pzHSwuz4BbtMw@mail.gmail.com>
<cd84bab4-0cc3-9c0a-64cf-e23cc6cf62a6@aklaver.com>
<CAB7a7NbTVESHYw9urwDk0pnzms=wJUcR-0uCWCO0NCd+gAkBTA@mail.gmail.com>
On 6/13/20 10:33 AM, sekhar chandra wrote:
> Adrian - when I follow the same steps what you did . in my case , the
> result is false.
>
>
> grant usage on schema public to role_test ;
> GRANT
>
> SELECT rolname, has_schema_privilege('role_test', 'public', 'usage')
> from pg_roles where rolname = 'role_test';
> rolname | has_schema_privilege
> -----------+----------------------
> role_test | f
Postgres version and where are you running this e.g. cloud service?
What does \dn+ public show before and after you redo commands as asked
below?
Can you start over and provide complete sequence for above including
CREATE ROLE and what user you are doing the above as?
>
> On Fri, Jun 12, 2020 at 10:11 PM Adrian Klaver
> <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:
>
> On 6/12/20 3:56 PM, sekhar chandra wrote:
> > I am not able to give usage permission to public schema. below
> are the
> > steps.
> >
> >
> > Logged in as super user
> > created a new user as user1
> > grant usage on public to user1
>
> Either the above is a cut and paste error or you got an error:
>
> grant usage on public to role_test ;
> ERROR: relation "public" does not exist
>
> grant usage on schema public to role_test ;
> GRANT
>
> SELECT rolname, has_schema_privilege('role_test', 'public', 'usage')
> from pg_roles where rolname = 'role_test';
> rolname | has_schema_privilege
> -----------+----------------------
> role_test | t
>
>
> >
> > command completed successfully , but verification statement
> showing he
> > doesnt have usage permission.
> > SELECT rolname, has_schema_privilege(rolname, 'public', 'usage')
> from
> > pg_roles;
> >
> > this is strage. what could go wrong.
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, sekharclouddbengineer@gmail.com
Subject: Re: Fwd: not able to give usage access to public schema
In-Reply-To: <5302c3f0-5bef-6d1f-6bf3-7926fa70358f@aklaver.com>
References: <CAB7a7NamePJDb2EXp+WogHxw3GoVFN62TsbnnYP9tYZrHgmYgg@mail.gmail.com> <CAB7a7NaYcD9U+uWrMni7zstsQJSf2e9KKcyp5pzHSwuz4BbtMw@mail.gmail.com> <cd84bab4-0cc3-9c0a-64cf-e23cc6cf62a6@aklaver.com> <CAB7a7NbTVESHYw9urwDk0pnzms=wJUcR-0uCWCO0NCd+gAkBTA@mail.gmail.com> <5302c3f0-5bef-6d1f-6bf3-7926fa70358f@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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