note 80091 added to ref.pdo-pgsql.connection
| From: | tim at buttersideup dot com | Date: | Fri, 28 Dec 2007 18:35:16 +0000 |
| Subject: | note 80091 added to ref.pdo-pgsql.connection | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-134080@lists.php.net to get a copy of this message | ||
You can also connect to PostgreSQL via a UNIX domain socket by leaving the host empty. This should
have less overhead than using TCP e.g.:
$dbh = new PDO('pgsql:user=exampleuser dbname=exampledb password=examplepass');
In fact as the C library call PQconnectdb underlies this implementation, you can supply anything
that this library call would take - the "pgsql:" prefix gets stripped off before
PQconnectdb is called, and if you supply any of the optional arguments (e.g. user), then these
arguments will be added to the string that you supplied... Check the docs for your relevant
PostgreSQL client library: e.g.
http://www.postgresql.org/docs/8.3/static/libpq-connect.html
If you really want, you can use ';'s to separate your arguments - these will just be
converted to spaces before PQconnectdb is called.
Tim.
----
Server IP: 194.145.210.4
Probable Submitter: 87.194.253.157
----
Manual Page -- http://www.php.net/manual/en/ref.pdo-pgsql.connection.php
Edit -- https://master.php.net/note/edit/80091
Del: integrated -- https://master.php.net/note/delete/80091/integrated
Del: useless -- https://master.php.net/note/delete/80091/useless
Del: bad code -- https://master.php.net/note/delete/80091/bad+code
Del: spam -- https://master.php.net/note/delete/80091/spam
Del: non-english -- https://master.php.net/note/delete/80091/non-english
Del: in docs -- https://master.php.net/note/delete/80091/in+docs
Del: other reasons-- https://master.php.net/note/delete/80091
Reject -- https://master.php.net/note/reject/80091
Search -- https://master.php.net/manage/user-notes.php