1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Add has_tablespace_privilege().

Christopher Kings-Lynne
This commit is contained in:
Bruce Momjian
2004-07-12 20:23:59 +00:00
parent 1a0f3e476b
commit e47cbb3bad
5 changed files with 254 additions and 6 deletions

View File

@ -1,5 +1,5 @@
<!--
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.213 2004/07/02 22:49:45 tgl Exp $
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.214 2004/07/12 20:23:47 momjian Exp $
PostgreSQL documentation
-->
@ -6980,6 +6980,21 @@ SELECT set_config('log_statement_stats', 'off', false);
<entry><type>boolean</type></entry>
<entry>does current user have privilege for schema</entry>
</row>
<row>
<entry><literal><function>has_tablespace_privilege</function>(<parameter>user</parameter>,
<parameter>tablespace</parameter>,
<parameter>privilege</parameter>)</literal>
</entry>
<entry><type>boolean</type></entry>
<entry>does user have privilege for tablespace</entry>
</row>
<row>
<entry><literal><function>has_tablespace_privilege</function>(<parameter>tablespace</parameter>,
<parameter>privilege</parameter>)</literal>
</entry>
<entry><type>boolean</type></entry>
<entry>does current user have privilege for tablespace</entry>
</row>
</tbody>
</tgroup>
</table>
@ -6999,6 +7014,9 @@ SELECT set_config('log_statement_stats', 'off', false);
<indexterm zone="functions-misc">
<primary>has_schema_privilege</primary>
</indexterm>
<indexterm zone="functions-misc">
<primary>has_tablespace_privilege</primary>
</indexterm>
<para>
<function>has_table_privilege</function> checks whether a user
@ -7064,6 +7082,14 @@ SELECT has_function_privilege('joeuser', 'myfunc(int, text)', 'execute');
<literal>USAGE</literal>.
</para>
<para>
<function>has_tablespace_privilege</function> checks whether a user
can access a tablespace in a particular way. The possibilities for its
arguments are analogous to <function>has_table_privilege</function>.
The desired access privilege type must evaluate to
<literal>CREATE</literal>.
</para>
<para>
To evaluate whether a user holds a grant option on the privilege,
append <literal> WITH GRANT OPTION</literal> to the privilege key