gooderp18绿色标准版
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

55 lignes
6.8KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>21.5. Default Roles</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="role-removal.html" title="21.4. Dropping Roles" /><link rel="next" href="perm-functions.html" title="21.6. Function Security" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">21.5. Default Roles</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="role-removal.html" title="21.4. Dropping Roles">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="user-manag.html" title="Chapter 21. Database Roles">Up</a></td><th width="60%" align="center">Chapter 21. Database Roles</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="perm-functions.html" title="21.6. Function Security">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="DEFAULT-ROLES"><div class="titlepage"><div><div><h2 class="title" style="clear: both">21.5. Default Roles</h2></div></div></div><a id="id-1.6.8.9.2" class="indexterm"></a><p>
  3. <span class="productname">PostgreSQL</span> provides a set of default roles
  4. which provide access to certain, commonly needed, privileged capabilities
  5. and information. Administrators can GRANT these roles to users and/or
  6. other roles in their environment, providing those users with access to
  7. the specified capabilities and information.
  8. </p><p>
  9. The default roles are described in <a class="xref" href="default-roles.html#DEFAULT-ROLES-TABLE" title="Table 21.1. Default Roles">Table 21.1</a>.
  10. Note that the specific permissions for each of the default roles may
  11. change in the future as additional capabilities are added. Administrators
  12. should monitor the release notes for changes.
  13. </p><div class="table" id="DEFAULT-ROLES-TABLE"><p class="title"><strong>Table 21.1. Default Roles</strong></p><div class="table-contents"><table class="table" summary="Default Roles" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Role</th><th>Allowed Access</th></tr></thead><tbody><tr><td>pg_read_all_settings</td><td>Read all configuration variables, even those normally visible only to
  14. superusers.</td></tr><tr><td>pg_read_all_stats</td><td>Read all pg_stat_* views and use various statistics related extensions,
  15. even those normally visible only to superusers.</td></tr><tr><td>pg_stat_scan_tables</td><td>Execute monitoring functions that may take <code class="literal">ACCESS SHARE</code> locks on tables,
  16. potentially for a long time.</td></tr><tr><td>pg_monitor</td><td>Read/execute various monitoring views and functions.
  17. This role is a member of <code class="literal">pg_read_all_settings</code>,
  18. <code class="literal">pg_read_all_stats</code> and
  19. <code class="literal">pg_stat_scan_tables</code>.</td></tr><tr><td>pg_signal_backend</td><td>Signal another backend to cancel a query or terminate its session.</td></tr><tr><td>pg_read_server_files</td><td>Allow reading files from any location the database can access on the server with COPY and
  20. other file-access functions.</td></tr><tr><td>pg_write_server_files</td><td>Allow writing to files in any location the database can access on the server with COPY and
  21. other file-access functions.</td></tr><tr><td>pg_execute_server_program</td><td>Allow executing programs on the database server as the user the database runs as with
  22. COPY and other functions which allow executing a server-side program.</td></tr></tbody></table></div></div><br class="table-break" /><p>
  23. The <code class="literal">pg_monitor</code>, <code class="literal">pg_read_all_settings</code>,
  24. <code class="literal">pg_read_all_stats</code> and <code class="literal">pg_stat_scan_tables</code>
  25. roles are intended to allow administrators to easily configure a role for the
  26. purpose of monitoring the database server. They grant a set of common privileges
  27. allowing the role to read various useful configuration settings, statistics and
  28. other system information normally restricted to superusers.
  29. </p><p>
  30. The <code class="literal">pg_signal_backend</code> role is intended to allow
  31. administrators to enable trusted, but non-superuser, roles to send signals
  32. to other backends. Currently this role enables sending of signals for
  33. canceling a query on another backend or terminating its session. A user
  34. granted this role cannot however send signals to a backend owned by a
  35. superuser. See <a class="xref" href="functions-admin.html#FUNCTIONS-ADMIN-SIGNAL" title="9.26.2. Server Signaling Functions">Section 9.26.2</a>.
  36. </p><p>
  37. The <code class="literal">pg_read_server_files</code>, <code class="literal">pg_write_server_files</code> and
  38. <code class="literal">pg_execute_server_program</code> roles are intended to allow administrators to have
  39. trusted, but non-superuser, roles which are able to access files and run programs on the
  40. database server as the user the database runs as. As these roles are able to access any file on
  41. the server file system, they bypass all database-level permission checks when accessing files
  42. directly and they could be used to gain superuser-level access, therefore
  43. great care should be taken when granting these roles to users.
  44. </p><p>
  45. Care should be taken when granting these roles to ensure they are only used where
  46. needed and with the understanding that these roles grant access to privileged
  47. information.
  48. </p><p>
  49. Administrators can grant access to these roles to users using the
  50. <a class="xref" href="sql-grant.html" title="GRANT"><span class="refentrytitle">GRANT</span></a> command, for example:
  51. </p><pre class="programlisting">
  52. GRANT pg_signal_backend TO admin_user;
  53. </pre><p>
  54. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="role-removal.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="user-manag.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="perm-functions.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">21.4. Dropping Roles </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 21.6. Function Security</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1