Re: User granted all access to schema, but can't see tables

From: John Scalia <jayknowsunix(at)gmail(dot)com>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: User granted all access to schema, but can't see tables
Date: 2020-12-18 12:26:30
Message-ID: 41AFAC73-A145-4EAC-B211-70D12AFD7D77@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)gmail(dot)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.
>
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ron 2020-12-18 12:57:37 Re: User granted all access to schema, but can't see tables
Previous Message Ron 2020-12-18 12:07:21 User granted all access to schema, but can't see tables