3 A class representing a 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 OK; 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 $encoding = NULL
75 Connection character set.
76 * public $unbuffered = FALSE
77 Whether to fetch results in unbuffered mode, i.e. each row generates a distinct pq\Result.
79 ### Connection Information:
80 * public (readonly) $db
81 The database name of the connection.
82 * public (readonly) $user
83 The user name of the connection.
84 * public (readonly) $pass
85 The password of the connection.
86 * public (readonly) $host
87 The server host name of the connection.
88 * public (readonly) $port
89 The port of the connection.
90 * public (readonly) $options
91 The command-line options passed in the connection request.