📄 ref.pdo-pgsql.connection.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Connecting to PostgreSQL databases</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ref.pdo-pgsql.html">PostgreSQL (PDO)</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.pdo-pgsqllobcreate.html">PDO::pgsqlLOBCreate</a></div> <div class="up"><a href="ref.pdo-pgsql.html">PostgreSQL (PDO)</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="ref.pdo-pgsql.connection" class="refentry"> <div class="refnamediv"> <h1 class="refname">PDO_PGSQL DSN</h1> <p class="verinfo">(No version information available, might be only in CVS)</p><p class="refpurpose"><span class="refname">PDO_PGSQL DSN</span> — <span class="dc-title">Connecting to PostgreSQL databases</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <p class="para"> The PDO_PGSQL Data Source Name (DSN) is composed of the following elements, delimited by spaces: <dl> <dt> <span class="term">DSN prefix</span> <dd> <p class="para"> The DSN prefix is <strong class="userinput"><code>pgsql:</code></strong>. </p> </dd> </dt> <dt> <span class="term"><b><tt>host</tt></b></span> <dd> <p class="para"> The hostname on which the database server resides. </p> </dd> </dt> <dt> <span class="term"><b><tt>port</tt></b></span> <dd> <p class="para"> The port on which the database server is running. </p> </dd> </dt> <dt> <span class="term"><b><tt>dbname</tt></b></span> <dd> <p class="para"> The name of the database. </p> </dd> </dt> <dt> <span class="term"><b><tt>user</tt></b></span> <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> <dt> <span class="term"><b><tt>password</tt></b></span> <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> </dl> </p> <blockquote><p><b class="note">Note</b>: The <i>bytea</i> fields are returned as streams. <br /> </p></blockquote> </div> <div class="refsect1 examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example"> <p><b>Example #1 PDO_PGSQL DSN examples</b></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> </p> </div> </div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ref.pdo-pgsql.html">PostgreSQL (PDO)</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.pdo-pgsqllobcreate.html">PDO::pgsqlLOBCreate</a></div> <div class="up"><a href="ref.pdo-pgsql.html">PostgreSQL (PDO)</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -