Re: Strange inconsistency using psql

From: John Scalia <jayknowsunix(at)gmail(dot)com>
To: Keith <keith(at)keithf4(dot)com>
Cc: Pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Strange inconsistency using psql
Date: 2019-12-18 18:35:11
Message-ID: 8C7A5C93-FBA2-49A7-AF59-1314585F67A0@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Correct, but my question really is, why is VIEW different from all the other types of objects? Shouldn’t the word VIEW also be an optional qualifier for the name of the object? Inconsistency strikes me as an oversight.

Sent from my iPad

> On Dec 18, 2019, at 12:41 PM, Keith <keith(at)keithf4(dot)com> wrote:
>
> 
>
>
>> On Wed, Dec 18, 2019 at 12:29 PM John Scalia <jayknowsunix(at)gmail(dot)com> wrote:
>> I had to do some privilege assignments this morning on a bunch of tables, sequences, functions, and views. On all of these object, I generally try to use a command like:
>>
>> GRANT all ON TABLE x TO new_user;
>>
>> Where TABLE is either that object or a SEQUENCE or FUNCTION. These all worked perfectly for me. What did not work was specifying that the object was a VIEW. The system would spit out a syntax error at the object’s name being specified, however, if I omitted the word VIEW, and not specify the type of object, then the GRANT succeeded.
>>
>> Was this intentional behavior, or is the grammar slightly amiss? All the other types of objects worked perfectly with this style of command.
>> —
>> Jay
>>
>> Sent from my iPad
>>
>
> There is no VIEW clause to the GRANT command. The TABLE clause is actually optional in the command when setting privileges on tables or views. And generally you can use the privileges used on tables when setting privileges on views.
>
> https://www.postgresql.org/docs/current/sql-grant.html
>
> Keith

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Pepe TD Vo 2019-12-18 18:55:26 backup script error with could not connect to database
Previous Message Keith 2019-12-18 17:41:10 Re: Strange inconsistency using psql