note 80093 added to function.pg-connect
| From: | tim at buttersideup dot com | Date: | Fri, 28 Dec 2007 18:41:43 +0000 |
| Subject: | note 80093 added to function.pg-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-134082@lists.php.net to get a copy of this message | ||
It's not explicitly stated here, but 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.3
Probable Submitter: 87.194.253.157
----
Manual Page -- http://www.php.net/manual/en/function.pg-connect.php
Edit -- https://master.php.net/note/edit/80093
Del: integrated -- https://master.php.net/note/delete/80093/integrated
Del: useless -- https://master.php.net/note/delete/80093/useless
Del: bad code -- https://master.php.net/note/delete/80093/bad+code
Del: spam -- https://master.php.net/note/delete/80093/spam
Del: non-english -- https://master.php.net/note/delete/80093/non-english
Del: in docs -- https://master.php.net/note/delete/80093/in+docs
Del: other reasons-- https://master.php.net/note/delete/80093
Reject -- https://master.php.net/note/reject/80093
Search -- https://master.php.net/manage/user-notes.php