3 The connection to the PostgreSQL server.
5 See the [General Usage](pq/Connection/: General Usage) page for an introduction on how to use this class.
10 (Re-)open a persistent connection.
12 If the connection is not already open, perform the connection attempt [asynchronously](pq/Connection/: Asynchronous Usage).
14 ### Connection Status:
16 Everything well; if a connection has been newly and synchronously created, the connection will always have this status right after creation.
18 Broken connection; consider pq\Connection::reset() or recreation.
20 Waiting for connection to be made.
22 Connection okay; waiting to send.
24 Waiting for a response from the server.
26 Received authentication; waiting for backend start-up to finish.
28 Negotiating SSL encryption.
30 Negotiating environment-driven parameter settings.
32 ### Transaction Status:
34 No active transaction.
36 A transaction command is in progress.
38 Idling in a valid transcation block.
40 Idling in a failed transaction block.
46 The connection procedure has failed.
48 Select for read-readiness.
50 Select for write-readiness.
52 The connection has been successfully made.
54 ### Event Listener Types:
56 Register the event handler for notices.
58 Register the event handler for any created results.
60 Register the event handler for connection resets.
64 * public (readonly) $status
65 A [connection status constant](pq/Connection#Connection.Status:) value.
66 * public (readonly) $transactionStatus
67 A [transaction status constant](pq/Connection#Transaction.Status:) value.
68 * public (readonly) $socket
69 The server socket resource.
70 * public (readonly) $busy
71 Whether the connection is busy with [asynchronous operations](pq/Connection/: Asynchronous Usage).
72 * public (readonly) $errorMessage
73 Any error message on failure.
74 * public (readonly) $eventHandlers
75 List of registered event handlers.
76 * public $encoding = NULL
77 Connection character set.
78 * public $unbuffered = FALSE
79 Whether to fetch [asynchronous](pq/Connection/: Asynchronous Usage) results in unbuffered mode, i.e. each row generates a distinct pq\Result.
81 ### Connection Information:
82 * public (readonly) $db
83 The database name of the connection.
84 * public (readonly) $user
85 The user name of the connection.
86 * public (readonly) $pass
87 The password of the connection.
88 * public (readonly) $host
89 The server host name of the connection.
90 * public (readonly) $port
91 The port of the connection.
92 * public (readonly) $options
93 The command-line options passed in the connection request.
95 ### Inheritable Defaults:
96 * public $defaultFetchType = pq\Result::FETCH_ARRAY
97 Default fetch type for future pq\Result instances.
98 * public $defaultAutoConvert = pq\Result::CONV_ALL
99 Default conversion bitmask for future pq\Result instances.
100 * public $defaultTransactionIsolation = pq\Transaction::READ_COMMITTED
101 Default transaction isolation level for future pq\Transaction instances.
102 * public $defaultTransactionReadonly = FALSE
103 Default transaction readonlyness for futire pq\Transaction instances.
104 * public $defaultTransactionDeferrable = FALSE
105 Default transaction deferrability for future pq\Transaction instances.