Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iheCS-0001jQ-J7 for pgsql-admin@arkaria.postgresql.org; Wed, 18 Dec 2019 18:37:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iheCR-0003we-B5 for pgsql-admin@arkaria.postgresql.org; Wed, 18 Dec 2019 18:37:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iheAI-0006uo-Tw for pgsql-admin@lists.postgresql.org; Wed, 18 Dec 2019 18:35:18 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iheAE-0002sf-Rd for pgsql-admin@postgresql.org; Wed, 18 Dec 2019 18:35:18 +0000 Received: by mail-qk1-x743.google.com with SMTP id w127so2385295qkb.11 for ; Wed, 18 Dec 2019 10:35:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=Zcl3k35E+FXc0NVnHwjHu1kW1ipvOp13qe/fnxSmIlw=; b=BeoFbAbrSLwev3CzeY4l3oj/k606QjtLWBUhCTJA8d5FO1gg6FYnoPh044YrZqXCwu y6lfiUNYICbJrc8IBe8va43hCbIqXc8oUG6Yq5/xvcSzE0kGcwv3uih7kH1YSuXTbcna kxP59QEA2aovLTHbd53JGRGV8pBsAvYyZAzFkKrfq918JREO2DQ2izsw5W3P+1gHa5va c1vDG6043M7STCXM6NHpZFONmWSVr9+sM430iVMKCUV4wAja9vUwhGrgOucFFdcICa4w 7bpQzBDjf9pm3NgSe5yoZukkTeVJoGK4SSNH9IXCg87nt3JPb1dpVdaklS6rU3819URR rTnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=Zcl3k35E+FXc0NVnHwjHu1kW1ipvOp13qe/fnxSmIlw=; b=Sl0ulLxWa/iDiTQgwzrCZnQEaHl7UFq6pH0jrgHHKLjCMQQzjOdkeT2A9+0NW6aAak w4zMpWUd8TWwdSKyefVnz+XezZqEXqhnx6ghH45AQriE5eSJoYlL8W+ZrXCugWw2Xv9N EWU+i7SCHAZWJ1RehbqDQFeMTYtaPH/6HVMriP1wyCCO9nAehHl3EGi5AVx5Yf+A191s 2T+wUuoQSNMbTh4GWCBz9eATSOe7ZIfqvn4jwzKMyclHpaIXjzI9R+6Lf33VX8SiO02I NT81vwiq2ajY1oI0EWisZN48PJwTmup1Gndg/dsvJlWkw9oveah8bQjBUI6QxcUFE39K h0gw== X-Gm-Message-State: APjAAAWhIMrWr9ZsXDlnl3TJd5ic7scY/0+F2w08ZHm0ICUcwp9NP4u9 vw/1/pksidfXCAaPf+6eGR15eodm X-Google-Smtp-Source: APXvYqw0li6baJWaN2PxNlxdIp+4/puc5vrh4qsYRzFbXEqZKfqo0Bbq2foLVRC8N/+bpmekGLEHOw== X-Received: by 2002:a37:794:: with SMTP id 142mr4169364qkh.348.1576694112797; Wed, 18 Dec 2019 10:35:12 -0800 (PST) Received: from [172.17.53.230] (rouge-137-188-108-19.vzw.com. [137.188.108.19]) by smtp.gmail.com with ESMTPSA id k184sm913118qke.2.2019.12.18.10.35.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Dec 2019 10:35:12 -0800 (PST) Content-Type: multipart/alternative; boundary=Apple-Mail-E48D5A97-3CE6-4A72-ABF4-64EEEC1ADC1B Content-Transfer-Encoding: 7bit From: John Scalia Mime-Version: 1.0 (1.0) Subject: Re: Strange inconsistency using psql Date: Wed, 18 Dec 2019 13:35:11 -0500 Message-Id: <8C7A5C93-FBA2-49A7-AF59-1314585F67A0@gmail.com> References: Cc: Pgsql-admin In-Reply-To: To: Keith X-Mailer: iPad Mail (17C54) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --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 wrote: >=20 > =EF=BB=BF >=20 >=20 >> On Wed, Dec 18, 2019 at 12:29 PM John Scalia 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 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.

Sent from my iPad

On Dec 18, 2019, at 12:41 P= M, Keith <keith@keithf4.com> wrote:

=EF=BB=BF


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

GRANT all ON TABLE x TO new_user;

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.

Was this intentional behavior, or is the grammar slightly amiss? All the oth= er 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 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.


Keith
= --Apple-Mail-E48D5A97-3CE6-4A72-ABF4-64EEEC1ADC1B--