<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.pdo-pgsql.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'ref.pdo-pgsql.connection.php',
    1 => 'PDO_PGSQL DSN',
    2 => 'Connecting to PostgreSQL databases',
  ),
  'up' => 
  array (
    0 => 'ref.pdo-pgsql.php',
    1 => 'PostgreSQL PDO Driver',
  ),
  'prev' => 
  array (
    0 => 'ref.pdo-pgsql.php',
    1 => 'PostgreSQL PDO Driver',
  ),
  'next' => 
  array (
    0 => 'pdo.pgsqlcopyfromarray.php',
    1 => 'PDO::pgsqlCopyFromArray',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/pdo_pgsql/reference.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="ref.pdo-pgsql.connection" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">PDO_PGSQL DSN</h1>
    <p class="verinfo">(PHP 5 &gt;= 5.1.0, PHP 7, PECL PDO_PGSQL &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">PDO_PGSQL DSN</span> &mdash; <span class="dc-title">Connecting to PostgreSQL databases</span></p>

   </div>

   <div class="refsect1 description" id="refsect1-ref.pdo-pgsql.connection-description">
    <h3 class="title">Beschreibung</h3>
    <p class="para">
     The PDO_PGSQL Data Source Name (DSN) is composed of the following elements, delimited by spaces or semicolons:
     <dl>
      
       <dt>DSN prefix</dt>
       <dd>
        <p class="para">
        The DSN prefix is <strong class="userinput"><code>pgsql:</code></strong>.
        </p>
       </dd>
      
      
       <dt><code class="literal">host</code></dt>
       <dd>
        <p class="para">
         The hostname on which the database server resides.
        </p>
       </dd>
      
      
       <dt><code class="literal">port</code></dt>
       <dd>
        <p class="para">
         The port on which the database server is running.
        </p>
       </dd>
      
      
       <dt><code class="literal">dbname</code></dt>
       <dd>
        <p class="para">
         The name of the database.
        </p>
       </dd>
      
      
       <dt><code class="literal">user</code></dt>
       <dd>
        <p class="para">
         The name of the user for the connection. If you specify the user name
         in the DSN, PDO ignores the value of the user name argument in the
         PDO constructor.
        </p>
       </dd>
      
      
       <dt><code class="literal">password</code></dt>
       <dd>
        <p class="para">
         The password of the user for the connection. If you specify the
         password in the DSN, PDO ignores the value of the password argument
         in the PDO constructor.
        </p>
       </dd>
      
      
       <dt><code class="literal">sslmode</code></dt>
       <dd>
        <p class="para">
         The SSL mode. Supported values and their meaning are listed in the
         <a href="http://www.postgresql.org/docs/current/interactive/" class="link external">&raquo;&nbsp;PostgreSQL Documentation</a>.
        </p>
       </dd>
      

     </dl>
     <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
      <span class="simpara">
       All semicolons in the DSN string are replaced by spaces, because PostgreSQL
       expects this format. This implies that semicolons in any of the components
       (e.g. <code class="literal">password</code> or <code class="literal">dbname</code>) are not
       supported.
      </span>
     </p></blockquote>
    </p>
   </div>

   <div class="refsect1 examples" id="refsect1-ref.pdo-pgsql.connection-examples">
    <h3 class="title">Beispiele</h3>
    <p class="para">
     <div class="example" id="example-1">
      <p><strong>Beispiel #1 PDO_PGSQL DSN examples</strong></p>
      <div class="example-contents"><p>
       The following example shows a PDO_PGSQL DSN for connecting to
       a PostgreSQL database:
       <div class="example-contents">
<div class="cdata"><pre>
pgsql:host=localhost;port=5432;dbname=testdb;user=bruce;password=mypass
</pre></div>
       </div>

      </p></div>
      <div class="example-contents"><p>
       The following example shows a PDO_PGSQL DSN for connecting to
       a PostgreSQL database via unix socket <var class="filename">/tmp/.s.PGSQL.5432</var>:
       <div class="example-contents">
<div class="cdata"><pre>
pgsql:host=/tmp;port=5432;dbname=testdb;user=bruce;password=mypass
</pre></div>
       </div>

      </p></div>
     </div>
    </p>
   </div>

  </div><?php manual_footer($setup); ?>