Home Explore Blog CI



postgresql

19th chunk of `doc/src/sgml/postgres-fdw.sgml`
5536bd704ea78828d828c9eefae71a7db814c98870afe7a0000000010000090a
 linkend="guc-application-name"/> for details.
     </para>

     <para>
      <literal>%</literal> characters begin <quote>escape sequences</quote>
      that are replaced with status information as outlined below.
      Unrecognized escapes are ignored. Other characters are copied straight
      to the application name. Note that it's not allowed to specify a
      plus/minus sign or a numeric literal after the <literal>%</literal>
      and before the option, for alignment and padding.
     </para>

     <informaltable>
      <tgroup cols="2">
       <thead>
        <row>
         <entry>Escape</entry>
         <entry>Effect</entry>
        </row>
       </thead>
       <tbody>
        <row>
         <entry><literal>%a</literal></entry>
         <entry>Application name on local server</entry>
        </row>
        <row>
         <entry><literal>%c</literal></entry>
         <entry>
          Session ID on local server
          (see <xref linkend="guc-log-line-prefix"/> for details)
         </entry>
        </row>
        <row>
         <entry><literal>%C</literal></entry>
         <entry>
          Cluster name on local server
          (see <xref linkend="guc-cluster-name"/> for details)
         </entry>
        </row>
        <row>
         <entry><literal>%u</literal></entry>
         <entry>User name on local server</entry>
        </row>
        <row>
         <entry><literal>%d</literal></entry>
         <entry>Database name on local server</entry>
        </row>
        <row>
         <entry><literal>%p</literal></entry>
         <entry>Process ID of backend on local server</entry>
        </row>
        <row>
         <entry><literal>%%</literal></entry>
         <entry>Literal %</entry>
        </row>
       </tbody>
      </tgroup>
     </informaltable>

     <para>
      For example, suppose user <literal>local_user</literal> establishes
      a connection from database <literal>local_db</literal> to
      <literal>foreign_db</literal> as user <literal>foreign_user</literal>,
      the setting <literal>'db=%d, user=%u'</literal> is replaced with
      <literal>'db=local_db, user=local_user'</literal>.
     </para>

    </listitem>
   </varlistentry>
  </variablelist>
 </sect2>

 <sect2 id="postgres-fdw-examples">
  <title>Examples</title>

  <para>
   Here

Title: Postgres FDW Application Name Configuration and Examples
Summary
The postgres_fdw.application_name configuration parameter allows for customization of the application name used when connecting to a foreign server, supporting escape sequences for status information such as application name, session ID, cluster name, user name, database name, and process ID. Examples demonstrate how to use these escape sequences to dynamically set the application name based on local server information.