gooderp18绿色标准版
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

54 行
6.7KB

  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>F.1. adminpack</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="contrib.html" title="Appendix F. Additional Supplied Modules" /><link rel="next" href="amcheck.html" title="F.2. amcheck" /></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">F.1. adminpack</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="contrib.html" title="Appendix F. Additional Supplied Modules">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="contrib.html" title="Appendix F. Additional Supplied Modules">Up</a></td><th width="60%" align="center">Appendix F. Additional Supplied Modules</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="amcheck.html" title="F.2. amcheck">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="ADMINPACK"><div class="titlepage"><div><div><h2 class="title" style="clear: both">F.1. adminpack</h2></div></div></div><a id="id-1.11.7.10.2" class="indexterm"></a><p>
  3. <code class="filename">adminpack</code> provides a number of support functions which
  4. <span class="application">pgAdmin</span> and other administration and management tools can
  5. use to provide additional functionality, such as remote management
  6. of server log files.
  7. Use of all these functions is only allowed to the superuser by default but may be
  8. allowed to other users by using the <code class="command">GRANT</code> command.
  9. </p><p>
  10. The functions shown in <a class="xref" href="adminpack.html#FUNCTIONS-ADMINPACK-TABLE" title="Table F.1. adminpack Functions">Table F.1</a> provide
  11. write access to files on the machine hosting the server. (See also the
  12. functions in <a class="xref" href="functions-admin.html#FUNCTIONS-ADMIN-GENFILE-TABLE" title="Table 9.94. Generic File Access Functions">Table 9.94</a>, which
  13. provide read-only access.)
  14. Only files within the database cluster directory can be accessed, unless the
  15. user is a superuser or given one of the pg_read_server_files, or pg_write_server_files
  16. roles, as appropriate for the function, but either a relative or absolute path is
  17. allowable.
  18. </p><div class="table" id="FUNCTIONS-ADMINPACK-TABLE"><p class="title"><strong>Table F.1. <code class="filename">adminpack</code> Functions</strong></p><div class="table-contents"><table class="table" summary="adminpack Functions" border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>Name</th><th>Return Type</th><th>Description</th></tr></thead><tbody><tr><td><code class="function">pg_catalog.pg_file_write(filename text, data text, append boolean)</code></td><td><code class="type">bigint</code></td><td>
  19. Write, or append to, a text file
  20. </td></tr><tr><td><code class="function">pg_catalog.pg_file_rename(oldname text, newname text [<span class="optional">, archivename text</span>])</code></td><td><code class="type">boolean</code></td><td>
  21. Rename a file
  22. </td></tr><tr><td><code class="function">pg_catalog.pg_file_unlink(filename text)</code></td><td><code class="type">boolean</code></td><td>
  23. Remove a file
  24. </td></tr><tr><td><code class="function">pg_catalog.pg_logdir_ls()</code></td><td><code class="type">setof record</code></td><td>
  25. List the log files in the <code class="varname">log_directory</code> directory
  26. </td></tr></tbody></table></div></div><br class="table-break" /><a id="id-1.11.7.10.6" class="indexterm"></a><p>
  27. <code class="function">pg_file_write</code> writes the specified <em class="parameter"><code>data</code></em> into
  28. the file named by <em class="parameter"><code>filename</code></em>. If <em class="parameter"><code>append</code></em> is
  29. false, the file must not already exist. If <em class="parameter"><code>append</code></em> is true,
  30. the file can already exist, and will be appended to if so.
  31. Returns the number of bytes written.
  32. </p><a id="id-1.11.7.10.8" class="indexterm"></a><p>
  33. <code class="function">pg_file_rename</code> renames a file. If <em class="parameter"><code>archivename</code></em>
  34. is omitted or NULL, it simply renames <em class="parameter"><code>oldname</code></em>
  35. to <em class="parameter"><code>newname</code></em> (which must not already exist).
  36. If <em class="parameter"><code>archivename</code></em> is provided, it first
  37. renames <em class="parameter"><code>newname</code></em> to <em class="parameter"><code>archivename</code></em> (which must
  38. not already exist), and then renames <em class="parameter"><code>oldname</code></em>
  39. to <em class="parameter"><code>newname</code></em>. In event of failure of the second rename step,
  40. it will try to rename <em class="parameter"><code>archivename</code></em> back
  41. to <em class="parameter"><code>newname</code></em> before reporting the error.
  42. Returns true on success, false if the source file(s) are not present or
  43. not writable; other cases throw errors.
  44. </p><a id="id-1.11.7.10.10" class="indexterm"></a><p>
  45. <code class="function">pg_file_unlink</code> removes the specified file.
  46. Returns true on success, false if the specified file is not present
  47. or the <code class="function">unlink()</code> call fails; other cases throw errors.
  48. </p><a id="id-1.11.7.10.12" class="indexterm"></a><p>
  49. <code class="function">pg_logdir_ls</code> returns the start timestamps and path
  50. names of all the log files in the <a class="xref" href="runtime-config-logging.html#GUC-LOG-DIRECTORY">log_directory</a>
  51. directory. The <a class="xref" href="runtime-config-logging.html#GUC-LOG-FILENAME">log_filename</a> parameter must have its
  52. default setting (<code class="literal">postgresql-%Y-%m-%d_%H%M%S.log</code>) to use this
  53. function.
  54. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="contrib.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="contrib.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="amcheck.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix F. Additional Supplied Modules </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> F.2. amcheck</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1