Re: A question about user atributes

From: stan <stanb(at)panix(dot)com>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: A question about user atributes
Date: 2019-11-22 18:32:35
Message-ID: 20191122183235.GB29562@panix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Fri, Nov 22, 2019 at 03:10:42PM +0100, Guillaume Lelarge wrote:
> First, please reply to the list, not me specifically.
>
> Le ven. 22 nov. 2019 ?? 14:51, stan <stanb(at)panix(dot)com> a ??crit :
>
> > On Fri, Nov 22, 2019 at 01:58:11PM +0100, Guillaume Lelarge wrote:
> > > Hi,
> > >
> > > Le ven. 22 nov. 2019 ?? 13:51, stan <stanb(at)panix(dot)com> a ??crit :
> > >
> > > > I am trting to do something, and it ias not working as I think it
> > should.
> > > >
> > > > Consider:
> > > >
> > > > onnected to a database called stan as stan
> > > >
> > > > /dt reports
> > > >
> > > > List of relations
> > > > Schema | Name | Type | Owner
> > > > --------+--------------------------+-------+-------
> > > > ica | biz_constants | table | stan
> > > > ica | bom_item | table | stan
> > > > ica | costing_unit | table | stan
> > > > ica | customer | table | stan
> > > > ica | employee | table | stan
> > > >
> > > > Connect as user postgres to database stan and execute:
> > > >
> > > > grant all ON ALL TABLES IN SCHEMA ica to harec ;
> > > >
> > > > Connect to database stan as user harec
> > > >
> > > > stan=> \dt
> > > > Did not find any relations.
> > > > stan=> \c
> > > > psql (12.1 (Debian 12.1-1.pgdg100+1), server 11.6 (Debian
> > > > 11.6-1.pgdg100+1))
> > > > You are now connected to database "stan" as user "harec".
> > > > stan=>
> > > >
> > > > What am I doing wrong?
> > > >
> > > >
> > > Might be a wrong search_path or maybe your harec user doesn't have USAGE
> > > right on the ica schema.
> > >
> >
> > Well,
> >
> > [local] stan(at)stan=# \dn
> > List of schemas
> > Name | Owner
> > --------+----------
> > ica | stan
> > public | postgres
> > stan | stan
> >
> > [local] stan(at)stan=# grant usage on ica to harec ;
> > ERROR: relation "ica" does not exist
> >
> > Is this incorect syntaxe?
> >
> >
> Yes, it is incorrect. You should tell PostgreSQL you're talking about a
> schema, hence:
> GRANT USAGE ON SCHEMA ica TO harec;
>
> See https://www.postgresql.org/docs/12/sql-grant.html for details.

Cool, that fixed it.

Thanks you.
--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rémi Cura 2019-11-22 22:05:01 automated 'discovery' of a table : potential primary key, columns functional dependencies ...
Previous Message Michael Lewis 2019-11-22 18:28:12 Re: Adding LIMIT changes PostgreSQL plan from good to a bad one