pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
A question about user atributes
4+ messages / 2 participants
[nested] [flat]

* A question about user atributes
@ 2019-11-22 12:50  stan <stanb@panix.com>
  0 siblings, 1 reply; 4+ messages in thread

From: stan @ 2019-11-22 12:50 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

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?

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





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

* Re: A question about user atributes
@ 2019-11-22 12:58  Guillaume Lelarge <guillaume@lelarge.info>
  parent: stan <stanb@panix.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Guillaume Lelarge @ 2019-11-22 12:58 UTC (permalink / raw)
  To: stan <stanb@panix.com>; +Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

Hi,

Le ven. 22 nov. 2019 à 13:51, stan <stanb@panix.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.


-- 
Guillaume.

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

* Re: A question about user atributes
@ 2019-11-22 14:10  Guillaume Lelarge <guillaume@lelarge.info>
  parent: Guillaume Lelarge <guillaume@lelarge.info>
  0 siblings, 1 reply; 4+ messages in thread

From: Guillaume Lelarge @ 2019-11-22 14:10 UTC (permalink / raw)
  To: stan <stanb@panix.com>; pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

First, please reply to the list, not me specifically.

Le ven. 22 nov. 2019 à 14:51, stan <stanb@panix.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@panix.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@stan=# \dn
>   List of schemas
> Name  |  Owner
> --------+----------
>  ica    | stan
>  public | postgres
>  stan   | stan
>
> [local] stan@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.


-- 
Guillaume.

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

* Re: A question about user atributes
@ 2019-11-22 18:32  stan <stanb@panix.com>
  parent: Guillaume Lelarge <guillaume@lelarge.info>
  0 siblings, 0 replies; 4+ messages in thread

From: stan @ 2019-11-22 18:32 UTC (permalink / raw)
  To: Guillaume Lelarge <guillaume@lelarge.info>; +Cc: pgsql-general@lists.postgresql.org


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@panix.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@panix.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@stan=# \dn
> >   List of schemas
> > Name  |  Owner
> > --------+----------
> >  ica    | stan
> >  public | postgres
> >  stan   | stan
> >
> > [local] stan@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





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


end of thread, other threads:[~2019-11-22 18:32 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-11-22 12:50 A question about user atributes stan <stanb@panix.com>
2019-11-22 12:58 ` Guillaume Lelarge <guillaume@lelarge.info>
2019-11-22 14:10   ` Guillaume Lelarge <guillaume@lelarge.info>
2019-11-22 18:32     ` stan <stanb@panix.com>

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