Re: Strange inconsistency using psql
John Scalia <[email protected]> Wed, 18 Dec 2019 13:35:11 -0500
| Newsgroups | gmane.comp.db.postgresql.admin |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail-E48D5A97-3CE6-4A72-ABF4-64EEEC1ADC1B Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Correct, but my question really is, why is VIEW different from all the other= types of objects? Shouldn=E2=80=99t the word VIEW also be an optional quali= fier 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 <[email protected]> wrote: >=20 > =EF=BB=BF >=20 >=20 >> On Wed, Dec 18, 2019 at 12:29 PM John Scalia <[email protected]> wro= te: >> 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: >>=20 >> GRANT all ON TABLE x TO new_user; >>=20 >> Where TABLE is either that object or a SEQUENCE or FUNCTION. These all wo= rked 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 t= ype of object, then the GRANT succeeded. >>=20 >> Was this intentional behavior, or is the grammar slightly amiss? All the o= ther types of objects worked perfectly with this style of command. >> =E2=80=94 >> Jay >>=20 >> Sent from my iPad >>=20 >=20 > 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 gen= erally you can use the privileges used on tables when setting privileges on v= iews. >=20 > https://www.postgresql.org/docs/current/sql-grant.html >=20 > Keith --Apple-Mail-E48D5A97-3CE6-4A72-ABF4-64EEEC1ADC1B Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=3D= utf-8"></head><body dir=3D"auto">Correct, but my question really is, why is V= IEW different from all the other types of objects? Shouldn=E2=80=99t the wor= d VIEW also be an optional qualifier for the name of the object? Inconsisten= cy strikes me as an oversight.<br><br><div dir=3D"ltr">Sent from my iPad</di= v><div dir=3D"ltr"><br><blockquote type=3D"cite">On Dec 18, 2019, at 12:41 P= M, Keith <[email protected]> wrote:<br><br></blockquote></div><blockqu= ote type=3D"cite"><div dir=3D"ltr">=EF=BB=BF<div dir=3D"ltr"><div dir=3D"ltr= "><br></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_a= ttr">On Wed, Dec 18, 2019 at 12:29 PM John Scalia <<a href=3D"mailto:jayk= [email protected]">[email protected]</a>> wrote:<br></div><blockquo= te class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px s= olid rgb(204,204,204);padding-left:1ex">I had to do some privilege assignmen= ts this morning on a bunch of tables, sequences, functions, and views. On al= l 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 worke= d perfectly for me. What did not work was specifying that the object was a V= IEW. The system would spit out a syntax error at the object=E2=80=99s name b= eing specified, however, if I omitted the word VIEW, and not specify the typ= e of object, then the GRANT succeeded.<br> <br> Was this intentional behavior, or is the grammar slightly amiss? All the oth= er 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 co= mmand. The TABLE clause is actually optional in the command when setting pri= vileges 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 href=3D= "https://www.postgresql.org/docs/current/sql-grant.html">https://www.postgre= sql.org/docs/current/sql-grant.html</a></div><div><br></div><div>Keith<br></= div></div></div> </div></blockquote></body></html>= --Apple-Mail-E48D5A97-3CE6-4A72-ABF4-64EEEC1ADC1B--