Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X6r6J-0004vm-U2 for pgsql-admin@arkaria.postgresql.org; Tue, 15 Jul 2014 01:00:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X6r6J-0000wg-65 for pgsql-admin@arkaria.postgresql.org; Tue, 15 Jul 2014 01:00:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X6r6H-0000wY-Lv for pgsql-admin@postgresql.org; Tue, 15 Jul 2014 01:00:10 +0000 Received: from mail-pa0-x234.google.com ([2607:f8b0:400e:c03::234]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1X6r6A-0005BG-G4 for pgsql-admin@postgresql.org; Tue, 15 Jul 2014 01:00:07 +0000 Received: by mail-pa0-f52.google.com with SMTP id eu11so6296840pac.39 for ; Mon, 14 Jul 2014 18:00:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :thread-index:content-language; bh=AhHdc5LCWTJShhOQUHIkIRDbevUFCa1au/zSGyE+Bfg=; b=eI6xtKGy9jPUB2XHM7pGvTrM/aejYeW8dn7JjD19rxKlnTlngBRH8DkZQ6K1T1U1kb hqaoCfti9krBdRIK+SoRe3ZSe1xwR2G8Z3aPLlc6MR4fpKhDY2wQFU+HRQecg2Smdjly Tu1/toEJKNUjGVXJhP5kARyXJJiGL/Ha1ph8Ex03a3VmfIPokC2D3KYk2x+/XBhD2LY8 9OGev8tCdf5SoXRsHu6v+ay6/Bby9tZfaaDL0wMdoFKEhKvkBl3lUYMnqHDjRLHy+mHr rEQSIlxQhrSWjmzuhDFagNyYMSmW+0NG3JKgwHMsrD9yx9suB7EdY6U6Mh/RO46k+byA F8Tw== X-Received: by 10.70.140.75 with SMTP id re11mr19557860pdb.65.1405386000297; Mon, 14 Jul 2014 18:00:00 -0700 (PDT) Received: from YuanyuanPC ([58.58.27.50]) by mx.google.com with ESMTPSA id op6sm16226027pdb.71.2014.07.14.17.59.57 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Jul 2014 17:59:59 -0700 (PDT) From: "liuyuanyuan" To: "'Guillaume Lelarge'" Cc: Subject: reply: sql to grant privilege on sequence Date: Tue, 15 Jul 2014 08:59:52 +0800 Message-ID: <001801cf9fc8$18effb90$4acff2b0$@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0019_01CFA00B.27151050" X-Mailer: Microsoft Outlook 15.0 Thread-Index: Ac+fx8nM70ixtxY+RbegWCgTrXdf4g== Content-Language: zh-cn X-Pg-Spam-Score: -1.0 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org This is a multipart message in MIME format. ------=_NextPart_000_0019_01CFA00B.27151050 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable My pleasure , and thanks for your reply ~ =20 Best Wishes! Jasmine =20 =E5=8F=91=E4=BB=B6=E4=BA=BA: Guillaume Lelarge = [mailto:guillaume@lelarge.info]=20 =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2014=E5=B9=B47=E6=9C=8815=E6=97=A5 = 5:05 =E6=94=B6=E4=BB=B6=E4=BA=BA: liuyuanyuan =E6=8A=84=E9=80=81: pgsql-admin@postgresql.org =E4=B8=BB=E9=A2=98: Re: =E7=AD=94=E5=A4=8D: [ADMIN] sql to grant = privilege on sequence =20 2014-07-14 11:31 GMT+02:00 liuyuanyuan >: Thanks Guillaume! Thanks for your reply ! =20 Now that, I got the reason. I knew GRANT ON TABLE still works for sequence, but I think use GRANT = ON SEQUENCE in pgAdmin3 of newer version maybe much better. Because GRANT ON = SEQUENCE is more clear, and maybe that=E2=80=99s why developers create this syntax especially = for sequence. That=E2=80=99s only a suggestion, looking forward to hearing from you = later~~ =20 Well, we have this weird check in pgSequence.cpp: if (!GetConnection()->BackendMinimumVersion(8, 2))=C2=AC sql +=3D GetGrant(wxT("arwdRxt"), wxT("TABLE ") + = GetQuotedFullIdentifier());=C2=AC else=C2=AC sql +=3D GetGrant(wxT("rwU"), wxT("TABLE ") + = GetQuotedFullIdentifier());=C2=AC =20 This code is as old as 2006 (commit id = 2ef0bfe6cb8eb9d2cf117ca654bbbe0d17d0a784), where Dave added "Add support = for PostgreSQL 8.2's CONNECT privilege on databases, and USAGE on = sequences". Pretty sure he meant SEQUENCE instead of TABLE in the else part :) Fixed. Thanks for the report. --=20 Guillaume. http://blog.guillaume.lelarge.info http://www.dalibo.com ------=_NextPart_000_0019_01CFA00B.27151050 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

My pleasure , and thanks for your reply ~

 

Best Wishes!

Jasmine

 

=E5=8F=91=E4=BB=B6=E4=BA=BA: Guillaume Lelarge [mailto:guillaume@lelarge.info] =
=E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2014=E5=B9=B47=E6=9C=8815=E6=97=A5 = 5:05
=E6=94=B6=E4=BB=B6=E4=BA=BA: = liuyuanyuan
=E6=8A=84=E9=80=81: = pgsql-admin@postgresql.org
=E4=B8=BB=E9=A2=98: Re: = =E7=AD=94=E5=A4=8D: [ADMIN] sql to grant = privilege on sequence

 

2014-07-14 11:31 GMT+02:00 = liuyuanyuan <liuyuanyuangogo@gmail.com>:

= Thanks Guillaume! = Thanks for your reply !

=  

= Now that, I got the reason.

= I knew  GRANT ON TABLE still works for sequence, but I think use = GRANT ON SEQUENCE

= in pgAdmin3 of newer version maybe much better. Because GRANT ON = SEQUENCE is more clear,

= and maybe that=E2=80=99s why developers create this syntax = especially for = sequence.

= That=E2=80=99s only a suggestion, looking forward to hearing from you = later~~

 

Well, we have this weird check in = pgSequence.cpp:

      if = (!GetConnection()->BackendMinimumVersion(8, = 2))=C2=AC
         sql +=3D = GetGrant(wxT("arwdRxt"), wxT("TABLE ") + = GetQuotedFullIdentifier());=C2=AC
      = else=C2=AC
         sql +=3D = GetGrant(wxT("rwU"), wxT("TABLE ") + = GetQuotedFullIdentifier());=C2=AC
 

This code is as old as 2006 (commit id = 2ef0bfe6cb8eb9d2cf117ca654bbbe0d17d0a784), where Dave added "Add = support for PostgreSQL 8.2's CONNECT privilege on databases, and USAGE = on sequences".

Pretty sure he meant = SEQUENCE instead of TABLE in the else part = :)

Fixed.

Thanks for the = report.



--

------=_NextPart_000_0019_01CFA00B.27151050--