mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Code review for GRANT CONNECT patch. Spell the privilege as CONNECT not
CONNECTION, fix a number of places that were missed (eg pg_dump support), avoid executing an extra search of pg_database during startup.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.88 2006/04/30 02:09:06 momjian Exp $ -->
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.89 2006/04/30 21:15:32 tgl Exp $ -->
|
||||
|
||||
<chapter id="client-authentication">
|
||||
<title>Client Authentication</title>
|
||||
@@ -206,8 +206,6 @@ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable>
|
||||
Multiple user names can be supplied by separating them with commas.
|
||||
A separate file containing user names can be specified by preceding the
|
||||
file name with <literal>@</>.
|
||||
User and group connectivity can also be restricted by <command>GRANT
|
||||
CONNECTION ON DATABASE</>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -436,6 +434,17 @@ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable>
|
||||
re-read the file.
|
||||
</para>
|
||||
|
||||
<tip>
|
||||
<para>
|
||||
To connect to a particular database, a user must not only pass the
|
||||
<filename>pg_hba.conf</filename> checks, but must have the
|
||||
<literal>CONNECT</> privilege for the database. If you wish to
|
||||
restrict which users can connect to which databases, it's usually
|
||||
easier to control this by granting/revoking <literal>CONNECT</> privilege
|
||||
than to put the rules into <filename>pg_hba.conf</filename> entries.
|
||||
</para>
|
||||
</tip>
|
||||
|
||||
<para>
|
||||
Some examples of <filename>pg_hba.conf</filename> entries are shown in
|
||||
<xref linkend="example-pg-hba.conf">. See the next section for details on the
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/ddl.sgml,v 1.56 2006/04/23 03:39:50 momjian Exp $ -->
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/ddl.sgml,v 1.57 2006/04/30 21:15:32 tgl Exp $ -->
|
||||
|
||||
<chapter id="ddl">
|
||||
<title>Data Definition</title>
|
||||
@@ -1343,8 +1343,9 @@ ALTER TABLE products RENAME TO items;
|
||||
There are several different privileges: <literal>SELECT</>,
|
||||
<literal>INSERT</>, <literal>UPDATE</>, <literal>DELETE</>,
|
||||
<literal>RULE</>, <literal>REFERENCES</>, <literal>TRIGGER</>,
|
||||
<literal>CREATE</>, <literal>TEMPORARY</>, <literal>EXECUTE</>, and
|
||||
<literal>USAGE</>. The privileges applicable to a particular
|
||||
<literal>CREATE</>, <literal>CONNECT</>, <literal>TEMPORARY</>,
|
||||
<literal>EXECUTE</>, and <literal>USAGE</>.
|
||||
The privileges applicable to a particular
|
||||
object vary depending on the object's type (table, function, etc).
|
||||
For complete information on the different types of privileges
|
||||
supported by <productname>PostgreSQL</productname>, refer to the
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.315 2006/04/25 00:25:15 momjian Exp $ -->
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.316 2006/04/30 21:15:32 tgl Exp $ -->
|
||||
|
||||
<chapter id="functions">
|
||||
<title>Functions and Operators</title>
|
||||
@@ -9227,6 +9227,7 @@ SELECT has_table_privilege('myschema.mytable', 'select');
|
||||
arguments are analogous to <function>has_table_privilege</function>.
|
||||
The desired access privilege type must evaluate to
|
||||
<literal>CREATE</literal>,
|
||||
<literal>CONNECT</literal>,
|
||||
<literal>TEMPORARY</literal>, or
|
||||
<literal>TEMP</literal> (which is equivalent to
|
||||
<literal>TEMPORARY</literal>).
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$PostgreSQL: pgsql/doc/src/sgml/ref/grant.sgml,v 1.53 2006/04/30 02:09:06 momjian Exp $
|
||||
$PostgreSQL: pgsql/doc/src/sgml/ref/grant.sgml,v 1.54 2006/04/30 21:15:33 tgl Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -30,7 +30,7 @@ GRANT { { USAGE | SELECT | UPDATE }
|
||||
ON SEQUENCE <replaceable class="PARAMETER">sequencename</replaceable> [, ...]
|
||||
TO { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
||||
|
||||
GRANT { { CREATE | TEMPORARY | TEMP | CONNECTION } [,...] | ALL [ PRIVILEGES ] }
|
||||
GRANT { { CREATE | CONNECT | TEMPORARY | TEMP } [,...] | ALL [ PRIVILEGES ] }
|
||||
ON DATABASE <replaceable>dbname</replaceable> [, ...]
|
||||
TO { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...] [ WITH GRANT OPTION ]
|
||||
|
||||
@@ -118,7 +118,8 @@ GRANT <replaceable class="PARAMETER">role</replaceable> [, ...]
|
||||
Depending on the type of object, the initial default privileges may
|
||||
include granting some privileges to <literal>PUBLIC</literal>.
|
||||
The default is no public access for tables, schemas, and tablespaces;
|
||||
<literal>TEMP</> table creation privilege for databases;
|
||||
<literal>CONNECT</> privilege and <literal>TEMP</> table creation privilege
|
||||
for databases;
|
||||
<literal>EXECUTE</> privilege for functions; and
|
||||
<literal>USAGE</> privilege for languages.
|
||||
The object owner may of course revoke these privileges. (For maximum
|
||||
@@ -230,13 +231,12 @@ GRANT <replaceable class="PARAMETER">role</replaceable> [, ...]
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>CONNECTION</term>
|
||||
<term>CONNECT</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Allows the ability to connect to the specified database.
|
||||
By default, Grant permissions allow users to connect to any database,
|
||||
though <filename>pg_hba.conf</> can add additional connection
|
||||
restrictions.
|
||||
Allows the user to connect to the specified database. This
|
||||
privilege is checked at connection startup (in addition to checking
|
||||
any restrictions imposed by <filename>pg_hba.conf</>).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -429,7 +429,7 @@ GRANT <replaceable class="PARAMETER">role</replaceable> [, ...]
|
||||
X -- EXECUTE
|
||||
U -- USAGE
|
||||
C -- CREATE
|
||||
c -- CONNECTION
|
||||
c -- CONNECT
|
||||
T -- TEMPORARY
|
||||
arwdRxt -- ALL PRIVILEGES (for tables)
|
||||
* -- grant option for preceding privilege
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$PostgreSQL: pgsql/doc/src/sgml/ref/revoke.sgml,v 1.37 2006/04/30 02:09:06 momjian Exp $
|
||||
$PostgreSQL: pgsql/doc/src/sgml/ref/revoke.sgml,v 1.38 2006/04/30 21:15:33 tgl Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -35,7 +35,7 @@ REVOKE [ GRANT OPTION FOR ]
|
||||
[ CASCADE | RESTRICT ]
|
||||
|
||||
REVOKE [ GRANT OPTION FOR ]
|
||||
{ { CREATE | TEMPORARY | TEMP | CONNECTION } [,...] | ALL [ PRIVILEGES ] }
|
||||
{ { CREATE | CONNECT | TEMPORARY | TEMP } [,...] | ALL [ PRIVILEGES ] }
|
||||
ON DATABASE <replaceable>dbname</replaceable> [, ...]
|
||||
FROM { <replaceable class="PARAMETER">username</replaceable> | GROUP <replaceable class="PARAMETER">groupname</replaceable> | PUBLIC } [, ...]
|
||||
[ CASCADE | RESTRICT ]
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/user-manag.sgml,v 1.34 2006/03/10 19:10:49 momjian Exp $ -->
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/user-manag.sgml,v 1.35 2006/04/30 21:15:32 tgl Exp $ -->
|
||||
|
||||
<chapter id="user-manag">
|
||||
<title>Database Roles and Privileges</title>
|
||||
@@ -294,9 +294,9 @@ ALTER ROLE myname SET enable_indexscan TO off;
|
||||
There are several different kinds of privilege: <literal>SELECT</>,
|
||||
<literal>INSERT</>, <literal>UPDATE</>, <literal>DELETE</>,
|
||||
<literal>RULE</>, <literal>REFERENCES</>, <literal>TRIGGER</>,
|
||||
<literal>CREATE</>, <literal>TEMPORARY</>, <literal>EXECUTE</>,
|
||||
and <literal>USAGE</>. For more
|
||||
information on the different types of privileges supported by
|
||||
<literal>CREATE</>, <literal>CONNECT</>, <literal>TEMPORARY</>,
|
||||
<literal>EXECUTE</>, and <literal>USAGE</>.
|
||||
For more information on the different types of privileges supported by
|
||||
<productname>PostgreSQL</productname>, see the
|
||||
<xref linkend="sql-grant" endterm="sql-grant-title"> reference page.
|
||||
</para>
|
||||
|
Reference in New Issue
Block a user