gooderp18绿色标准版
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

33 lines
4.0KB

  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>33.16. The Connection Service File</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="libpq-pgpass.html" title="33.15. The Password File" /><link rel="next" href="libpq-ldap.html" title="33.17. LDAP Lookup of Connection Parameters" /></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">33.16. The Connection Service File</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="libpq-pgpass.html" title="33.15. The Password File">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="libpq.html" title="Chapter 33. libpq - C Library">Up</a></td><th width="60%" align="center">Chapter 33. <span xmlns="http://www.w3.org/1999/xhtml" class="application">libpq</span> - C Library</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="libpq-ldap.html" title="33.17. LDAP Lookup of Connection Parameters">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="LIBPQ-PGSERVICE"><div class="titlepage"><div><div><h2 class="title" style="clear: both">33.16. The Connection Service File</h2></div></div></div><a id="id-1.7.3.23.2" class="indexterm"></a><a id="id-1.7.3.23.3" class="indexterm"></a><a id="id-1.7.3.23.4" class="indexterm"></a><p>
  3. The connection service file allows libpq connection parameters to be
  4. associated with a single service name. That service name can then be
  5. specified by a libpq connection, and the associated settings will be
  6. used. This allows connection parameters to be modified without requiring
  7. a recompile of the libpq application. The service name can also be
  8. specified using the <code class="envar">PGSERVICE</code> environment variable.
  9. </p><p>
  10. The connection service file can be a per-user service file
  11. at <code class="filename">~/.pg_service.conf</code> or the location
  12. specified by the environment variable <code class="envar">PGSERVICEFILE</code>,
  13. or it can be a system-wide file
  14. at <code class="filename">`pg_config --sysconfdir`/pg_service.conf</code> or in the directory
  15. specified by the environment variable
  16. <code class="envar">PGSYSCONFDIR</code>. If service definitions with the same
  17. name exist in the user and the system file, the user file takes
  18. precedence.
  19. </p><p>
  20. The file uses an <span class="quote">“<span class="quote">INI file</span>”</span> format where the section
  21. name is the service name and the parameters are connection
  22. parameters; see <a class="xref" href="libpq-connect.html#LIBPQ-PARAMKEYWORDS" title="33.1.2. Parameter Key Words">Section 33.1.2</a> for a list. For
  23. example:
  24. </p><pre class="programlisting">
  25. # comment
  26. [mydb]
  27. host=somehost
  28. port=5433
  29. user=admin
  30. </pre><p>
  31. An example file is provided at
  32. <code class="filename">share/pg_service.conf.sample</code>.
  33. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="libpq-pgpass.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="libpq.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="libpq-ldap.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">33.15. The Password File </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 33.17. LDAP Lookup of Connection Parameters</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1