Re: Strange inconsistency using psql

Keith <[email protected]> Wed, 18 Dec 2019 12:41:10 -0500
Newsgroups gmane.comp.db.postgresql.admin
Message-ID <CAHw75vt=iodvVhKb+EzGCwXBzG2og6bdMzQV7HJSeKw7meriow@mail.gmail.com>
--0000000000005d16d60599fdf5e2
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Dec 18, 2019 at 12:29 PM John Scalia <[email protected]> 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=E2=80=
=99s 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.
> =E2=80=94
> 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

--0000000000005d16d60599fdf5e2
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Wed, Dec 18, 2019 at 12:29 PM John=
 Scalia &lt;<a href=3D"mailto:[email protected]">[email protected]=
m</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"=
>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:<br>
<br>
GRANT all ON TABLE x TO new_user;<br>
<br>
Where TABLE is either that object or a SEQUENCE or FUNCTION. These all work=
ed 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=E2=80=99s nam=
e being specified, however, if I omitted the word VIEW, and not specify the=
 type of object, then the GRANT succeeded.<br>
<br>
Was this intentional behavior, or is the grammar slightly amiss? All the ot=
her types of objects worked perfectly with this style of command.<br>
=E2=80=94<br>
Jay<br>
<br>
Sent from my iPad<br>
<br></blockquote><div><br></div><div>There is no VIEW clause to the GRANT c=
ommand. The TABLE clause is actually optional in the command when setting p=
rivileges on tables or views. And generally you can use the privileges used=
 on tables when setting privileges on views. </div><div><br></div><div><a h=
ref=3D"https://www.postgresql.org/docs/current/sql-grant.html">https://www.=
postgresql.org/docs/current/sql-grant.html</a></div><div><br></div><div>Kei=
th<br></div></div></div>

--0000000000005d16d60599fdf5e2--