1 # void pq\Connection::__construct([string $dsn = ""[, int $flags = 0]])
3 Create a new PostgreSQL connection.
4 See also [General Usage](pq/Connection/: General Usage).
7 * Optional string $dsn = ""
8 A ***connection string*** as described [in the PostgreSQL documentation](http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING).
9 * Optional int $flags = 0
10 See [connection flag constants](pq/Connection#Connection.Flags:).
14 * pq\Exception\InvalidArgumentException
15 * pq\Exception\BadMethodCallException
16 * pq\Exception\RuntimeException
22 $connection = new pq\Connection("dbname=test user=test password=test",
23 pq\Connection::ASYNC | pq\Connection::PERSISTENT);