Re: Strange inconsistency using psql - Mailing list pgsql-admin

From Keith
Subject Re: Strange inconsistency using psql
Date
Msg-id CAHw75vt=iodvVhKb+EzGCwXBzG2og6bdMzQV7HJSeKw7meriow@mail.gmail.com
Whole thread Raw
In response to Strange inconsistency using psql  (John Scalia <jayknowsunix@gmail.com>)
Responses Re: Strange inconsistency using psql  (John Scalia <jayknowsunix@gmail.com>)
List pgsql-admin


On Wed, Dec 18, 2019 at 12:29 PM John Scalia <jayknowsunix@gmail.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.


Keith

pgsql-admin by date:

Previous
From: John Scalia
Date:
Subject: Strange inconsistency using psql
Next
From: John Scalia
Date:
Subject: Re: Strange inconsistency using psql