Re: Baffled by basic permission issue.

From: Wells Oliver <wells(dot)oliver(at)gmail(dot)com>
To: Holger Jakobs <holger(at)jakobs(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Baffled by basic permission issue.
Date: 2021-06-16 21:01:05
Message-ID: CAOC+FBUvbGuZ5iY9bh8xCcrGt_fzMCfFJLkOfxn2bFypDuz1dg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

The role has SELECT perm on the view and on the underlying tables and I am
received a permission denied table on the table while trying to select from
the view. The view is owned by a different user but SELECT perms are very
clearly granted to my role.

On Wed, Jun 16, 2021 at 1:58 PM Holger Jakobs <holger(at)jakobs(dot)com> wrote:

> If you want to use a view, you need the permissions for it. Not for the
> underlying tables
>
> Am 16. Juni 2021 22:56:17 MESZ schrieb Wells Oliver <
> wells(dot)oliver(at)gmail(dot)com>:
>>
>> I have a view that does this:
>>
>> create view stats.v
>> select * from stats.t
>> join alias.i ON t.id = i.id
>> join alias.i2 ON t.id2 = i2.id;
>>
>> And when I do: SELECT * FROM stats.v I receive: *ERROR: permission
>> denied for table i*
>>
>> However, if I paste the contents of the view as a query and run it
>> manually, it works fine.
>>
>> I can also query alias.i as I please.
>>
>> The role I am using to connect has USAGE on both stats and alias, it also
>> has SELECT on the table as well as the view.
>>
>> The only difference is that the view is owned by a different user than
>> the tables, though the SELECT permissions are definitely granted.
>>
>> psql 13.2
>>
>> --
>> Wells Oliver
>> wells(dot)oliver(at)gmail(dot)com <wellsoliver(at)gmail(dot)com>
>>
>
> --
> Holger Jakobs, Bergisch Gladbach
> +49 178 9759012
> - sent from mobile, therefore short -
>

--
Wells Oliver
wells(dot)oliver(at)gmail(dot)com <wellsoliver(at)gmail(dot)com>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Wells Oliver 2021-06-16 21:10:02 Re: Baffled by basic permission issue.
Previous Message Holger Jakobs 2021-06-16 20:58:41 Re: Baffled by basic permission issue.