3 * This is a modern binding to the mature [libpq](http://www.postgresql.org/docs/current/static/libpq.html), the official PostgreSQL C-client library.
7 * * Nearly 100% support for [asynchronous usage](pq/Connection/: Asynchronous Usage).
8 * * Extended [type support by pg_type](pq/Types/: Overview).
9 * * Fetching simple [multi-dimensional array maps](pq/Result/map).
10 * * Working [Gateway implementation](https://bitbucket.org/m6w6/pq-gateway).
15 * Fast import/export using COPY.
19 * Start a COPY operation from STDIN to the PostgreSQL server.
23 * Start a COPY operation from the server to STDOUT.
27 * Start a COPY operation.
29 * @param \pq\Connection $conn The connection to use for the COPY operation.
30 * @param string $expression The expression generating the data to copy.
31 * @param int $direction Data direction (pq\COPY::FROM_STDIN or pq\COPY::TO_STDOUT).
32 * @param string $options Any COPY options (see the [official PostgreSQL documentation](http://www.postgresql.org/docs/current/static/sql-copy.html) for details.
33 * @throws \pq\Exception\InvalidArgumentException
34 * @throws \pq\Exception\BadMethodCallException
35 * @throws \pq\Exception\RuntimeException
37 function __construct(\pq\Connection
$conn, string $expression, int $direction, string $options = NULL) {}
39 * End the COPY operation to the server during pq\Result::COPY_IN state.
41 * @param string $error If set, the COPY operation will abort with provided message.
42 * @throws \pq\Exception\InvalidArgumentException
43 * @throws \pq\Exception\BadMethodCallException
44 * @throws \pq\Exception\RuntimeException
46 function end(string $error = NULL) {}
48 * Receive data from the server during pq\Result::COPY_OUT state.
50 * @param string $data Data read from the server.
51 * @throws \pq\Exception\InvalidArgumentException
52 * @throws \pq\Exception\BadMethodCallException
53 * @throws \pq\Exception\RuntimeException
54 * @return bool success.
56 function get(string &$data) {}
58 * Send data to the server during pq\Result::COPY_IN state.
60 * @param string $data Data to send to the server.
61 * @throws \pq\Exception\InvalidArgumentException
62 * @throws \pq\Exception\BadMethodCallException
63 * @throws \pq\Exception\RuntimeException
65 function put(string $data) {}
68 * Request cancellation of an asynchronous query.
72 * Create a new cancellation request for an [asynchronous](pq/Connection/: Asynchronous Usage) query.
74 * @param \pq\Connection $conn The connection to request cancellation on.
75 * @throws \pq\Exception\InvalidArgumentException
76 * @throws \pq\Exception\BadMethodCallException
77 * @throws \pq\Exception\RuntimeException
79 function __construct(\pq\Connection
$conn) {}
81 * Perform the cancellation request.
83 * @throws \pq\Exception\InvalidArgumentException
84 * @throws \pq\Exception\BadMethodCallException
85 * @throws \pq\Exception\RuntimeException
90 * The connection to the PostgreSQL server.
92 * See the [General Usage](pq/Connection/: General Usage) page for an introduction on how to use this class.
96 * (Re-)open a persistent connection.
100 * If the connection is not already open, perform the connection attempt [asynchronously](pq/Connection/: Asynchronous Usage).
104 * Everything well; if a connection has been newly and synchronously created, the connection will always have this status right after creation.
108 * Broken connection; consider pq\Connection::reset() or recreation.
112 * Waiting for connection to be made.
116 * Connection okay; waiting to send.
120 * Waiting for a response from the server.
122 const AWAITING_RESPONSE
= 4;
124 * Received authentication; waiting for backend start-up to finish.
128 * Negotiating SSL encryption.
130 const SSL_STARTUP
= 7;
132 * Negotiating environment-driven parameter settings.
136 * No active transaction.
138 const TRANS_IDLE
= 0;
140 * A transaction command is in progress.
142 const TRANS_ACTIVE
= 1;
144 * Idling in a valid transaction block.
146 const TRANS_INTRANS
= 2;
148 * Idling in a failed transaction block.
150 const TRANS_INERROR
= 3;
154 const TRANS_UNKNOWN
= 4;
156 * The connection procedure has failed.
158 const POLLING_FAILED
= 0;
160 * Select for read-readiness.
162 const POLLING_READING
= 1;
164 * Select for write-readiness.
166 const POLLING_WRITING
= 2;
168 * The connection has been successfully made.
170 const POLLING_OK
= 3;
172 * Register the event handler for notices.
174 const EVENT_NOTICE
= 'notice';
176 * Register the event handler for any created results.
178 const EVENT_RESULT
= 'result';
180 * Register the event handler for connection resets.
182 const EVENT_RESET
= 'reset';
184 * Connection character set.
189 public $encoding = NULL;
191 * Whether to fetch [asynchronous](pq/Connection/: Asynchronous Usage) results in unbuffered mode, i.e. each row generates a distinct pq\Result.
196 public $unbuffered = FALSE;
198 * Whether to set the underlying socket nonblocking, useful for asynchronous handling of writes. See also pq\Connection::flush().
200 * ### Connection Information:
205 public $nonblocking = FALSE;
207 * Default fetch type for future pq\Result instances.
212 public $defaultFetchType = \pq\Result
::FETCH_ARRAY
;
214 * Default conversion bitmask for future pq\Result instances.
219 public $defaultAutoConvert = \pq\Result
::CONV_ALL
;
221 * Default transaction isolation level for future pq\Transaction instances.
226 public $defaultTransactionIsolation = \pq\Transaction
::READ_COMMITTED
;
228 * Default transaction readonlyness for future pq\Transaction instances.
233 public $defaultTransactionReadonly = FALSE;
235 * Default transaction deferrability for future pq\Transaction instances.
240 public $defaultTransactionDeferrable = FALSE;
242 * Create a new PostgreSQL connection.
243 * See also [General Usage](pq/Connection/: General Usage).
245 * @param string $dsn A ***connection string*** as described [in the PostgreSQL documentation](http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING).
246 * @param int $flags See [connection flag constants](pq/Connection#Connection.Flags:).
247 * @throws \pq\Exception\InvalidArgumentException
248 * @throws \pq\Exception\BadMethodCallException
249 * @throws \pq\Exception\RuntimeException
251 function __construct(string $dsn = "", int $flags = 0) {}
253 * Declare a cursor for a query.
255 * @param string $name The identifying name of the cursor.
256 * @param int $flags Any combination of pq\Cursor constants.
257 * @param string $query The query for which to open a cursor.
258 * @throws \pq\Exception\InvalidArgumentException
259 * @throws \pq\Exception\RuntimeException
260 * @throws \pq\Exception\BadMethodCallException
261 * @return \pq\Cursor an open cursor instance.
263 function declare(string $name, int $flags, string $query) {}
265 * [Asynchronously](pq/Connection/: Asynchronous Usage) declare a cursor for a query.
268 * If pq\Connection::$unbuffered is TRUE, each call to pq\Connection::getResult() will generate a distinct pq\Result containing exactly one row.
270 * @param string $name The identifying name of the cursor.
271 * @param int $flags Any combination of pq\Cursor constants.
272 * @param string $query The query for which to open a cursor.
273 * @throws \pq\Exception\InvalidArgumentException
274 * @throws \pq\Exception\RuntimeException
275 * @throws \pq\Exception\BadMethodCallException
276 * @return \pq\Cursor an open cursor instance.
278 function declareAsync(string $name, int $flags, string $query) {}
280 * Escape binary data for use within a query with the type bytea.
283 * The result is not wrapped in single quotes.
285 * @param string $binary The binary data to escape.
286 * @throws \pq\Exception\BadMethodCallException
287 * @return string|FALSE string the escaped binary data.
288 * or FALSE if escaping fails.
290 function escapeBytea(string $binary) {}
292 * [Execute one or multiple SQL queries](pq/Connection/: Executing Queries) on the connection.
295 * > Only the last result will be returned, if the query string contains more than one SQL query.
297 * @param string $query The queries to send to the server, separated by semi-colon.
298 * @throws \pq\Exception\InvalidArgumentException
299 * @throws \pq\Exception\BadMethodCallException
300 * @throws \pq\Exception\RuntimeException
301 * @throws \pq\Exception\DomainException
304 function exec(string $query) {}
306 * [Asynchronously](pq/Connection/: Asynchronous Usage) [execute an SQL query](pq/Connection: Executing Queries) on the connection.
309 * If pq\Connection::$unbuffered is TRUE, each call to pq\Connection::getResult() will generate a distinct pq\Result containing exactly one row.
311 * @param string $query The query to send to the server.
312 * @param callable $callback as function(pq\Result $res)
313 * The callback to execute when the query finishes.
314 * @throws \pq\Exception\InvalidArgumentException
315 * @throws \pq\Exception\BadMethodCallException
316 * @throws \pq\Exception\RuntimeException
318 function execAsync(string $query, callable
$callback = NULL) {}
320 * [Execute an SQL query](pq/Connection: Executing Queries) with properly escaped parameters substituted.
322 * @param string $query The query to execute.
323 * @param array $params The parameter list to substitute.
324 * @param array $types Corresponding list of type OIDs for the parameters.
325 * @throws \pq\Exception\InvalidArgumentException
326 * @throws \pq\Exception\RuntimeException
327 * @throws \pq\Exception\DomainException
330 function execParams(string $query, array $params, array $types = NULL) {}
332 * [Asynchronously](pq/Connection/: Asynchronous Usage) [execute an SQL query](pq/Connection: Executing Queries) with properly escaped parameters substituted.
335 * If pq\Connection::$unbuffered is TRUE, each call to pq\Connection::getResult() will generate a distinct pq\Result containing exactly one row.
337 * @param string $query The query to execute.
338 * @param array $params The parameter list to substitute.
339 * @param array $types Corresponding list of type OIDs for the parameters.
340 * @param callable $cb as function(\pq\Result $res) : void
341 * Result handler callback.
342 * @throws \pq\Exception\InvalidArgumentException
343 * @throws \pq\Exception\RuntimeException
344 * @throws \pq\Exception\BadMethodCallException
346 function execParamsAsync(string $query, array $params, array $types = NULL, callable
$cb = NULL) {}
348 * Flush pending writes on the connection.
349 * Call after sending any command or data on a nonblocking connection.
351 * If it returns FALSE, wait for the socket to become read or write-ready.
352 * If it becomes write-ready, call pq\Connection::flush() again.
353 * If it becomes read-ready, call pq\Connection::poll(), then call pq\Connection::flush() again.
354 * Repeat until pq\Connection::flush() returns TRUE.
357 * > This method was added in v1.1.0, resp. v2.1.0.
359 * @throws \pq\Exception\InvalidArgumentException
360 * @throws \pq\Exception\RuntimeException
361 * @return bool whether everything has been flushed.
365 * Fetch the result of an [asynchronous](pq/Connection/: Asynchronous Usage) query.
367 * If the query hasn't finished yet, the call will block until the result is available.
369 * @throws \pq\Exception\InvalidArgumentException
370 * @throws \pq\Exception\BadMethodCallException
371 * @return NULL|\pq\Result NULL if there has not been a query
372 * or \pq\Result when the query has finished
374 function getResult() {}
376 * Listen on $channel for notifications.
377 * See pq\Connection::unlisten().
379 * @param string $channel The channel to listen on.
380 * @param callable $listener as function(string $channel, string $message, int $pid)
381 * A callback automatically called whenever a notification on $channel arrives.
382 * @throws \pq\Exception\InvalidArgumentException
383 * @throws \pq\Exception\BadMethodCallException
384 * @throws \pq\Exception\RuntimeException
386 function listen(string $channel, callable
$listener) {}
388 * [Asynchronously](pq/Connection/: Asynchronous Usage) start listening on $channel for notifcations.
389 * See pq\Connection::listen().
391 * @param string $channel The channel to listen on.
392 * @param callable $listener as function(string $channel, string $message, int $pid)
393 * A callback automatically called whenever a notification on $channel arrives.
394 * @throws \pq\Exception\InvalidArgumentException
395 * @throws \pq\Exception\BadMethodCallException
396 * @throws \pq\Exception\RuntimeException
398 function listenAsync(string $channel, callable
$listener) {}
400 * Notify all listeners on $channel with $message.
402 * @param string $channel The channel to notify.
403 * @param string $message The message to send.
404 * @throws \pq\Exception\InvalidArgumentException
405 * @throws \pq\Exception\BadMethodCallException
406 * @throws \pq\Exception\RuntimeException
408 function notify(string $channel, string $message) {}
410 * [Asynchronously](pq/Connection/: Asynchronous Usage) start notifying all listeners on $channel with $message.
412 * @param string $channel The channel to notify.
413 * @param string $message The message to send.
414 * @throws \pq\Exception\InvalidArgumentException
415 * @throws \pq\Exception\BadMethodCallException
416 * @throws \pq\Exception\RuntimeException
418 function notifyAsync(string $channel, string $message) {}
420 * Stops listening for an event type.
422 * @param string $event Any pq\Connection::EVENT_*.
423 * @throws \pq\Exception\InvalidArgumentException
424 * @throws \pq\Exception\BadMethodCallException
425 * @return bool success.
427 function off(string $event) {}
429 * Listen for an event.
431 * @param string $event Any pq\Connection::EVENT_*.
432 * @param callable $callback as function(pq\Connection $c[, pq\Result $r)
433 * The callback to invoke on event.
434 * @throws \pq\Exception\InvalidArgumentException
435 * @throws \pq\Exception\BadMethodCallException
436 * @return int number of previously attached event listeners.
438 function on(string $event, callable
$callback) {}
440 * Poll an [asynchronously](pq/Connection/: Asynchronous Usage) operating connection.
441 * See pq\Connection::resetAsync() for an usage example.
443 * @throws \pq\Exception\InvalidArgumentException
444 * @throws \pq\Exception\RuntimeException
445 * @throws \pq\Exception\BadMethodCallException
446 * @return int pq\Connection::POLLING_* constant
450 * Prepare a named statement for later execution with pq\Statement::execute().
452 * @param string $name The identifying name of the prepared statement.
453 * @param string $query The query to prepare.
454 * @param array $types An array of type OIDs for the substitution parameters.
455 * @throws \pq\Exception\InvalidArgumentException
456 * @throws \pq\Exception\BadMethodCallException
457 * @throws \pq\Exception\RuntimeException
458 * @return \pq\Statement a prepared statement instance.
460 function prepare(string $name, string $query, array $types = NULL) {}
462 * [Asynchronously](pq/Connection/: Asynchronous Usage) prepare a named statement for later execution with pq\Statement::exec().
465 * If pq\Connection::$unbuffered is TRUE, each call to pq\Connection::getResult() will generate a distinct pq\Result containing exactly one row.
467 * @param string $name The identifying name of the prepared statement.
468 * @param string $query The query to prepare.
469 * @param array $types An array of type OIDs for the substitution parameters.
470 * @throws \pq\Exception\InvalidArgumentException
471 * @throws \pq\Exception\BadMethodCallException
472 * @throws \pq\Exception\RuntimeException
473 * @return \pq\Statement a prepared statement instance.
475 function prepareAsync(string $name, string $query, array $types = NULL) {}
477 * Quote a string for safe use in a query.
478 * The result is truncated at any zero byte and wrapped in single quotes.
481 * Beware of matching character encodings.
483 * @param string $payload The payload to quote for use in a query.
484 * @throws \pq\Exception\BadMethodCallException
485 * @return string|FALSE string a single-quote wrapped string safe for literal use in a query.
486 * or FALSE if quoting fails.
488 function quote(string $payload) {}
490 * Quote an identifier for safe usage as name.
493 * Beware of case-sensitivity.
495 * @param string $name The name to quote.
496 * @throws \pq\Exception\BadMethodCallException
497 * @return string|FALSE string the quoted identifier.
498 * or FALSE if quoting fails.
500 function quoteName(string $name) {}
502 * Attempt to reset a possibly broken connection to a working state.
504 * @throws \pq\Exception\InvalidArgumentException
505 * @throws \pq\Exception\BadMethodCallException
506 * @throws \pq\Exception\RuntimeException
510 * [Asynchronously](pq/Connection/: Asynchronous Usage) reset a possibly broken connection to a working state.
512 * @throws \pq\Exception\InvalidArgumentException
513 * @throws \pq\Exception\BadMethodCallException
514 * @throws \pq\Exception\RuntimeException
516 function resetAsync() {}
518 * Set a data type converter.
520 * @param \pq\Converter $converter An instance implementing pq\Converter.
521 * @throws \pq\Exception\InvalidArgumentException
522 * @throws \pq\Exception\BadMethodCallException
524 function setConverter(\pq\Converter
$converter) {}
526 * Begin a transaction.
528 * @param int $isolation Any pq\Transaction isolation level constant
529 * (defaults to pq\Connection::$defaultTransactionIsolation).
530 * @param bool $readonly Whether the transaction executes only reads
531 * (defaults to pq\Connection::$defaultTransactionReadonly).
532 * @param bool $deferrable Whether the transaction is deferrable
533 * (defaults to pq\Connection::$defaultTransactionDeferrable).
536 * A transaction can only be deferrable if it also is readonly and serializable.
537 * See the official [PostgreSQL documentation](http://www.postgresql.org/docs/current/static/sql-set-transaction.html) for further information.
538 * @throws \pq\Exception\InvalidArgumentException
539 * @throws \pq\Exception\BadMethodCallException
540 * @throws \pq\Exception\RuntimeException
541 * @return \pq\Transaction a begun transaction instance.
543 function startTransaction(int $isolation = \pq\Transaction
::READ_COMMITTED
, bool $readonly = FALSE, bool $deferrable = FALSE) {}
545 * [Asynchronously](pq/Connection/: Asynchronous Usage) begin a transaction.
547 * @param int $isolation Any pq\Transaction isolation level constant
548 * (defaults to pq\Connection::$defaultTransactionIsolation).
549 * @param bool $readonly Whether the transaction executes only reads
550 * (defaults to pq\Connection::$defaultTransactionReadonly).
551 * @param bool $deferrable Whether the transaction is deferrable
552 * (defaults to pq\Connection::$defaultTransactionDeferrable).
555 * A transaction can only be deferrable if it also is readonly and serializable.
556 * See the official [PostgreSQL documentation](http://www.postgresql.org/docs/current/static/sql-set-transaction.html) for further information.
557 * @throws \pq\Exception\InvalidArgumentException
558 * @throws \pq\Exception\BadMethodCallException
559 * @throws \pq\Exception\RuntimeException
560 * @return \pq\Transaction an asynchronously begun transaction instance.
562 function startTransactionAsync(int $isolation = \pq\Transaction
::READ_COMMITTED
, bool $readonly = FALSE, bool $deferrable = FALSE) {}
564 * Trace protocol communication with the server.
567 * Calling pq\Connection::trace() without argument or NULL stops tracing.
569 * @param resource $stream The resource to which the protocol trace will be output.
570 * (The stream must be castable to STDIO).
571 * @throws \pq\Exception\BadMethodCallException
572 * @return bool success.
574 function trace($stream = NULL) {}
576 * Unescape bytea data retrieved from the server.
578 * @param string $bytea Bytea data retrieved from the server.
579 * @throws \pq\Exception\BadMethodCallException
580 * @return string|FALSE string unescaped binary data.
581 * or FALSE if unescaping fails.
583 function unescapeBytea(string $bytea) {}
585 * Stop listening for notifications on channel $channel.
586 * See pq\Connection::listen().
588 * @param string $channel The name of a channel which is currently listened on.
589 * @throws \pq\Exception\InvalidArgumentException
590 * @throws \pq\Exception\BadMethodCallException
591 * @throws \pq\Exception\RuntimeException
593 function unlisten(string $channel) {}
595 * [Asynchronously](pq/Connection/: Asynchronous Usage) stop listening for notifications on channel $channel.
596 * See pq\Connection::unlisten() and pq\Connection::listenAsync().
598 * @param string $channel The name of a channel which is currently listened on.
599 * @throws \pq\Exception\InvalidArgumentException
600 * @throws \pq\Exception\BadMethodCallException
601 * @throws \pq\Exception\RuntimeException
603 function unlistenAsync(string $channel) {}
605 * Stop applying a data type converter.
607 * @param \pq\Converter $converter A converter previously set with pq\Connection::setConverter().
608 * @throws \pq\Exception\InvalidArgumentException
609 * @throws \pq\Exception\BadMethodCallException
611 function unsetConverter(\pq\Converter
$converter) {}
614 * Interface for type conversions.
616 interface Converter
{
618 * Convert a string received from the PostgreSQL server back to a PHP type.
620 * @param string $data String data received from the server.
621 * @param int $type The type OID of the data. Irrelevant for single-type converters.
622 * @return mixed the value converted to a PHP type.
624 function convertFromString(string $data, int $type);
626 * Convert a value to a string for use in a query.
628 * @param mixed $value The PHP value which should be converted to a string.
629 * @param int $type The type OID the converter should handle. Irrelevant for singly-type converters.
630 * @return string a textual representation of the value accepted by the PostgreSQL server.
632 function convertToString($value, int $type);
634 * Announce which types the implementing converter can handle.
636 * @return array OIDs of handled types.
638 function convertTypes();
645 * Causes the cursor to return data in binary rather than in text format. You probably do not want to use that.
649 * The data returned by the cursor should be unaffected by updates to the tables underlying the cursor that take place after the cursor was opened.
651 const INSENSITIVE
= 2;
653 * The cursor should stay usable after the transaction that created it was successfully committed.
657 * Force that rows can be retrieved in any order from the cursor.
661 * Force that rows are only retrievable in sequiential order.
664 * See the [notes in the official PostgreSQL documentation](http://www.postgresql.org/docs/current/static/sql-declare.html#SQL-DECLARE-NOTES) for more information.
666 const NO_SCROLL
= 32;
669 * See pq\Connection::declare().
671 * @param \pq\Connection $connection The connection on which the cursor should be declared.
672 * @param string $name The name of the cursor.
673 * @param int $flags See pq\Cursor constants.
674 * @param string $query The query for which the cursor should be opened.
675 * @param bool $async Whether to declare the cursor [asynchronously](pq/Connection/: Asynchronous Usage).
676 * @throws \pq\Exception\InvalidArgumentException
677 * @throws \pq\Exception\BadMethodCallException
678 * @throws \pq\Exception\RuntimeException
680 function __construct(\pq\Connection
$connection, string $name, int $flags, string $query, bool $async) {}
682 * Close an open cursor.
683 * This is a no-op on already closed cursors.
685 * @throws \pq\Exception\InvalidArgumentException
686 * @throws \pq\Exception\BadMethodCallException
687 * @throws \pq\Exception\RuntimeException
691 * [Asynchronously](pq/Connection/: Asynchronous Usage) close an open cursor.
692 * See pq\Cursor::close().
694 * @throws \pq\Exception\InvalidArgumentException
695 * @throws \pq\Exception\BadMethodCallException
696 * @throws \pq\Exception\RuntimeException
698 function closeAsync() {}
700 * Fetch rows from the cursor.
701 * See pq\Cursor::move().
703 * @param string $spec What to fetch.
705 * ### Fetch argument:
707 * FETCH and MOVE usually accepts arguments like the following, where `count` is the number of rows:
708 * @throws \pq\Exception\InvalidArgumentException
709 * @throws \pq\Exception\BadMethodCallException
710 * @throws \pq\Exception\RuntimeException
711 * @return \pq\Result the fetched row(s).
713 function fetch(string $spec = "1") {}
715 * [Asynchronously](pq/Connection/: Asynchronous Usage) fetch rows from the cursor.
716 * See pq\Cursor::fetch().
718 * @param string $spec What to fetch.
719 * @param callable $callback as function(pq\Result $res)
720 * A callback to execute when the result is ready.
721 * @throws \pq\Exception\InvalidArgumentException
722 * @throws \pq\Exception\BadMethodCallException
723 * @throws \pq\Exception\RuntimeException
725 function fetchAsync(string $spec = "1", callable
$callback = NULL) {}
728 * See pq\Cursor::fetch().
730 * @param string $spec What to fetch.
732 * ### Fetch argument:
734 * FETCH and MOVE usually accepts arguments like the following, where `count` is the number of rows:
735 * @throws \pq\Exception\InvalidArgumentException
736 * @throws \pq\Exception\BadMethodCallException
737 * @throws \pq\Exception\RuntimeException
738 * @return \pq\Result command status.
740 function move(string $spec = "1") {}
742 * [Asynchronously](pq/Connection/: Asynchronous Usage) move the cursor.
743 * See pq\Cursor::move().
745 * @param string $spec What to fetch.
746 * @param callable $callback as function(pq\Result $res)
747 * A callback to execute when the command completed.
748 * @throws \pq\Exception\InvalidArgumentException
749 * @throws \pq\Exception\BadMethodCallException
750 * @throws \pq\Exception\RuntimeException
752 function moveAsync(string $spec = "1", callable
$callback = NULL) {}
755 * This is a no-op on already open cursors.
758 * Only cursors closed by pq\Cursor::close() will be reopened.
760 * @throws \pq\Exception\InvalidArgumentException
761 * @throws \pq\Exception\BadMethodCallException
762 * @throws \pq\Exception\RuntimeException
766 * [Asynchronously](pq/Connection/: Asynchronous Usage) reopen a cursor.
767 * See pq\Cursor::open().
769 * @throws \pq\Exception\InvalidArgumentException
770 * @throws \pq\Exception\BadMethodCallException
771 * @throws \pq\Exception\RuntimeException
773 function openAsync() {}
776 * A simple DateTime wrapper with predefined formats which supports stringification and JSON.
778 class DateTime
extends \DateTime
implements \JsonSerializable
{
780 * The default format of any date/time type automatically converted by pq\Result (depends on the actual type of the column).
785 public $format = "Y-m-d H:i:s.uO";
787 * Stringify the DateTime instance according to pq\DateTime::$format.
789 * @return string the DateTime as string.
791 function __toString() {}
794 * Alias of pq\DateTime::__toString().
796 * @return string the DateTime stringified according to pq\DateTime::$format.
798 function jsonSerialize() {}
801 * A base interface for all pq\Exception classes.
803 interface Exception
{
805 * An invalid argument was passed to a method (pq\Exception\InvalidArgumentException).
807 const INVALID_ARGUMENT
= 0;
809 * A runtime exception occurred (pq\Exception\RuntimeException).
813 * The connection failed (pq\Exception\RuntimeException).
815 const CONNECTION_FAILED
= 2;
817 * An input/output exception occurred (pq\Exception\RuntimeException).
821 * Escaping an argument or identifier failed internally (pq\Exception\RuntimeException).
825 * An object's constructor was not called (pq\Exception\BadMethodCallException).
827 const UNINITIALIZED
= 6;
829 * Calling this method was not expected (yet) (pq\Exception\BadMethodCallException).
831 const BAD_METHODCALL
= 5;
833 * SQL syntax error (pq\Exception\DomainException).
837 * Implementation domain error (pq\Exception\DomainException).
845 * Working with *large objects* requires an active transaction.
849 * 0, representing an invalid OID.
851 const INVALID_OID
= 0;
857 * Open or create a *large object*.
858 * See pq\Transaction::openLOB() and pq\Transaction::createLOB().
860 * @param \pq\Transaction $txn The transaction which wraps the *large object* operations.
861 * @param int $oid The OID of the existing *large object* to open.
862 * @param int $mode Access mode (read, write or read/write).
863 * @throws \pq\Exception\InvalidArgumentException
864 * @throws \pq\Exception\BadMethodCallException
865 * @throws \pq\Exception\RuntimeException
867 function __construct(\pq\Transaction
$txn, int $oid = \pq\LOB
::INVALID_OID
, int $mode = \pq\LOB
::RW
) {}
869 * Read a string of data from the current position of the *large object*.
871 * @param int $length The amount of bytes to read from the *large object*.
872 * @param int $read The amount of bytes actually read from the *large object*.
873 * @throws \pq\Exception\InvalidArgumentException
874 * @throws \pq\Exception\BadMethodCallException
875 * @throws \pq\Exception\RuntimeException
876 * @return string the data read.
878 function read(int $length = 0x1000, int &$read = NULL) {}
880 * Seek to a position within the *large object*.
882 * @param int $offset The position to seek to.
883 * @param int $whence From where to seek (SEEK_SET, SEEK_CUR or SEEK_END).
884 * @throws \pq\Exception\InvalidArgumentException
885 * @throws \pq\Exception\BadMethodCallException
886 * @throws \pq\Exception\RuntimeException
887 * @return int the new position.
889 function seek(int $offset, int $whence = SEEK_SET
) {}
891 * Retrieve the current position within the *large object*.
893 * @throws \pq\Exception\InvalidArgumentException
894 * @throws \pq\Exception\BadMethodCallException
895 * @throws \pq\Exception\RuntimeException
896 * @return int the current position.
900 * Truncate the *large object*.
902 * @param int $length The length to truncate to.
903 * @throws \pq\Exception\InvalidArgumentException
904 * @throws \pq\Exception\BadMethodCallException
905 * @throws \pq\Exception\RuntimeException
907 function truncate(int $length = 0) {}
909 * Write data to the *large object*.
911 * @param string $data The data that should be written to the current position.
912 * @return int the number of bytes written.
914 function write(string $data) {}
919 * See [Fetching Results](pq/Result/: Fetching Results) for a general overview.
921 class Result
implements \Traversable
, \Countable
{
923 * The query sent to the server was empty.
925 const EMPTY_QUERY
= 0;
927 * The query did not generate a result set and completed successfully.
929 const COMMAND_OK
= 1;
931 * The query successfully generated a result set.
935 * The result contains a single row of the result set when using pq\Connection::$unbuffered.
937 const SINGLE_TUPLE
= 9;
939 * COPY data can be received from the server.
943 * COPY data can be sent to the server.
947 * COPY in/out data transfer in progress.
951 * The server sent a bad response.
953 const BAD_RESPONSE
= 5;
955 * A nonfatal error (notice or warning) occurred.
957 const NONFATAL_ERROR
= 6;
959 * A fatal error occurred.
961 const FATAL_ERROR
= 7;
963 * Fetch rows numerically indexed, where the index start with 0.
965 const FETCH_ARRAY
= 0;
967 * Fetch rows associatively indexed by column name.
969 const FETCH_ASSOC
= 1;
971 * Fetch rows as stdClass instance, where the column names are the property names.
973 const FETCH_OBJECT
= 2;
975 * Automatically convert 'f' and 't' to FALSE and TRUE and vice versa.
979 * Automatically convert integral strings to either int if it fits into maximum integer size or else to float and vice versa.
983 * Automatically convert floating point numbers.
985 const CONV_FLOAT
= 4;
987 * Do all scalar conversions listed above.
989 const CONV_SCALAR
= 15;
991 * Automatically convert arrays.
993 const CONV_ARRAY
= 16;
995 * Automatically convert date strings to pq\DateTime and vice versa.
997 const CONV_DATETIME
= 32;
999 * Automatically convert JSON.
1001 const CONV_JSON
= 256;
1003 * Do all of the above.
1005 const CONV_ALL
= 65535;
1007 * The [type of return value](pq/Result#Fetch.types:) the fetch methods should return when no fetch type argument was given. Defaults to pq\Connection::$defaultFetchType.
1012 public $fetchType = \pq\Result
::FETCH_ARRAY
;
1014 * What [type of conversions](pq/Result#Conversion.bits:) to perform automatically.
1019 public $autoConvert = \pq\Result
::CONV_ALL
;
1021 * Bind a variable to a result column.
1022 * See pq\Result::fetchBound().
1024 * @param mixed $col The column name or index to bind to.
1025 * @param mixed $var The variable reference.
1026 * @throws \pq\Exception\InvalidArgumentException
1027 * @throws \pq\Exception\BadMethodCallException
1028 * @return bool success.
1030 function bind($col, $var) {}
1032 * Count number of rows in this result set.
1034 * @throws \pq\Exception\InvalidArgumentException
1035 * @throws \pq\Exception\BadMethodCallException
1036 * @return int the number of rows.
1040 * Describe a prepared statement.
1043 * This will only return meaningful information for a result of pq\Statement::desc().
1045 * @throws \pq\Exception\InvalidArgumentException
1046 * @throws \pq\Exception\BadMethodCallException
1047 * @return array list of parameter type OIDs for the prepared statement.
1051 * Fetch all rows at once.
1053 * @param int $fetch_type The type the return value should have, see pq\Result::FETCH_* constants, defaults to pq\Result::$fetchType.
1054 * @throws \pq\Exception\InvalidArgumentException
1055 * @throws \pq\Exception\BadMethodCallException
1056 * @return array all fetched rows.
1058 function fetchAll(int $fetch_type = NULL) {}
1060 * Fetch all rows of a single column.
1062 * @param int $col The column name or index to fetch.
1063 * @throws \pq\Exception\InvalidArgumentException
1064 * @throws \pq\Exception\BadMethodCallException
1065 * @throws \pq\Exception\RuntimeException
1066 * @return array list of column values.
1068 function fetchAllCols(int $col = 0) {}
1070 * Iteratively fetch a row into bound variables.
1071 * See pq\Result::bind().
1073 * @throws \pq\Exception\InvalidArgumentException
1074 * @throws \pq\Exception\BadMethodCallException
1075 * @throws \pq\Exception\RuntimeException
1076 * @return array|NULL array the fetched row as numerically indexed array.
1077 * or NULL when iteration ends.
1079 function fetchBound() {}
1081 * Iteratively fetch a single column.
1083 * @param mixed $ref The variable where the column value will be stored in.
1084 * @param mixed $col The column name or index.
1085 * @throws \pq\Exception\InvalidArgumentException
1086 * @throws \pq\Exception\BadMethodCallException
1087 * @throws \pq\Exception\RuntimeException
1088 * @return bool|NULL bool success.
1089 * or NULL when iteration ends.
1091 function fetchCol($ref, $col = 0) {}
1093 * Iteratively fetch a row.
1095 * @param int $fetch_type The type the return value should have, see pq\Result::FETCH_* constants, defaults to pq\Result::$fetchType.
1096 * @throws \pq\Exception\InvalidArgumentException
1097 * @throws \pq\Exception\BadMethodCallException
1098 * @throws \pq\Exception\RuntimeException
1099 * @return array|array|object|NULL array numerically indexed for pq\Result::FETCH_ARRAY
1100 * or array associatively indexed for pq\Result::FETCH_ASSOC
1101 * or object stdClass instance for pq\Result::FETCH_OBJECT
1102 * or NULL when iteration ends.
1104 function fetchRow(int $fetch_type = NULL) {}
1106 * Fetch the complete result set as a simple map, a *multi dimensional array*, each dimension indexed by a column.
1108 * @param mixed $keys The the column indices/names used to index the map.
1109 * @param mixed $vals The column indices/names which should build up the leaf entry of the map.
1110 * @param int $fetch_type The type the return value should have, see pq\Result::FETCH_* constants, defaults to pq\Result::$fetchType.
1111 * @throws \pq\Exception\InvalidArgumentException
1112 * @throws \pq\Exception\BadMethodCallException
1113 * @throws \pq\Exception\RuntimeException
1114 * @return array |object, the mapped columns.
1116 function map($keys = 0, $vals = NULL, int $fetch_type = NULL) {}
1119 * A named prepared statement.
1120 * See pq\Connection::prepare().
1124 * Prepare a new statement.
1125 * See pq\Connection::prepare().
1127 * @param \pq\Connection $conn The connection to prepare the statement on.
1128 * @param string $name The name identifying this statement.
1129 * @param string $query The actual query to prepare.
1130 * @param array $types A list of corresponding query parameter type OIDs.
1131 * @param bool $async Whether to prepare the statement [asynchronously](pq/Connection/: Asynchronous Usage).
1132 * @throws \pq\Exception\InvalidArgumentException
1133 * @throws \pq\Exception\BadMethodCallException
1134 * @throws \pq\Exception\RuntimeException
1135 * @throws \pq\Exception\DomainException
1137 function __construct(\pq\Connection
$conn, string $name, string $query, array $types = NULL, bool $async = FALSE) {}
1139 * Bind a variable to an input parameter.
1141 * @param int $param_no The parameter index to bind to.
1142 * @param mixed $param_ref The variable to bind.
1143 * @throws \pq\Exception\InvalidArgumentException
1144 * @throws \pq\Exception\BadMethodCallException
1146 function bind(int $param_no, &$param_ref) {}
1148 * Free the server resources used by the prepared statement, so it can no longer be executed.
1149 * This is done implicitly when the object is destroyed.
1151 * @throws \pq\Exception\InvalidArgumentException
1152 * @throws \pq\Exception\BadMethodCallException
1153 * @throws \pq\Exception\RuntimeException
1155 function deallocate() {}
1157 * [Asynchronously](pq/Connection/: Asynchronous Usage) free the server resources used by the
1158 * prepared statement, so it can no longer be executed.
1160 * @throws \pq\Exception\InvalidArgumentException
1161 * @throws \pq\Exception\BadMethodCallException
1162 * @throws \pq\Exception\RuntimeException
1164 function deallocateAsync() {}
1166 * Describe the parameters of the prepared statement.
1168 * @throws \pq\Exception\InvalidArgumentException
1169 * @throws \pq\Exception\BadMethodCallException
1170 * @throws \pq\Exception\RuntimeException
1171 * @throws \pq\Exception\DomainException
1172 * @return array list of type OIDs of the substitution parameters.
1176 * [Asynchronously](pq/Connection/: Asynchronous Usage) describe the parameters of the prepared statement.
1178 * @param callable $callback as function(array $oids)
1179 * A callback to receive list of type OIDs of the substitution parameters.
1180 * @throws \pq\Exception\InvalidArgumentException
1181 * @throws \pq\Exception\BadMethodCallException
1182 * @throws \pq\Exception\RuntimeException
1184 function descAsync(callable
$callback) {}
1186 * Execute the prepared statement.
1188 * @param array $params Any parameters to substitute in the prepared statement (defaults to any bou
1190 * @throws \pq\Exception\InvalidArgumentException
1191 * @throws \pq\Exception\BadMethodCallException
1192 * @throws \pq\Exception\RuntimeException
1193 * @return \pq\Result the result of the execution of the prepared statement.
1195 function exec(array $params = NULL) {}
1197 * [Asynchronously](pq/Connection/: Asynchronous Usage) execute the prepared statement.
1199 * @param array $params Any parameters to substitute in the prepared statement (defaults to any bou
1201 * @param callable $cb as function(\pq\Result $res) : void
1202 * Result handler callback.
1203 * @throws \pq\Exception\InvalidArgumentException
1204 * @throws \pq\Exception\BadMethodCallException
1205 * @throws \pq\Exception\RuntimeException
1207 function execAsync(array $params = NULL, callable
$cb = NULL) {}
1209 * Re-prepare a statement that has been deallocated. This is a no-op on already open statements.
1211 * @throws \pq\Exception\InvalidArgumentException
1212 * @throws \pq\Exception\BadMethodCallException
1213 * @throws \pq\Exception\RuntimeException
1215 function prepare() {}
1217 * [Asynchronously](pq/Connection/: Asynchronous Usage) re-prepare a statement that has been
1218 * deallocated. This is a no-op on already open statements.
1220 * @throws \pq\Exception\InvalidArgumentException
1221 * @throws \pq\Exception\BadMethodCallException
1222 * @throws \pq\Exception\RuntimeException
1224 function prepareAsync() {}
1227 * A database transaction.
1230 * Transactional properties like pq\Transaction::$isolation, pq\Transaction::$readonly and pq\Transaction::$deferrable can be changed after the transaction begun and the first query has been executed. Doing this will lead to appropriate `SET TRANSACTION` queries.
1234 * Transaction isolation level where only rows committed before the transaction began can be seen.
1236 const READ_COMMITTED
= 0;
1238 * Transaction isolation level where only rows committed before the first query was executed in this transaction.
1240 const REPEATABLE_READ
= 1;
1242 * Transaction isolation level that guarantees serializable repeatability which might lead to serialization_failure on high concurrency.
1244 const SERIALIZABLE
= 2;
1246 * The transaction isolation level.
1251 public $isolation = \pq\Transaction
::READ_COMMITTED
;
1253 * Whether this transaction performs read only queries.
1258 public $readonly = FALSE;
1260 * Whether the transaction is deferrable. See pq\Connection::startTransaction().
1265 public $deferrable = FALSE;
1267 * Start a transaction.
1268 * See pq\Connection::startTransaction().
1270 * @param \pq\Connection $conn The connection to start the transaction on.
1271 * @param bool $async Whether to start the transaction [asynchronously](pq/Connection/: Asynchronous Usage).
1272 * @param int $isolation The transaction isolation level (defaults to pq\Connection::$defaultTransactionIsolation).
1273 * @param bool $readonly Whether the transaction is readonly (defaults to pq\Connection::$defaultTransactionReadonly).
1274 * @param bool $deferrable Whether the transaction is deferrable (defaults to pq\Connection::$defaultTransactionDeferrable).
1275 * @throws \pq\Exception\InvalidArgumentException
1276 * @throws \pq\Exception\BadMethodCallException
1277 * @throws \pq\Exception\RuntimeException
1279 function __construct(\pq\Connection
$conn, bool $async = FALSE, int $isolation = \pq\Transaction
::READ_COMMITTED
, bool $readonly = FALSE, bool $deferrable = FALSE) {}
1281 * Commit the transaction or release the previous savepoint.
1282 * See pq\Transaction::savepoint().
1284 * @throws \pq\Exception\InvalidArgumentException
1285 * @throws \pq\Exception\BadMethodCallException
1286 * @throws \pq\Exception\RuntimeException
1287 * @throws \pq\Exception\DomainException
1289 function commit() {}
1291 * [Asynchronously](pq/Connection/: Asynchronous Usage) commit the transaction or release the previous savepoint.
1292 * See pq\Transaction::commit() and pq\Transaction::savepoint().
1294 * @throws \pq\Exception\InvalidArgumentException
1295 * @throws \pq\Exception\BadMethodCallException
1296 * @throws \pq\Exception\RuntimeException
1298 function commitAsync() {}
1300 * Create a new *large object* and open it.
1301 * See pq\Transaction::openLOB().
1303 * @param int $mode How to open the *large object* (read, write or both; see pq\LOB constants).
1304 * @throws \pq\Exception\InvalidArgumentException
1305 * @throws \pq\Exception\BadMethodCallException
1306 * @throws \pq\Exception\RuntimeException
1307 * @return \pq\LOB instance of the new *large object*.
1309 function createLOB(int $mode = \pq\LOB
::RW
) {}
1311 * Export a *large object* to a local file.
1312 * See pq\Transaction::importLOB().
1314 * @param int $oid The OID of the *large object*.
1315 * @param string $path The path of a local file to export to.
1316 * @throws \pq\Exception\InvalidArgumentException
1317 * @throws \pq\Exception\BadMethodCallException
1318 * @throws \pq\Exception\RuntimeException
1320 function exportLOB(int $oid, string $path) {}
1322 * Export a snapshot for transaction synchronization.
1323 * See pq\Transaction::importSnapshot().
1325 * @throws \pq\Exception\InvalidArgumentException
1326 * @throws \pq\Exception\BadMethodCallException
1327 * @throws \pq\Exception\RuntimeException
1328 * @throws \pq\Exception\DomainException
1329 * @return string the snapshot identifier usable with pq\Transaction::importSnapshot().
1331 function exportSnapshot() {}
1333 * [Asynchronously](pq/Connection/: Asynchronous Usage) export a snapshot for transaction synchronization.
1334 * See pq\Transaction::exportSnapshot().
1336 * @throws \pq\Exception\InvalidArgumentException
1337 * @throws \pq\Exception\BadMethodCallException
1338 * @throws \pq\Exception\RuntimeException
1340 function exportSnapshotAsync() {}
1342 * Import a local file into a *large object*.
1344 * @param string $local_path A path to a local file to import.
1345 * @param int $oid The target OID. A new *large object* will be created if INVALID_OID.
1346 * @throws \pq\Exception\InvalidArgumentException
1347 * @throws \pq\Exception\BadMethodCallException
1348 * @throws \pq\Exception\RuntimeException
1349 * @return int the (new) OID of the *large object*.
1351 function importLOB(string $local_path, int $oid = \pq\LOB
::INVALID_OID
) {}
1353 * Import a snapshot from another transaction to synchronize with.
1354 * See pq\Transaction::exportSnapshot().
1357 * The transaction must have an isolation level of at least pq\Transaction::REPEATABLE_READ.
1359 * @param string $snapshot_id The snapshot identifier obtained by exporting a snapshot from a transaction.
1360 * @throws \pq\Exception\InvalidArgumentException
1361 * @throws \pq\Exception\BadMethodCallException
1362 * @throws \pq\Exception\RuntimeException
1363 * @throws \pq\Exception\DomainException
1365 function importSnapshot(string $snapshot_id) {}
1367 * [Asynchronously](pq/Connection/: Asynchronous Usage) import a snapshot from another transaction to synchronize with.
1368 * See pq\Transaction::importSnapshot().
1371 * The transaction must have an isolation level of at least pq\Transaction::REPEATABLE_READ.
1373 * @param string $snapshot_id The snapshot identifier obtained by exporting a snapshot from a transaction.
1374 * @throws \pq\Exception\InvalidArgumentException
1375 * @throws \pq\Exception\BadMethodCallException
1376 * @throws \pq\Exception\RuntimeException
1378 function importSnapshotAsync(string $snapshot_id) {}
1380 * Open a *large object*.
1381 * See pq\Transaction::createLOB().
1383 * @param int $oid The OID of the *large object*.
1384 * @param int $mode Operational mode; read, write or both.
1385 * @throws \pq\Exception\InvalidArgumentException
1386 * @throws \pq\Exception\BadMethodCallException
1387 * @throws \pq\Exception\RuntimeException
1388 * @return \pq\LOB instance of the opened *large object*.
1390 function openLOB(int $oid, int $mode = \pq\LOB
::RW
) {}
1392 * Rollback the transaction or to the previous savepoint within this transaction.
1393 * See pq\Transaction::commit() and pq\Transaction::savepoint().
1395 * @throws \pq\Exception\InvalidArgumentException
1396 * @throws \pq\Exception\BadMethodCallException
1397 * @throws \pq\Exception\RuntimeException
1398 * @throws \pq\Exception\DomainException
1400 function rollback() {}
1402 * [Asynchronously](pq/Connection/: Asynchronous Usage) rollback the transaction or to the previous savepoint within this transaction.
1403 * See pq\Transaction::rollback() and pq\Transaction::savepoint().
1405 * @throws \pq\Exception\InvalidArgumentException
1406 * @throws \pq\Exception\BadMethodCallException
1407 * @throws \pq\Exception\RuntimeException
1409 function rollbackAsync() {}
1411 * Create a `SAVEPOINT` within this transaction.
1414 * pq\Transaction tracks an internal counter as savepoint identifier.
1416 * @throws \pq\Exception\InvalidArgumentException
1417 * @throws \pq\Exception\BadMethodCallException
1418 * @throws \pq\Exception\RuntimeException
1420 function savepoint() {}
1422 * [Asynchronously](pq/Connection/: Asynchronous Usage) create a `SAVEPOINT` within this transaction.
1423 * See pq\Transaction::savepoint().
1425 * @throws \pq\Exception\InvalidArgumentException
1426 * @throws \pq\Exception\BadMethodCallException
1427 * @throws \pq\Exception\RuntimeException
1429 function savepointAsync() {}
1431 * Unlink a *large object*.
1432 * See pq\Transaction::createLOB().
1434 * @param int $oid The OID of the *large object*.
1435 * @throws \pq\Exception\InvalidArgumentException
1436 * @throws \pq\Exception\BadMethodCallException
1437 * @throws \pq\Exception\RuntimeException
1438 * @return \pq\LOB instance of the opened *large object*.
1440 function unlinkLOB(int $oid) {}
1443 * Accessor to the PostgreSQL `pg_type` relation.
1444 * See [here for an overview](pq/Types/: Overview).
1446 class Types
implements \ArrayAccess
{
1448 * OID of the `bool` type.
1452 * OID of the `bytea` type.
1456 * OID of the `char` type.
1460 * OID of the `name` type.
1464 * OID of the `int8` type.
1468 * OID of the `int2` type.
1472 * OID of the `int2vector` type.
1474 const INT2VECTOR
= 22;
1476 * OID of the `int4` type.
1480 * OID of the `regproc` type.
1484 * OID of the `text` type.
1488 * OID of the `oid` type.
1492 * OID of the `tid` type.
1496 * OID of the `xid` type.
1500 * OID of the `cid` type.
1504 * OID of the `oidvector` type.
1506 const OIDVECTOR
= 30;
1508 * OID of the `pg_type` type.
1512 * OID of the `pg_attribute` type.
1514 const PG_ATTRIBUTE
= 75;
1516 * OID of the `pg_proc` type.
1520 * OID of the `pg_class` type.
1522 const PG_CLASS
= 83;
1524 * OID of the `json` type.
1528 * OID of the `xml` type.
1532 * OID of the `xmlarray` type.
1534 const XMLARRAY
= 143;
1536 * OID of the `jsonarray` type.
1538 const JSONARRAY
= 199;
1540 * OID of the `pg_node_tree` type.
1542 const PG_NODE_TREE
= 194;
1544 * OID of the `smgr` type.
1548 * OID of the `point` type.
1552 * OID of the `lseg` type.
1556 * OID of the `path` type.
1560 * OID of the `box` type.
1564 * OID of the `polygon` type.
1566 const POLYGON
= 604;
1568 * OID of the `line` type.
1572 * OID of the `linearray` type.
1574 const LINEARRAY
= 629;
1576 * OID of the `float4` type.
1580 * OID of the `float8` type.
1584 * OID of the `abstime` type.
1586 const ABSTIME
= 702;
1588 * OID of the `reltime` type.
1590 const RELTIME
= 703;
1592 * OID of the `tinterval` type.
1594 const TINTERVAL
= 704;
1596 * OID of the `unknown` type.
1598 const UNKNOWN
= 705;
1600 * OID of the `circle` type.
1604 * OID of the `circlearray` type.
1606 const CIRCLEARRAY
= 719;
1608 * OID of the `money` type.
1612 * OID of the `moneyarray` type.
1614 const MONEYARRAY
= 791;
1616 * OID of the `macaddr` type.
1618 const MACADDR
= 829;
1620 * OID of the `inet` type.
1624 * OID of the `cidr` type.
1628 * OID of the `boolarray` type.
1630 const BOOLARRAY
= 1000;
1632 * OID of the `byteaarray` type.
1634 const BYTEAARRAY
= 1001;
1636 * OID of the `chararray` type.
1638 const CHARARRAY
= 1002;
1640 * OID of the `namearray` type.
1642 const NAMEARRAY
= 1003;
1644 * OID of the `int2array` type.
1646 const INT2ARRAY
= 1005;
1648 * OID of the `int2vectorarray` type.
1650 const INT2VECTORARRAY
= 1006;
1652 * OID of the `int4array` type.
1654 const INT4ARRAY
= 1007;
1656 * OID of the `regprocarray` type.
1658 const REGPROCARRAY
= 1008;
1660 * OID of the `textarray` type.
1662 const TEXTARRAY
= 1009;
1664 * OID of the `oidarray` type.
1666 const OIDARRAY
= 1028;
1668 * OID of the `tidarray` type.
1670 const TIDARRAY
= 1010;
1672 * OID of the `xidarray` type.
1674 const XIDARRAY
= 1011;
1676 * OID of the `cidarray` type.
1678 const CIDARRAY
= 1012;
1680 * OID of the `oidvectorarray` type.
1682 const OIDVECTORARRAY
= 1013;
1684 * OID of the `bpchararray` type.
1686 const BPCHARARRAY
= 1014;
1688 * OID of the `varchararray` type.
1690 const VARCHARARRAY
= 1015;
1692 * OID of the `int8array` type.
1694 const INT8ARRAY
= 1016;
1696 * OID of the `pointarray` type.
1698 const POINTARRAY
= 1017;
1700 * OID of the `lsegarray` type.
1702 const LSEGARRAY
= 1018;
1704 * OID of the `patharray` type.
1706 const PATHARRAY
= 1019;
1708 * OID of the `boxarray` type.
1710 const BOXARRAY
= 1020;
1712 * OID of the `float4array` type.
1714 const FLOAT4ARRAY
= 1021;
1716 * OID of the `float8array` type.
1718 const FLOAT8ARRAY
= 1022;
1720 * OID of the `abstimearray` type.
1722 const ABSTIMEARRAY
= 1023;
1724 * OID of the `reltimearray` type.
1726 const RELTIMEARRAY
= 1024;
1728 * OID of the `tintervalarray` type.
1730 const TINTERVALARRAY
= 1025;
1732 * OID of the `polygonarray` type.
1734 const POLYGONARRAY
= 1027;
1736 * OID of the `aclitem` type.
1738 const ACLITEM
= 1033;
1740 * OID of the `aclitemarray` type.
1742 const ACLITEMARRAY
= 1034;
1744 * OID of the `macaddrarray` type.
1746 const MACADDRARRAY
= 1040;
1748 * OID of the `inetarray` type.
1750 const INETARRAY
= 1041;
1752 * OID of the `cidrarray` type.
1754 const CIDRARRAY
= 651;
1756 * OID of the `cstringarray` type.
1758 const CSTRINGARRAY
= 1263;
1760 * OID of the `bpchar` type.
1762 const BPCHAR
= 1042;
1764 * OID of the `varchar` type.
1766 const VARCHAR
= 1043;
1768 * OID of the `date` type.
1772 * OID of the `time` type.
1776 * OID of the `timestamp` type.
1778 const TIMESTAMP
= 1114;
1780 * OID of the `timestamparray` type.
1782 const TIMESTAMPARRAY
= 1115;
1784 * OID of the `datearray` type.
1786 const DATEARRAY
= 1182;
1788 * OID of the `timearray` type.
1790 const TIMEARRAY
= 1183;
1792 * OID of the `timestamptz` type.
1794 const TIMESTAMPTZ
= 1184;
1796 * OID of the `timestamptzarray` type.
1798 const TIMESTAMPTZARRAY
= 1185;
1800 * OID of the `interval` type.
1802 const INTERVAL
= 1186;
1804 * OID of the `intervalarray` type.
1806 const INTERVALARRAY
= 1187;
1808 * OID of the `numericarray` type.
1810 const NUMERICARRAY
= 1231;
1812 * OID of the `timetz` type.
1814 const TIMETZ
= 1266;
1816 * OID of the `timetzarray` type.
1818 const TIMETZARRAY
= 1270;
1820 * OID of the `bit` type.
1824 * OID of the `bitarray` type.
1826 const BITARRAY
= 1561;
1828 * OID of the `varbit` type.
1830 const VARBIT
= 1562;
1832 * OID of the `varbitarray` type.
1834 const VARBITARRAY
= 1563;
1836 * OID of the `numeric` type.
1838 const NUMERIC = 1700;
1840 * OID of the `refcursor` type.
1842 const REFCURSOR
= 1790;
1844 * OID of the `refcursorarray` type.
1846 const REFCURSORARRAY
= 2201;
1848 * OID of the `regprocedure` type.
1850 const REGPROCEDURE
= 2202;
1852 * OID of the `regoper` type.
1854 const REGOPER
= 2203;
1856 * OID of the `regoperator` type.
1858 const REGOPERATOR
= 2204;
1860 * OID of the `regclass` type.
1862 const REGCLASS
= 2205;
1864 * OID of the `regtype` type.
1866 const REGTYPE
= 2206;
1868 * OID of the `regprocedurearray` type.
1870 const REGPROCEDUREARRAY
= 2207;
1872 * OID of the `regoperarray` type.
1874 const REGOPERARRAY
= 2208;
1876 * OID of the `regoperatorarray` type.
1878 const REGOPERATORARRAY
= 2209;
1880 * OID of the `regclassarray` type.
1882 const REGCLASSARRAY
= 2210;
1884 * OID of the `regtypearray` type.
1886 const REGTYPEARRAY
= 2211;
1888 * OID of the `uuid` type.
1892 * OID of the `uuidarray` type.
1894 const UUIDARRAY
= 2951;
1896 * OID of the `tsvector` type.
1898 const TSVECTOR
= 3614;
1900 * OID of the `gtsvector` type.
1902 const GTSVECTOR
= 3642;
1904 * OID of the `tsquery` type.
1906 const TSQUERY
= 3615;
1908 * OID of the `regconfig` type.
1910 const REGCONFIG
= 3734;
1912 * OID of the `regdictionary` type.
1914 const REGDICTIONARY
= 3769;
1916 * OID of the `tsvectorarray` type.
1918 const TSVECTORARRAY
= 3643;
1920 * OID of the `gtsvectorarray` type.
1922 const GTSVECTORARRAY
= 3644;
1924 * OID of the `tsqueryarray` type.
1926 const TSQUERYARRAY
= 3645;
1928 * OID of the `regconfigarray` type.
1930 const REGCONFIGARRAY
= 3735;
1932 * OID of the `regdictionaryarray` type.
1934 const REGDICTIONARYARRAY
= 3770;
1936 * OID of the `txid_snapshot` type.
1938 const TXID_SNAPSHOT
= 2970;
1940 * OID of the `txid_snapshotarray` type.
1942 const TXID_SNAPSHOTARRAY
= 2949;
1944 * OID of the `int4range` type.
1946 const INT4RANGE
= 3904;
1948 * OID of the `int4rangearray` type.
1950 const INT4RANGEARRAY
= 3905;
1952 * OID of the `numrange` type.
1954 const NUMRANGE
= 3906;
1956 * OID of the `numrangearray` type.
1958 const NUMRANGEARRAY
= 3907;
1960 * OID of the `tsrange` type.
1962 const TSRANGE
= 3908;
1964 * OID of the `tsrangearray` type.
1966 const TSRANGEARRAY
= 3909;
1968 * OID of the `tstzrange` type.
1970 const TSTZRANGE
= 3910;
1972 * OID of the `tstzrangearray` type.
1974 const TSTZRANGEARRAY
= 3911;
1976 * OID of the `daterange` type.
1978 const DATERANGE
= 3912;
1980 * OID of the `daterangearray` type.
1982 const DATERANGEARRAY
= 3913;
1984 * OID of the `int8range` type.
1986 const INT8RANGE
= 3926;
1988 * OID of the `int8rangearray` type.
1990 const INT8RANGEARRAY
= 3927;
1992 * OID of the `record` type.
1994 const RECORD
= 2249;
1996 * OID of the `recordarray` type.
1998 const RECORDARRAY
= 2287;
2000 * OID of the `cstring` type.
2002 const CSTRING
= 2275;
2004 * OID of the `any` type.
2008 * OID of the `anyarray` type.
2010 const ANYARRAY
= 2277;
2012 * OID of the `void` type.
2016 * OID of the `trigger` type.
2018 const TRIGGER
= 2279;
2020 * OID of the `event_trigger` type.
2022 const EVENT_TRIGGER
= 3838;
2024 * OID of the `language_handler` type.
2026 const LANGUAGE_HANDLER
= 2280;
2028 * OID of the `internal` type.
2030 const INTERNAL
= 2281;
2032 * OID of the `opaque` type.
2034 const OPAQUE
= 2282;
2036 * OID of the `anyelement` type.
2038 const ANYELEMENT
= 2283;
2040 * OID of the `anynonarray` type.
2042 const ANYNONARRAY
= 2776;
2044 * OID of the `anyenum` type.
2046 const ANYENUM
= 3500;
2048 * OID of the `fdw_handler` type.
2050 const FDW_HANDLER
= 3115;
2052 * OID of the `anyrange` type.
2054 const ANYRANGE
= 3831;
2056 * Create a new instance populated with information obtained from the `pg_type` relation.
2058 * @param \pq\Connection $conn The connection to use.
2059 * @param array $namespaces Which namespaces to query (defaults to `public` and `pg_catalog`).
2060 * @throws \pq\Exception\InvalidArgumentException
2061 * @throws \pq\Exception\BadMethodCallException
2062 * @throws \pq\Exception\RuntimeException
2064 function __construct(\pq\Connection
$conn, array $namespaces = NULL) {}
2066 * Refresh type information from `pg_type`.
2068 * @param array $namespaces Which namespaces to query (defaults to `public` and `pg_catalog`).
2069 * @throws \pq\Exception\InvalidArgumentException
2070 * @throws \pq\Exception\BadMethodCallException
2071 * @throws \pq\Exception\RuntimeException
2073 function refresh(array $namespaces = NULL) {}
2075 namespace pq\Exception
;
2077 * A method call was not expected.
2079 class BadMethodCallException
extends \BadMethodCallException
implements \pq\Exception
{
2082 * Implementation or SQL syntax error.
2084 class DomainException
extends \DomainException
implements \pq\Exception
{
2087 * An invalid argument was passed to a method.
2089 class InvalidArgumentException
extends \InvalidArgumentException
implements \pq\Exception
{
2092 * A runtime exception occurred.
2094 class RuntimeException
extends \RuntimeException
implements \pq\Exception
{