Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X6cba-0001Nz-5W for pgsql-admin@arkaria.postgresql.org; Mon, 14 Jul 2014 09:31:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X6cbZ-0002aG-MA for pgsql-admin@arkaria.postgresql.org; Mon, 14 Jul 2014 09:31:29 +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 1X6cbY-0002a8-Ji for pgsql-admin@postgresql.org; Mon, 14 Jul 2014 09:31:28 +0000 Received: from mail-pd0-x232.google.com ([2607:f8b0:400e:c02::232]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1X6cbV-0004rw-B8 for pgsql-admin@postgresql.org; Mon, 14 Jul 2014 09:31:26 +0000 Received: by mail-pd0-f178.google.com with SMTP id r10so4979590pdi.9 for ; Mon, 14 Jul 2014 02:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-type:thread-index:content-language; bh=JYB0kWVSlzh/E1gzrZ1snvYbn4rOQ4lV55vpgR1nuC8=; b=v4MRuw8URRkZiTgYLRuOnJsvzOLPkstgjSuva4uaOy8RL+V6PEJaf7BrTasxympPs1 Isa6dSFxMgl7BwoahUIUoFkZpmwMZBysUNgZj2LlplbH6u5XrqAtaJoU2S+nZstfB3jD sp1qZuupxCpHuHskS6E1jL/Nei8N5eCSuqWjHhn8iCbaPNTtiblaxtm9/7qpFHo6deqy 5AJHt59XhJpbTLChbEQRfAOOd3DSP7B1qwl0NSlFEhNPesbo0sKeETv6VF3hSkaQGksj BDT+myS226KJ6wKdJxNu+tEgoB6cagoyGlwWi7BkqpIm7q2ocrB3MMqn6RmxkvSMv3PP Mlmw== X-Received: by 10.66.146.199 with SMTP id te7mr2289644pab.106.1405330283695; Mon, 14 Jul 2014 02:31:23 -0700 (PDT) Received: from YuanyuanPC ([58.58.27.50]) by mx.google.com with ESMTPSA id bm6sm13697988pdb.76.2014.07.14.02.31.11 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Jul 2014 02:31:23 -0700 (PDT) From: "liuyuanyuan" To: "'Guillaume Lelarge'" Cc: References: <01e701cf9f2b$408100c0$c1830240$@gmail.com> In-Reply-To: Subject: =?UTF-8?Q?=E7=AD=94=E5=A4=8D:_=5BADMIN=5D_sql_to_grant_privile?= =?UTF-8?Q?ge_on_sequence?= Date: Mon, 14 Jul 2014 17:31:01 +0800 Message-ID: <020f01cf9f46$5fff2ec0$1ffd8c40$@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0210_01CF9F89.6E235920" X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQLSQsLCxr9MeHiHw6F8us7gR0MTZwIYLdyUmYlFpeA= 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_0210_01CF9F89.6E235920 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Regards ! Yours, Jasmine =20 =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=8814=E6=97=A5 = 16:50 =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: [ADMIN] sql to grant privilege on sequence =20 Le 14 juil. 2014 08:20, "liuyuanyuan" > a =C3=A9crit : > > Hi, Hackers! > > I got a question about sequence SQL of pgadmin3 , such as pgAdmin3 of = PostgreSQL9.3. > > I found when I GRANT privilege on sequence by pgAdmin3 tool, = it=E2=80=99s always show me sql like: > > GRANT SELECT, UPDATE ON TABLE sequence_name TO =E2=80=A6. > > Rather than: > > GRANT SELECT, UPDATE ON SEQUENCE sequence_name TO =E2=80=A6. > > =20 > > For example: > > When I use pgAdmin3 TO create a sequence, I input SEQUENCE NAME = =E2=80=93 seq1 ,and add privilege SELECT to public, > > Then the SQL shows: GRANT .. ON TABLE =E2=80=A6 > > =20 > > =20 > > I checked the documentation of PostgreSQL 9.3 (see = http://www.postgresql.org/docs/9.3/interactive/sql-grant.html), > > Then I know the privileges grant on sequence are only a part of that = on table. > > Then I want to know, why to use GRANT ON TABLE ? why not to use GRANT = ON SEQUENCE ? > Because that was the way to do it before 8.2 iirc. And it still works. = Nevertheless I'll look into it. ------=_NextPart_000_0210_01CF9F89.6E235920 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

= Thanks Guillaume! = = Thanks for your reply !

=  

= Now that, I got the reason.

= I knew=C2=A0 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~~

=  

= Regards !

= Yours,

= 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=8814=E6=97=A5 = 16:50
=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: [ADMIN] sql to grant = privilege on sequence

 

Le 14 = juil. 2014 08:20, "liuyuanyuan" <liuyuanyuangogo@gmail.com&g= t; a =C3=A9crit :
>
> Hi, Hackers!
>
> I got a = question about sequence SQL of pgadmin3 , such as pgAdmin3 of = PostgreSQL9.3.
>
> I found when I GRANT privilege on = sequence by pgAdmin3 tool, it=E2=80=99s always show me sql = like:
>
> GRANT SELECT, UPDATE ON TABLE sequence_name TO = =E2=80=A6.
>
> Rather than:
>
> GRANT SELECT, = UPDATE ON SEQUENCE sequence_name TO =E2=80=A6.
>
> =  
>
> For example:
>
> When I use pgAdmin3 = TO create a sequence, I input SEQUENCE NAME =E2=80=93 seq1 ,and add = privilege SELECT to public,
>
> Then the SQL shows: GRANT .. = ON TABLE =E2=80=A6
>
>  
>
> =  
>
> I checked the documentation of PostgreSQL 9.3 = (see ht= tp://www.postgresql.org/docs/9.3/interactive/sql-grant.html),
>=
> Then I know the privileges grant on sequence are only a part of = that on table.
>
> Then I want to know, why to use GRANT ON = TABLE ? why not to use GRANT ON SEQUENCE = ?
>

Because that was = the way to do it before 8.2 iirc. And it still works. Nevertheless I'll = look into it.

------=_NextPart_000_0210_01CF9F89.6E235920--