pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Scalia <jayknowsunix@gmail.com>
To: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: User granted all access to schema, but can't see tables
Date: Fri, 18 Dec 2020 07:26:30 -0500
Message-ID: <41AFAC73-A145-4EAC-B211-70D12AFD7D77@gmail.com> (raw)
In-Reply-To: <0bfc7514-e4ee-375e-be44-24479e728adc@gmail.com>
References: <0bfc7514-e4ee-375e-be44-24479e728adc@gmail.com>

Does the stansuser have connect privileges to the actual database where the schema and tables are?

GRANT connect ON DATABASE <stans_whatever> TO stansuser;

Note that since you didn’t tell us what the database name is here, you’ll need to substitute the actual name of it where I indicated <stans_whatever>.
—
Jay

Sent from my iPad

> On Dec 18, 2020, at 7:07 AM, Ron <ronljohnsonjr@gmail.com> wrote:
> 
> This is v12 from RHEL repos.
> 
> As user postgres, I run:
> 
> sides=# grant all on SCHEMA strans TO stransuser;
> GRANT
> 
> sides=# ALTER DEFAULT PRIVILEGES IN SCHEMA strans GRANT all on tables to stransuser;
> ALTER DEFAULT PRIVILEGES
> 
> sides=# GRANT USAGE ON SCHEMA strans TO stransuser;
> GRANT
> 
> But user stransuser still can’t access tables
> 
> sides=> \d
>              List of relations
> Schema |    Name    |   Type   |  Owner
> --------+------------+----------+----------
> strans | foo        | table    | postgres
> strans | foo_id_seq | sequence | postgres
> (2 rows)
> 
> sides=> select * from strans.foo;
> ERROR:  permission denied for table foo
> 
> sides=> \z strans.foo
>                                 Access privileges
> Schema | Name | Type  |     Access privileges     | Column privileges | Policies
> --------+------+-------+---------------------------+-------------------+----------
> strans | foo  | table | postgres=arwdDxt/postgres+|                   |
>        |      |       | READWRITE=arwdD/postgres +|                   |
>        |      |       | READONLY=r/postgres |                   |
> (1 row)
> 
> What am I missing?
> 
> -- 
> Angular momentum makes the world go 'round.
> 
> 





view thread (5+ messages)  latest in thread

Message-ID: <41AFAC73-A145-4EAC-B211-70D12AFD7D77@gmail.com>
Permalink:  ../41AFAC73-A145-4EAC-B211-70D12AFD7D77@gmail.com/
Also on:    postgresql.org/message-id/41AFAC73-A145-4EAC-B211-70D12AFD7D77@gmail.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: jayknowsunix@gmail.com, ronljohnsonjr@gmail.com
  Subject: Re: User granted all access to schema, but can't see tables
  In-Reply-To: <41AFAC73-A145-4EAC-B211-70D12AFD7D77@gmail.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