|
1 |
| -<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.60 2001/06/13 22:51:02 momjian Exp $ --> |
| 1 | +<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.61 2001/06/15 21:03:07 tgl Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="functions">
|
4 | 4 | <title>Functions and Operators</title>
|
@@ -3570,7 +3570,7 @@ SELECT NULLIF(value, '(none)') ...
|
3570 | 3570 | <title>Miscellaneous Functions</>
|
3571 | 3571 |
|
3572 | 3572 | <table>
|
3573 |
| - <title>Miscellaneous Functions</> |
| 3573 | + <title>Session Information Functions</> |
3574 | 3574 | <tgroup cols="3">
|
3575 | 3575 | <thead>
|
3576 | 3576 | <row><entry>Name</> <entry>Return Type</> <entry>Description</></row>
|
@@ -3624,6 +3624,52 @@ SELECT NULLIF(value, '(none)') ...
|
3624 | 3624 | of <function>current_user</>.
|
3625 | 3625 | </para>
|
3626 | 3626 | </note>
|
| 3627 | + |
| 3628 | + <table> |
| 3629 | + <title>Access Privilege Inquiry Functions</> |
| 3630 | + <tgroup cols="3"> |
| 3631 | + <thead> |
| 3632 | + <row><entry>Name</> <entry>Return Type</> <entry>Description</></row> |
| 3633 | + </thead> |
| 3634 | + |
| 3635 | + <tbody> |
| 3636 | + <row> |
| 3637 | + <entry>has_table_privilege(<parameter>user</parameter>, |
| 3638 | + <parameter>table</parameter>, |
| 3639 | + <parameter>access</parameter>) |
| 3640 | + </entry> |
| 3641 | + <entry>boolean</> |
| 3642 | + <entry>does user have access to table</> |
| 3643 | + </row> |
| 3644 | + <row> |
| 3645 | + <entry>has_table_privilege(<parameter>table</parameter>, |
| 3646 | + <parameter>access</parameter>) |
| 3647 | + </entry> |
| 3648 | + <entry>boolean</> |
| 3649 | + <entry>does current user have access to table</> |
| 3650 | + </row> |
| 3651 | + </tbody> |
| 3652 | + </tgroup> |
| 3653 | + </table> |
| 3654 | + |
| 3655 | + <indexterm zone="functions-misc"> |
| 3656 | + <primary>has_table_privilege</primary> |
| 3657 | + </indexterm> |
| 3658 | + |
| 3659 | + <para> |
| 3660 | + <function>has_table_privilege</> determines whether a user |
| 3661 | + can access a table in a particular way. The user can be |
| 3662 | + specified by name or by usesysid, or if the argument is omitted |
| 3663 | + <function>current_user</> is assumed. The table can be specified |
| 3664 | + by name or by OID. (Thus, there are actually six variants of |
| 3665 | + <function>has_table_privilege</>, which can be distinguished by |
| 3666 | + the number and types of their arguments.) The desired access type |
| 3667 | + is specified by a text string, which must evaluate to one of the |
| 3668 | + values <literal>SELECT</>, <literal>INSERT</>, <literal>UPDATE</>, |
| 3669 | + <literal>DELETE</>, <literal>RULE</>, <literal>REFERENCES</>, or |
| 3670 | + <literal>TRIGGER</>. (Case of the string is not significant, however.) |
| 3671 | + </para> |
| 3672 | + |
3627 | 3673 | </sect1>
|
3628 | 3674 |
|
3629 | 3675 |
|
|
0 commit comments