<?php
// These stubs were generated by the phan stub generator.
// @phan-stub-for-extension pgsql@8.1.32

namespace PgSql {
final class Connection {
}

final class Lob {
}

final class Result {
}

}

namespace {
function pg_affected_rows(\PgSql\Result $result) : int {}
function pg_cancel_query(\PgSql\Connection $connection) : bool {}
function pg_client_encoding(?\pgsql\connection $connection = null) : string {}
function pg_clientencoding(?\pgsql\connection $connection = null) : string {}
function pg_close(?\pgsql\connection $connection = null) : bool {}
function pg_cmdtuples(\PgSql\Result $result) : int {}
function pg_connect(string $connection_string, int $flags = 0) : \PgSql\Connection|false {}
function pg_connect_poll(\PgSql\Connection $connection) : int {}
function pg_connection_busy(\PgSql\Connection $connection) : bool {}
function pg_connection_reset(\PgSql\Connection $connection) : bool {}
function pg_connection_status(\PgSql\Connection $connection) : int {}
function pg_consume_input(\PgSql\Connection $connection) : bool {}
function pg_convert(\PgSql\Connection $connection, string $table_name, array $values, int $flags = 0) : array|false {}
function pg_copy_from(\PgSql\Connection $connection, string $table_name, array $rows, string $separator = "\t", string $null_as = '\\\\N') : bool {}
function pg_copy_to(\PgSql\Connection $connection, string $table_name, string $separator = "\t", string $null_as = '\\\\N') : array|false {}
function pg_dbname(?\pgsql\connection $connection = null) : string {}
function pg_delete(\PgSql\Connection $connection, string $table_name, array $conditions, int $flags = \PGSQL_DML_EXEC) : bool|string {}
function pg_end_copy(?\pgsql\connection $connection = null) : bool {}
function pg_errormessage(?\pgsql\connection $connection = null) : string {}
function pg_escape_bytea($connection, string $string = unknown) : string {}
function pg_escape_identifier($connection, string $string = unknown) : false|string {}
function pg_escape_literal($connection, string $string = unknown) : false|string {}
function pg_escape_string($connection, string $string = unknown) : string {}
function pg_exec($connection, string $query = unknown) : \PgSql\Result|false {}
function pg_execute($connection, $statement_name, array $params = unknown) : \PgSql\Result|false {}
function pg_fetch_all(\PgSql\Result $result, int $mode = \PGSQL_ASSOC) : array {}
function pg_fetch_all_columns(\PgSql\Result $result, int $field = 0) : array {}
function pg_fetch_array(\PgSql\Result $result, ?int $row = null, int $mode = \PGSQL_BOTH) : array|false {}
function pg_fetch_assoc(\PgSql\Result $result, ?int $row = null) : array|false {}
function pg_fetch_object(\PgSql\Result $result, ?int $row = null, string $class = 'stdClass', array $constructor_args = []) : false|object {}
function pg_fetch_result(\PgSql\Result $result, $row, int|string $field = unknown) : false|null|string {}
function pg_fetch_row(\PgSql\Result $result, ?int $row = null, int $mode = \PGSQL_NUM) : array|false {}
function pg_field_is_null(\PgSql\Result $result, $row, int|string $field = unknown) : false|int {}
function pg_field_name(\PgSql\Result $result, int $field) : string {}
function pg_field_num(\PgSql\Result $result, string $field) : int {}
function pg_field_prtlen(\PgSql\Result $result, $row, int|string $field = unknown) : false|int {}
function pg_field_size(\PgSql\Result $result, int $field) : int {}
function pg_field_table(\PgSql\Result $result, int $field, bool $oid_only = false) : false|int|string {}
function pg_field_type(\PgSql\Result $result, int $field) : string {}
function pg_field_type_oid(\PgSql\Result $result, int $field) : int|string {}
function pg_fieldisnull(\PgSql\Result $result, $row, int|string $field = unknown) : false|int {}
function pg_fieldname(\PgSql\Result $result, int $field) : string {}
function pg_fieldnum(\PgSql\Result $result, string $field) : int {}
function pg_fieldprtlen(\PgSql\Result $result, $row, int|string $field = unknown) : false|int {}
function pg_fieldsize(\PgSql\Result $result, int $field) : int {}
function pg_fieldtype(\PgSql\Result $result, int $field) : string {}
function pg_flush(\PgSql\Connection $connection) : bool|int {}
function pg_free_result(\PgSql\Result $result) : bool {}
function pg_freeresult(\PgSql\Result $result) : bool {}
function pg_get_notify(\PgSql\Connection $connection, int $mode = \PGSQL_ASSOC) : array|false {}
function pg_get_pid(\PgSql\Connection $connection) : int {}
function pg_get_result(\PgSql\Connection $connection) : \PgSql\Result|false {}
function pg_getlastoid(\PgSql\Result $result) : false|int|string {}
function pg_host(?\pgsql\connection $connection = null) : string {}
function pg_insert(\PgSql\Connection $connection, string $table_name, array $values, int $flags = \PGSQL_DML_EXEC) : \PgSql\Result|bool|string {}
function pg_last_error(?\pgsql\connection $connection = null) : string {}
function pg_last_notice(\PgSql\Connection $connection, int $mode = \PGSQL_NOTICE_LAST) : array|bool|string {}
function pg_last_oid(\PgSql\Result $result) : false|int|string {}
function pg_lo_close(\PgSql\Lob $lob) : bool {}
function pg_lo_create($connection = null, $oid = null) : false|int|string {}
function pg_lo_export($connection, $oid = null, $filename = null) : bool {}
function pg_lo_import($connection, $filename = null, $oid = null) : false|int|string {}
function pg_lo_open($connection, $oid = null, string $mode = unknown) : \PgSql\Lob|false {}
function pg_lo_read(\PgSql\Lob $lob, int $length = 8192) : false|string {}
function pg_lo_read_all(\PgSql\Lob $lob) : int {}
function pg_lo_seek(\PgSql\Lob $lob, int $offset, int $whence = \SEEK_CUR) : bool {}
function pg_lo_tell(\PgSql\Lob $lob) : int {}
function pg_lo_truncate(\PgSql\Lob $lob, int $size) : bool {}
function pg_lo_unlink($connection, $oid = null) : bool {}
function pg_lo_write(\PgSql\Lob $lob, string $data, ?int $length = null) : false|int {}
function pg_loclose(\PgSql\Lob $lob) : bool {}
function pg_locreate($connection = null, $oid = null) : false|int|string {}
function pg_loexport($connection, $oid = null, $filename = null) : bool {}
function pg_loimport($connection, $filename = null, $oid = null) : false|int|string {}
function pg_loopen($connection, $oid = null, string $mode = unknown) : \PgSql\Lob|false {}
function pg_loread(\PgSql\Lob $lob, int $length = 8192) : false|string {}
function pg_loreadall(\PgSql\Lob $lob) : int {}
function pg_lounlink($connection, $oid = null) : bool {}
function pg_lowrite(\PgSql\Lob $lob, string $data, ?int $length = null) : false|int {}
function pg_meta_data(\PgSql\Connection $connection, string $table_name, bool $extended = false) : array|false {}
function pg_num_fields(\PgSql\Result $result) : int {}
function pg_num_rows(\PgSql\Result $result) : int {}
function pg_numfields(\PgSql\Result $result) : int {}
function pg_numrows(\PgSql\Result $result) : int {}
function pg_options(?\pgsql\connection $connection = null) : string {}
function pg_parameter_status($connection, string $name = unknown) : false|string {}
function pg_pconnect(string $connection_string, int $flags = 0) : \PgSql\Connection|false {}
function pg_ping(?\pgsql\connection $connection = null) : bool {}
function pg_port(?\pgsql\connection $connection = null) : string {}
function pg_prepare($connection, string $statement_name, string $query = unknown) : \PgSql\Result|false {}
function pg_put_line($connection, string $query = unknown) : bool {}
function pg_query($connection, string $query = unknown) : \PgSql\Result|false {}
function pg_query_params($connection, $query, array $params = unknown) : \PgSql\Result|false {}
function pg_result(\PgSql\Result $result, $row, int|string $field = unknown) : false|null|string {}
function pg_result_error(\PgSql\Result $result) : false|string {}
function pg_result_error_field(\PgSql\Result $result, int $field_code) : false|null|string {}
function pg_result_seek(\PgSql\Result $result, int $row) : bool {}
function pg_result_status(\PgSql\Result $result, int $mode = \PGSQL_STATUS_LONG) : int|string {}
function pg_select(\PgSql\Connection $connection, string $table_name, array $conditions, int $flags = \PGSQL_DML_EXEC, int $mode = \PGSQL_ASSOC) : array|false|string {}
function pg_send_execute(\PgSql\Connection $connection, string $statement_name, array $params) : bool|int {}
function pg_send_prepare(\PgSql\Connection $connection, string $statement_name, string $query) : bool|int {}
function pg_send_query(\PgSql\Connection $connection, string $query) : bool|int {}
function pg_send_query_params(\PgSql\Connection $connection, string $query, array $params) : bool|int {}
function pg_set_client_encoding($connection, string $encoding = unknown) : int {}
function pg_set_error_verbosity($connection, int $verbosity = unknown) : false|int {}
function pg_setclientencoding($connection, string $encoding = unknown) : int {}
function pg_socket(\PgSql\Connection $connection) {}
function pg_trace(string $filename, string $mode = 'w', ?\pgsql\connection $connection = null) : bool {}
function pg_transaction_status(\PgSql\Connection $connection) : int {}
function pg_tty(?\pgsql\connection $connection = null) : string {}
function pg_unescape_bytea(string $string) : string {}
function pg_untrace(?\pgsql\connection $connection = null) : bool {}
function pg_update(\PgSql\Connection $connection, string $table_name, array $values, array $conditions, int $flags = \PGSQL_DML_EXEC) : bool|string {}
function pg_version(?\pgsql\connection $connection = null) : array {}
const PGSQL_ASSOC = 1;
const PGSQL_BAD_RESPONSE = 5;
const PGSQL_BOTH = 3;
const PGSQL_COMMAND_OK = 1;
const PGSQL_CONNECTION_AUTH_OK = 5;
const PGSQL_CONNECTION_AWAITING_RESPONSE = 4;
const PGSQL_CONNECTION_BAD = 1;
const PGSQL_CONNECTION_MADE = 3;
const PGSQL_CONNECTION_OK = 0;
const PGSQL_CONNECTION_SETENV = 6;
const PGSQL_CONNECTION_STARTED = 2;
const PGSQL_CONNECT_ASYNC = 4;
const PGSQL_CONNECT_FORCE_NEW = 2;
const PGSQL_CONV_FORCE_NULL = 4;
const PGSQL_CONV_IGNORE_DEFAULT = 2;
const PGSQL_CONV_IGNORE_NOT_NULL = 8;
const PGSQL_COPY_IN = 4;
const PGSQL_COPY_OUT = 3;
const PGSQL_DIAG_COLUMN_NAME = 99;
const PGSQL_DIAG_CONSTRAINT_NAME = 110;
const PGSQL_DIAG_CONTEXT = 87;
const PGSQL_DIAG_DATATYPE_NAME = 100;
const PGSQL_DIAG_INTERNAL_POSITION = 112;
const PGSQL_DIAG_INTERNAL_QUERY = 113;
const PGSQL_DIAG_MESSAGE_DETAIL = 68;
const PGSQL_DIAG_MESSAGE_HINT = 72;
const PGSQL_DIAG_MESSAGE_PRIMARY = 77;
const PGSQL_DIAG_SCHEMA_NAME = 115;
const PGSQL_DIAG_SEVERITY = 83;
const PGSQL_DIAG_SEVERITY_NONLOCALIZED = 86;
const PGSQL_DIAG_SOURCE_FILE = 70;
const PGSQL_DIAG_SOURCE_FUNCTION = 82;
const PGSQL_DIAG_SOURCE_LINE = 76;
const PGSQL_DIAG_SQLSTATE = 67;
const PGSQL_DIAG_STATEMENT_POSITION = 80;
const PGSQL_DIAG_TABLE_NAME = 116;
const PGSQL_DML_ASYNC = 1024;
const PGSQL_DML_ESCAPE = 4096;
const PGSQL_DML_EXEC = 512;
const PGSQL_DML_NO_CONV = 256;
const PGSQL_DML_STRING = 2048;
const PGSQL_EMPTY_QUERY = 0;
const PGSQL_ERRORS_DEFAULT = 1;
const PGSQL_ERRORS_TERSE = 0;
const PGSQL_ERRORS_VERBOSE = 2;
const PGSQL_FATAL_ERROR = 7;
const PGSQL_LIBPQ_VERSION = '16.9';
const PGSQL_LIBPQ_VERSION_STR = '16.9';
const PGSQL_NONFATAL_ERROR = 6;
const PGSQL_NOTICE_ALL = 2;
const PGSQL_NOTICE_CLEAR = 3;
const PGSQL_NOTICE_LAST = 1;
const PGSQL_NUM = 2;
const PGSQL_POLLING_ACTIVE = 4;
const PGSQL_POLLING_FAILED = 0;
const PGSQL_POLLING_OK = 3;
const PGSQL_POLLING_READING = 1;
const PGSQL_POLLING_WRITING = 2;
const PGSQL_SEEK_CUR = 1;
const PGSQL_SEEK_END = 2;
const PGSQL_SEEK_SET = 0;
const PGSQL_STATUS_LONG = 1;
const PGSQL_STATUS_STRING = 2;
const PGSQL_TRANSACTION_ACTIVE = 1;
const PGSQL_TRANSACTION_IDLE = 0;
const PGSQL_TRANSACTION_INERROR = 3;
const PGSQL_TRANSACTION_INTRANS = 2;
const PGSQL_TRANSACTION_UNKNOWN = 4;
const PGSQL_TUPLES_OK = 2;
}
