]> granicus.if.org Git - php/commitdiff
Add stub for pgsql extension
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 9 Sep 2020 10:20:10 +0000 (12:20 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 9 Sep 2020 14:47:10 +0000 (16:47 +0200)
ext/pgsql/pgsql.c
ext/pgsql/pgsql.stub.php [new file with mode: 0644]
ext/pgsql/pgsql_arginfo.h [new file with mode: 0644]

index f8fcd74c9db4abdb6c96aa5f188497ab8d67c166..ec5a6dcee2f343e67fcfeea426cf2c24ff0b5c95 100644 (file)
@@ -39,6 +39,7 @@
 #include "php_pgsql.h"
 #include "php_globals.h"
 #include "zend_exceptions.h"
+#include "pgsql_arginfo.h"
 
 #ifdef HAVE_PGSQL
 
 ZEND_DECLARE_MODULE_GLOBALS(pgsql)
 static PHP_GINIT_FUNCTION(pgsql);
 
-/* {{{ arginfo */
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_connect, 0, 0, 1)
-       ZEND_ARG_INFO(0, connection_string)
-       ZEND_ARG_INFO(0, connect_type)
-       ZEND_ARG_INFO(0, host)
-       ZEND_ARG_INFO(0, port)
-       ZEND_ARG_INFO(0, options)
-       ZEND_ARG_INFO(0, tty)
-       ZEND_ARG_INFO(0, database)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_pconnect, 0, 0, 1)
-       ZEND_ARG_INFO(0, connection_string)
-       ZEND_ARG_INFO(0, host)
-       ZEND_ARG_INFO(0, port)
-       ZEND_ARG_INFO(0, options)
-       ZEND_ARG_INFO(0, tty)
-       ZEND_ARG_INFO(0, database)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_connect_poll, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_parameter_status, 0, 0, 1)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, param_name)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_close, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_dbname, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_last_error, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_options, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_port, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_tty, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_host, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_version, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_ping, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_query, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, query)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_query_params, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, query)
-       ZEND_ARG_INFO(0, params)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_prepare, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, stmtname)
-       ZEND_ARG_INFO(0, query)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_execute, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, stmtname)
-       ZEND_ARG_INFO(0, params)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_num_rows, 0, 0, 1)
-       ZEND_ARG_INFO(0, result)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_num_fields, 0, 0, 1)
-       ZEND_ARG_INFO(0, result)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_affected_rows, 0, 0, 1)
-       ZEND_ARG_INFO(0, result)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_last_notice, 0, 0, 1)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, option)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_field_table, 0, 0, 2)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, field_number)
-       ZEND_ARG_INFO(0, oid_only)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_field_name, 0, 0, 2)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, field_number)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_field_size, 0, 0, 2)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, field_number)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_field_type, 0, 0, 2)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, field_number)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_field_type_oid, 0, 0, 2)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, field_number)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_field_num, 0, 0, 2)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, field_name)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_fetch_result, 0, 0, 2)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, row_number)
-       ZEND_ARG_INFO(0, field_name)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_fetch_row, 0, 0, 1)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, row)
-       ZEND_ARG_INFO(0, result_type)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_fetch_assoc, 0, 0, 1)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, row)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_fetch_array, 0, 0, 1)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, row)
-       ZEND_ARG_INFO(0, result_type)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_fetch_object, 0, 0, 1)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, row)
-       ZEND_ARG_INFO(0, class_name)
-       ZEND_ARG_INFO(0, l)
-       ZEND_ARG_INFO(0, ctor_params)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_fetch_all, 0, 0, 1)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, result_type)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_fetch_all_columns, 0, 0, 1)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, column_number)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_result_seek, 0, 0, 2)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, offset)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_field_prtlen, 0, 0, 1)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, row)
-       ZEND_ARG_INFO(0, field_name_or_number)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_field_is_null, 0, 0, 1)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, row)
-       ZEND_ARG_INFO(0, field_name_or_number)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_free_result, 0, 0, 1)
-       ZEND_ARG_INFO(0, result)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_last_oid, 0, 0, 1)
-       ZEND_ARG_INFO(0, result)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_trace, 0, 0, 1)
-       ZEND_ARG_INFO(0, filename)
-       ZEND_ARG_INFO(0, mode)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_untrace, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_lo_create, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, large_object_id)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_lo_unlink, 0, 0, 1)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, large_object_oid)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_lo_open, 0, 0, 1)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, large_object_oid)
-       ZEND_ARG_INFO(0, mode)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_lo_close, 0, 0, 1)
-       ZEND_ARG_INFO(0, large_object)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_lo_read, 0, 0, 1)
-       ZEND_ARG_INFO(0, large_object)
-       ZEND_ARG_INFO(0, len)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_lo_write, 0, 0, 2)
-       ZEND_ARG_INFO(0, large_object)
-       ZEND_ARG_INFO(0, buf)
-       ZEND_ARG_INFO(0, len)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_lo_read_all, 0, 0, 1)
-       ZEND_ARG_INFO(0, large_object)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_lo_import, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, filename)
-       ZEND_ARG_INFO(0, large_object_oid)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_lo_export, 0, 0, 2)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, objoid)
-       ZEND_ARG_INFO(0, filename)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_lo_seek, 0, 0, 2)
-       ZEND_ARG_INFO(0, large_object)
-       ZEND_ARG_INFO(0, offset)
-       ZEND_ARG_INFO(0, whence)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_lo_tell, 0, 0, 1)
-       ZEND_ARG_INFO(0, large_object)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_lo_truncate, 0, 0, 1)
-       ZEND_ARG_INFO(0, large_object)
-       ZEND_ARG_INFO(0, size)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_set_error_verbosity, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, verbosity)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_set_client_encoding, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, encoding)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_client_encoding, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_end_copy, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_put_line, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, query)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_copy_to, 0, 0, 2)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, table_name)
-       ZEND_ARG_INFO(0, delimiter)
-       ZEND_ARG_INFO(0, null_as)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_copy_from, 0, 0, 3)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, table_name)
-       ZEND_ARG_INFO(0, rows)
-       ZEND_ARG_INFO(0, delimiter)
-       ZEND_ARG_INFO(0, null_as)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_escape_string, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, data)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_escape_bytea, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, data)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_unescape_bytea, 0, 0, 1)
-       ZEND_ARG_INFO(0, data)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_escape_literal, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, data)
-ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_escape_identifier, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, data)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_result_error, 0, 0, 1)
-       ZEND_ARG_INFO(0, result)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_result_error_field, 0, 0, 2)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, fieldcode)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_connection_status, 0, 0, 1)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_transaction_status, 0, 0, 1)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_connection_reset, 0, 0, 1)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_cancel_query, 0, 0, 1)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_connection_busy, 0, 0, 1)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_send_query, 0, 0, 2)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, query)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_send_query_params, 0, 0, 3)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, query)
-       ZEND_ARG_INFO(0, params)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_send_prepare, 0, 0, 3)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, stmtname)
-       ZEND_ARG_INFO(0, query)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_send_execute, 0, 0, 3)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, stmtname)
-       ZEND_ARG_INFO(0, params)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_get_result, 0, 0, 1)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_result_status, 0, 0, 1)
-       ZEND_ARG_INFO(0, result)
-       ZEND_ARG_INFO(0, result_type)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_get_notify, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-       ZEND_ARG_INFO(0, e)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_get_pid, 0, 0, 0)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_socket, 0, 0, 1)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_consume_input, 0, 0, 1)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_flush, 0, 0, 1)
-       ZEND_ARG_INFO(0, connection)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_meta_data, 0, 0, 2)
-       ZEND_ARG_INFO(0, db)
-       ZEND_ARG_INFO(0, table)
-       ZEND_ARG_INFO(0, extended)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_convert, 0, 0, 3)
-       ZEND_ARG_INFO(0, db)
-       ZEND_ARG_INFO(0, table)
-       ZEND_ARG_INFO(0, values)
-       ZEND_ARG_INFO(0, options)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_insert, 0, 0, 3)
-       ZEND_ARG_INFO(0, db)
-       ZEND_ARG_INFO(0, table)
-       ZEND_ARG_INFO(0, values)
-       ZEND_ARG_INFO(0, options)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_update, 0, 0, 4)
-       ZEND_ARG_INFO(0, db)
-       ZEND_ARG_INFO(0, table)
-       ZEND_ARG_INFO(0, fields)
-       ZEND_ARG_INFO(0, ids)
-       ZEND_ARG_INFO(0, options)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_delete, 0, 0, 3)
-       ZEND_ARG_INFO(0, db)
-       ZEND_ARG_INFO(0, table)
-       ZEND_ARG_INFO(0, ids)
-       ZEND_ARG_INFO(0, options)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_select, 0, 0, 3)
-       ZEND_ARG_INFO(0, db)
-       ZEND_ARG_INFO(0, table)
-       ZEND_ARG_INFO(0, ids)
-       ZEND_ARG_INFO(0, options)
-       ZEND_ARG_INFO(0, result_type)
-ZEND_END_ARG_INFO()
-/* }}} */
-
-/* {{{ pgsql_functions[] */
-static const zend_function_entry pgsql_functions[] = {
-       /* connection functions */
-       PHP_FE(pg_connect,              arginfo_pg_connect)
-       PHP_FE(pg_pconnect,             arginfo_pg_pconnect)
-       PHP_FE(pg_connect_poll, arginfo_pg_connect_poll)
-       PHP_FE(pg_close,                arginfo_pg_close)
-       PHP_FE(pg_connection_status,    arginfo_pg_connection_status)
-       PHP_FE(pg_connection_busy,              arginfo_pg_connection_busy)
-       PHP_FE(pg_connection_reset,             arginfo_pg_connection_reset)
-       PHP_FE(pg_host,                 arginfo_pg_host)
-       PHP_FE(pg_dbname,               arginfo_pg_dbname)
-       PHP_FE(pg_port,                 arginfo_pg_port)
-       PHP_FE(pg_tty,                  arginfo_pg_tty)
-       PHP_FE(pg_options,              arginfo_pg_options)
-       PHP_FE(pg_version,              arginfo_pg_version)
-       PHP_FE(pg_ping,                 arginfo_pg_ping)
-       PHP_FE(pg_parameter_status, arginfo_pg_parameter_status)
-       PHP_FE(pg_transaction_status, arginfo_pg_transaction_status)
-       /* query functions */
-       PHP_FE(pg_query,                arginfo_pg_query)
-       PHP_FE(pg_query_params,         arginfo_pg_query_params)
-       PHP_FE(pg_prepare,              arginfo_pg_prepare)
-       PHP_FE(pg_execute,              arginfo_pg_execute)
-       PHP_FE(pg_send_query,   arginfo_pg_send_query)
-       PHP_FE(pg_send_query_params,    arginfo_pg_send_query_params)
-       PHP_FE(pg_send_prepare, arginfo_pg_send_prepare)
-       PHP_FE(pg_send_execute, arginfo_pg_send_execute)
-       PHP_FE(pg_cancel_query, arginfo_pg_cancel_query)
-       /* result functions */
-       PHP_FE(pg_fetch_result, arginfo_pg_fetch_result)
-       PHP_FE(pg_fetch_row,    arginfo_pg_fetch_row)
-       PHP_FE(pg_fetch_assoc,  arginfo_pg_fetch_assoc)
-       PHP_FE(pg_fetch_array,  arginfo_pg_fetch_array)
-       PHP_FE(pg_fetch_object, arginfo_pg_fetch_object)
-       PHP_FE(pg_fetch_all,    arginfo_pg_fetch_all)
-       PHP_FE(pg_fetch_all_columns,    arginfo_pg_fetch_all_columns)
-       PHP_FE(pg_affected_rows,arginfo_pg_affected_rows)
-       PHP_FE(pg_get_result,   arginfo_pg_get_result)
-       PHP_FE(pg_result_seek,  arginfo_pg_result_seek)
-       PHP_FE(pg_result_status,arginfo_pg_result_status)
-       PHP_FE(pg_free_result,  arginfo_pg_free_result)
-       PHP_FE(pg_last_oid,         arginfo_pg_last_oid)
-       PHP_FE(pg_num_rows,             arginfo_pg_num_rows)
-       PHP_FE(pg_num_fields,   arginfo_pg_num_fields)
-       PHP_FE(pg_field_name,   arginfo_pg_field_name)
-       PHP_FE(pg_field_num,    arginfo_pg_field_num)
-       PHP_FE(pg_field_size,   arginfo_pg_field_size)
-       PHP_FE(pg_field_type,   arginfo_pg_field_type)
-       PHP_FE(pg_field_type_oid, arginfo_pg_field_type_oid)
-       PHP_FE(pg_field_prtlen, arginfo_pg_field_prtlen)
-       PHP_FE(pg_field_is_null,arginfo_pg_field_is_null)
-       PHP_FE(pg_field_table,  arginfo_pg_field_table)
-       /* async message function */
-       PHP_FE(pg_get_notify,   arginfo_pg_get_notify)
-       PHP_FE(pg_socket,               arginfo_pg_socket)
-       PHP_FE(pg_consume_input,arginfo_pg_consume_input)
-       PHP_FE(pg_flush,                arginfo_pg_flush)
-       PHP_FE(pg_get_pid,      arginfo_pg_get_pid)
-       /* error message functions */
-       PHP_FE(pg_result_error, arginfo_pg_result_error)
-       PHP_FE(pg_result_error_field, arginfo_pg_result_error_field)
-       PHP_FE(pg_last_error,   arginfo_pg_last_error)
-       PHP_FE(pg_last_notice,  arginfo_pg_last_notice)
-       /* copy functions */
-       PHP_FE(pg_put_line,             arginfo_pg_put_line)
-       PHP_FE(pg_end_copy,             arginfo_pg_end_copy)
-       PHP_FE(pg_copy_to,      arginfo_pg_copy_to)
-       PHP_FE(pg_copy_from,    arginfo_pg_copy_from)
-       /* debug functions */
-       PHP_FE(pg_trace,                arginfo_pg_trace)
-       PHP_FE(pg_untrace,              arginfo_pg_untrace)
-       /* large object functions */
-       PHP_FE(pg_lo_create,    arginfo_pg_lo_create)
-       PHP_FE(pg_lo_unlink,    arginfo_pg_lo_unlink)
-       PHP_FE(pg_lo_open,              arginfo_pg_lo_open)
-       PHP_FE(pg_lo_close,             arginfo_pg_lo_close)
-       PHP_FE(pg_lo_read,              arginfo_pg_lo_read)
-       PHP_FE(pg_lo_write,             arginfo_pg_lo_write)
-       PHP_FE(pg_lo_read_all,  arginfo_pg_lo_read_all)
-       PHP_FE(pg_lo_import,    arginfo_pg_lo_import)
-       PHP_FE(pg_lo_export,    arginfo_pg_lo_export)
-       PHP_FE(pg_lo_seek,              arginfo_pg_lo_seek)
-       PHP_FE(pg_lo_tell,              arginfo_pg_lo_tell)
-       PHP_FE(pg_lo_truncate,  arginfo_pg_lo_truncate)
-       /* utility functions */
-       PHP_FE(pg_escape_string,        arginfo_pg_escape_string)
-       PHP_FE(pg_escape_bytea,         arginfo_pg_escape_bytea)
-       PHP_FE(pg_unescape_bytea,       arginfo_pg_unescape_bytea)
-       PHP_FE(pg_escape_literal,       arginfo_pg_escape_literal)
-       PHP_FE(pg_escape_identifier,    arginfo_pg_escape_identifier)
-       PHP_FE(pg_set_error_verbosity,  arginfo_pg_set_error_verbosity)
-       PHP_FE(pg_client_encoding,              arginfo_pg_client_encoding)
-       PHP_FE(pg_set_client_encoding,  arginfo_pg_set_client_encoding)
-       /* misc function */
-       PHP_FE(pg_meta_data,    arginfo_pg_meta_data)
-       PHP_FE(pg_convert,      arginfo_pg_convert)
-       PHP_FE(pg_insert,       arginfo_pg_insert)
-       PHP_FE(pg_update,       arginfo_pg_update)
-       PHP_FE(pg_delete,       arginfo_pg_delete)
-       PHP_FE(pg_select,       arginfo_pg_select)
-       /* aliases for downwards compatibility */
-       PHP_FALIAS(pg_exec,          pg_query,          arginfo_pg_query)
-       PHP_FALIAS(pg_getlastoid,    pg_last_oid,       arginfo_pg_last_oid)
-       PHP_FALIAS(pg_cmdtuples,         pg_affected_rows,  arginfo_pg_affected_rows)
-       PHP_FALIAS(pg_errormessage,      pg_last_error,     arginfo_pg_last_error)
-       PHP_FALIAS(pg_numrows,           pg_num_rows,       arginfo_pg_num_rows)
-       PHP_FALIAS(pg_numfields,         pg_num_fields,     arginfo_pg_num_fields)
-       PHP_FALIAS(pg_fieldname,         pg_field_name,     arginfo_pg_field_name)
-       PHP_FALIAS(pg_fieldsize,     pg_field_size,     arginfo_pg_field_size)
-       PHP_FALIAS(pg_fieldtype,         pg_field_type,     arginfo_pg_field_type)
-       PHP_FALIAS(pg_fieldnum,      pg_field_num,      arginfo_pg_field_num)
-       PHP_FALIAS(pg_fieldprtlen,       pg_field_prtlen,   arginfo_pg_field_prtlen)
-       PHP_FALIAS(pg_fieldisnull,       pg_field_is_null,  arginfo_pg_field_is_null)
-       PHP_FALIAS(pg_freeresult,    pg_free_result,    arginfo_pg_free_result)
-       PHP_FALIAS(pg_result,        pg_fetch_result,   arginfo_pg_fetch_result)
-       PHP_FALIAS(pg_loreadall,         pg_lo_read_all,    arginfo_pg_lo_read_all)
-       PHP_FALIAS(pg_locreate,      pg_lo_create,      arginfo_pg_lo_create)
-       PHP_FALIAS(pg_lounlink,      pg_lo_unlink,      arginfo_pg_lo_unlink)
-       PHP_FALIAS(pg_loopen,        pg_lo_open,        arginfo_pg_lo_open)
-       PHP_FALIAS(pg_loclose,       pg_lo_close,       arginfo_pg_lo_close)
-       PHP_FALIAS(pg_loread,        pg_lo_read,        arginfo_pg_lo_read)
-       PHP_FALIAS(pg_lowrite,       pg_lo_write,       arginfo_pg_lo_write)
-       PHP_FALIAS(pg_loimport,      pg_lo_import,      arginfo_pg_lo_import)
-       PHP_FALIAS(pg_loexport,      pg_lo_export,      arginfo_pg_lo_export)
-       PHP_FALIAS(pg_clientencoding,           pg_client_encoding,             arginfo_pg_client_encoding)
-       PHP_FALIAS(pg_setclientencoding,        pg_set_client_encoding, arginfo_pg_set_client_encoding)
-       PHP_FE_END
-};
-/* }}} */
-
 /* {{{ pgsql_module_entry */
 zend_module_entry pgsql_module_entry = {
        STANDARD_MODULE_HEADER,
        "pgsql",
-       pgsql_functions,
+       ext_functions,
        PHP_MINIT(pgsql),
        PHP_MSHUTDOWN(pgsql),
        PHP_RINIT(pgsql),
@@ -1428,8 +837,7 @@ static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type
                                PHP_PQ_COPY_PARAM("application_name");
                        }
                        return;
-               default:
-                       RETURN_FALSE;
+               EMPTY_SWITCH_DEFAULT_CASE()
        }
        if (result) {
                RETURN_STRING(result);
@@ -1498,12 +906,12 @@ PHP_FUNCTION(pg_parameter_status)
        size_t len;
 
        if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "rs", &pgsql_link, &param, &len) == FAILURE) {
-               if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &param, &len) == SUCCESS) {
-                       link = FETCH_DEFAULT_LINK();
-                       CHECK_DEFAULT_LINK(link);
-               } else {
-                       RETURN_FALSE;
+               if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &param, &len) == FAILURE) {
+                       RETURN_THROWS();
                }
+
+               link = FETCH_DEFAULT_LINK();
+               CHECK_DEFAULT_LINK(link);
        } else {
                link = Z_RES_P(pgsql_link);
        }
@@ -1994,8 +1402,7 @@ static void php_pgsql_get_result_info(INTERNAL_FUNCTION_PARAMETERS, int entry_ty
                case PHP_PG_CMD_TUPLES:
                        RETVAL_LONG(atoi(PQcmdTuples(pgsql_result)));
                        break;
-               default:
-                       RETURN_FALSE;
+               EMPTY_SWITCH_DEFAULT_CASE()
        }
 }
 /* }}} */
@@ -2280,8 +1687,7 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ
                                RETURN_LONG((zend_long)oid);
                        }
                        break;
-               default:
-                       RETURN_FALSE;
+               EMPTY_SWITCH_DEFAULT_CASE()
        }
 }
 /* }}} */
@@ -2753,6 +2159,7 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
                case PHP_PG_DATA_ISNULL:
                        RETVAL_LONG(PQgetisnull(pgsql_result, pgsql_row, field_offset));
                        break;
+               EMPTY_SWITCH_DEFAULT_CASE()
        }
 }
 /* }}} */
@@ -4226,9 +3633,7 @@ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
                                PQclear(pgsql_result);
                        }
                        break;
-               default:
-                       php_error_docref(NULL, E_ERROR, "PostgreSQL module error, please report this error");
-                       break;
+               EMPTY_SWITCH_DEFAULT_CASE()
        }
        if (PQsetnonblocking(pgsql, 0)) {
                php_error_docref(NULL, E_NOTICE, "Cannot set connection to blocking mode");
@@ -6492,6 +5897,7 @@ PHP_FUNCTION(pg_select)
        zend_string *sql = NULL;
        int argc = ZEND_NUM_ARGS();
 
+       // TODO: result_type is unused by zpp!
        if (zend_parse_parameters(argc, "rsa|l",
                                                          &pgsql_link, &table, &table_len, &ids, &option, &result_type) == FAILURE) {
                RETURN_THROWS();
diff --git a/ext/pgsql/pgsql.stub.php b/ext/pgsql/pgsql.stub.php
new file mode 100644 (file)
index 0000000..624587d
--- /dev/null
@@ -0,0 +1,504 @@
+<?php
+
+/** @generate-function-entries */
+
+/** @return resource|false */
+function pg_connect(string $connection_string, int $connection_type = 0) {}
+
+/** @return resource|false */
+function pg_pconnect(string $connection_string, int $connection_type = 0) {}
+
+/** @param resource $connection */
+function pg_connect_poll($connection): int {}
+
+/** @param resource $connection */
+function pg_close($connection = UNKNOWN): bool {}
+
+/** @param resource $connection */
+function pg_dbname($connection = UNKNOWN): string {}
+
+/** @param resource $connection */
+function pg_last_error($connection = UNKNOWN): string {}
+
+/**
+ * @param resource $connection
+ * @alias pg_last_error
+ */
+function pg_errormessage($connection = UNKNOWN): string {}
+
+/** @param resource $connection */
+function pg_options($connection = UNKNOWN): string {}
+
+/** @param resource $connection */
+function pg_port($connection = UNKNOWN): string {}
+
+/** @param resource $connection */
+function pg_tty($connection = UNKNOWN): string {}
+
+/** @param resource $connection */
+function pg_host($connection = UNKNOWN): string {}
+
+/** @param resource $connection */
+function pg_version($connection = UNKNOWN): array {}
+
+/** @param resource|string $connection */
+function pg_parameter_status($connection, string $param_name = UNKNOWN): string|false {}
+
+/** @param resource $connection */
+function pg_ping($connection = UNKNOWN): bool {}
+
+/**
+ * @param resource|string $connection
+ * @return resource|false
+ */
+function pg_query($connection, string $query = UNKNOWN) {}
+
+/**
+ * @param resource|string $connection
+ * @return resource|false
+ * @alias pg_query
+ */
+function pg_exec($connection, string $query = UNKNOWN) {}
+
+/**
+ * @param resource|string $connection
+ * @param string|array $query
+ * @return resource|false
+ */
+function pg_query_params($connection, $query, array $params = UNKNOWN) {}
+
+/**
+ * @param resource|string $connection
+ * @return resource|false
+ */
+function pg_prepare($connection, string $stmt_name, string $query = UNKNOWN) {}
+
+/**
+ * @param resource|string $connection
+ * @param string|array $stmt_name
+ * @return resource|false
+ */
+function pg_execute($connection, $stmt_name, array $params = UNKNOWN) {}
+
+/** @param resource $result */
+function pg_num_rows($result): int {}
+
+/**
+ * @param resource $result
+ * @alias pg_num_rows
+ */
+function pg_numrows($result): int {}
+
+/** @param resource $result */
+function pg_num_fields($result): int {}
+
+/**
+ * @param resource $result
+ * @alias pg_num_fields
+ */
+function pg_numfields($result): int {}
+
+/** @param resource $result */
+function pg_affected_rows($result): int {}
+
+/**
+ * @param resource $result
+ * @alias pg_affected_rows
+ */
+function pg_cmdtuples($result): int {}
+
+/** @param resource $connection */
+function pg_last_notice($connection, int $option = PGSQL_NOTICE_LAST): array|string|bool {}
+
+/** @param resource $result */
+function pg_field_table($result, int $field_number, bool $oid_only = false): string|int|false {}
+
+/** @param resource $result */
+function pg_field_name($result, int $field_number): string|false {}
+
+/**
+ * @param resource $result
+ * @alias pg_field_name
+ */
+function pg_fieldname($result, int $field_number): string|false {}
+
+/** @param resource $result */
+function pg_field_size($result, int $field_number): int|false {}
+
+/**
+ * @param resource $result
+ * @alias pg_field_size
+ */
+function pg_fieldsize($result, int $field_number): int|false {}
+
+/** @param resource $result */
+function pg_field_type($result, int $field_number): string|false {}
+
+/**
+ * @param resource $result
+ * @alias pg_field_type
+ */
+function pg_fieldtype($result, int $field_number): string|false {}
+
+/** @param resource $result */
+function pg_field_type_oid($result, int $field_number): string|int|false {}
+
+/** @param resource $result */
+function pg_field_num($result, string $field_name): int {}
+
+/**
+ * @param resource $result
+ * @alias pg_field_num
+ */
+function pg_fieldnum($result, string $field_name): int {}
+
+/**
+ * @param resource $result
+ * @param string|int $row_number
+ * @param string|int $field
+ */
+function pg_fetch_result($result, $row_number, $field = UNKNOWN): string|false|null {}
+
+/**
+ * @param resource $result
+ * @param string|int $row_number
+ * @param string|int $field
+ * @alias pg_fetch_result
+ */
+function pg_result($result, $row_number, $field = UNKNOWN): string|false|null {}
+
+/**
+ * @param resource $result
+ * @param int|null $row_number
+ */
+function pg_fetch_row($result, $row_number = null, int $result_type = PGSQL_NUM): array|false {}
+
+/**
+ * @param resource $result
+ * @param int|null $row_number
+ */
+function pg_fetch_assoc($result, $row_number = null): array|false {}
+
+/**
+ * @param resource $result
+ * @param int|null $row_number
+ */
+function pg_fetch_array($result, $row_number = null, int $result_type = PGSQL_BOTH): array|false {}
+
+/**
+ * @param resource $result
+ * @param int|null $row_number
+ * @param array|null $ctor_params
+ */
+function pg_fetch_object($result, $row_number = null, string $class_name = "stdClass", $ctor_params = null): object|false {}
+
+/** @param resource $result */
+function pg_fetch_all($result, int $result_type = PGSQL_ASSOC): array|false {}
+
+/** @param resource $result */
+function pg_fetch_all_columns($result, int $column_number = 0): array|false {}
+
+/** @param resource $result */
+function pg_result_seek($result, int $row_number): bool {}
+
+/**
+ * @param resource $result
+ * @param string|int $row_number
+ * @param string|int $field
+ */
+function pg_field_prtlen($result, $row_number, $field = UNKNOWN): int|false {}
+
+/**
+ * @param resource $result
+ * @param string|int $row_number
+ * @param string|int $field
+ * @alias pg_field_prtlen
+ */
+function pg_fieldprtlen($result, $row_number, $field = UNKNOWN): int|false {}
+
+/**
+ * @param resource $result
+ * @param string|int $row_number
+ * @param string|int $field
+ */
+function pg_field_is_null($result, $row_number, $field = UNKNOWN): int|false {}
+
+/**
+ * @param resource $result
+ * @param string|int $row_number
+ * @param string|int $field
+ * @alias pg_field_is_null
+ */
+function pg_fieldisnull($result, $row_number, $field = UNKNOWN): int|false {}
+
+/** @param resource $result */
+function pg_free_result($result): bool {}
+
+/**
+ * @param resource $result
+ * @alias pg_free_result
+ */
+function pg_freeresult($result): bool {}
+
+/** @param resource $result */
+function pg_last_oid($result): string|int|false {}
+
+/**
+ * @param resource $result
+ * @alias pg_last_oid
+ */
+function pg_getlastoid($result): string|int|false {}
+
+/** @param resource $connection */
+function pg_trace(string $filename, string $mode = "w", $connection = UNKNOWN): bool {}
+
+/** @param resource $connection */
+function pg_untrace($connection = UNKNOWN): bool {}
+
+/**
+ * @param resource $connection
+ * @param string|int $large_object_id
+ */
+function pg_lo_create($connection = UNKNOWN, $large_object_id = UNKNOWN): string|int|false {}
+
+/**
+ * @param resource $connection
+ * @param string|int $large_object_id
+ * @alias pg_lo_create
+ */
+function pg_locreate($connection = UNKNOWN, $large_object_id = UNKNOWN): string|int|false {}
+
+/**
+ * @param resource $connection
+ * @param string|int $large_object_id
+ */
+function pg_lo_unlink($connection, $large_object_id = UNKNOWN): bool {}
+
+/**
+ * @param resource $connection
+ * @param string|int $large_object_id
+ * @alias pg_lo_unlink
+ */
+function pg_lounlink($connection, $large_object_id = UNKNOWN): bool {}
+
+/**
+ * @param resource $connection
+ * @param string|int $large_object_id
+ * @return resource|false
+ */
+function pg_lo_open($connection, $large_object_id = UNKNOWN, string $mode = UNKNOWN) {}
+
+/**
+ * @param resource $connection
+ * @param string|int $large_object_id
+ * @return resource|false
+ * @alias pg_lo_open
+ */
+function pg_loopen($connection, $large_object_id = UNKNOWN, string $mode = UNKNOWN) {}
+
+/** @param resource $large_object */
+function pg_lo_close($large_object): bool {}
+
+/**
+ * @param resource $large_object
+ * @alias pg_lo_close
+ */
+function pg_loclose($large_object): bool {}
+
+/** @param resource $large_object */
+function pg_lo_read($large_object, int $len = 8192): string|false {}
+
+/**
+ * @param resource $large_object
+ * @alias pg_lo_read
+ */
+function pg_loread($large_object, int $len = 8192): string|false {}
+
+/** @param resource $large_object */
+function pg_lo_write($large_object, string $buf, int $len = UNKNOWN): int|false {}
+
+/**
+ * @param resource $large_object
+ * @alias pg_lo_write
+ */
+function pg_lowrite($large_object, string $buf, int $len = UNKNOWN): int|false {}
+
+/** @param resource $large_object */
+function pg_lo_read_all($large_object): int {}
+
+/**
+ * @param resource $large_object
+ * @alias pg_lo_read_all
+ */
+function pg_loreadall($large_object): int {}
+
+/**
+ * @param resource|string $connection
+ * @param string|int $filename
+ * @param string|int $large_object_id
+ * @return resource|false
+ */
+function pg_lo_import($connection, $filename = UNKNOWN, $large_object_id = UNKNOWN): string|int|false {}
+
+/**
+ * @param resource|string $connection
+ * @param string|int $filename
+ * @param string|int $large_object_id
+ * @return resource|false
+ * @alias pg_lo_import
+ */
+function pg_loimport($connection, $filename = UNKNOWN, $large_object_id = UNKNOWN): string|int|false {}
+
+/**
+ * @param resource|string|int $connection
+ * @param string|int $large_object_id
+ * @param string|int $filename
+ * @return resource|false
+ */
+function pg_lo_export($connection,$large_object_id = UNKNOWN, $filename = UNKNOWN): bool {}
+
+/**
+ * @param resource|string|int $connection
+ * @param string|int $large_object_id
+ * @param string|int $filename
+ * @return resource|false
+ * @alias pg_lo_export
+ */
+function pg_loexport($connection,$large_object_id = UNKNOWN, $filename = UNKNOWN): bool {}
+
+/** @param resource $large_object */
+function pg_lo_seek($large_object, int $offset, int $whence = SEEK_CUR): bool {}
+
+/** @param resource $large_object */
+function pg_lo_tell($large_object): int {}
+
+/** @param resource $large_object */
+function pg_lo_truncate($large_object, int $size): bool {}
+
+/** @param resource|int $connection */
+function pg_set_error_verbosity($connection, int $verbosity = UNKNOWN): int|false {}
+
+/** @param resource|string $connection */
+function pg_set_client_encoding($connection, string $encoding = UNKNOWN): int {}
+
+/**
+ * @param resource|string $connection
+ * @alias pg_set_client_encoding
+ */
+function pg_setclientencoding($connection, string $encoding = UNKNOWN): int {}
+
+/** @param resource $connection */
+function pg_client_encoding($connection = UNKNOWN): string {}
+
+/**
+ * @param resource $connection
+ * @alias pg_client_encoding
+ */
+function pg_clientencoding($connection = UNKNOWN): string {}
+
+/** @param resource $connection */
+function pg_end_copy($connection = UNKNOWN): bool {}
+
+/** @param resource|string $connection */
+function pg_put_line($connection, string $query = UNKNOWN): bool {}
+
+/** @param resource $connection */
+function pg_copy_to($connection, string $table_name, string $delimiter = "\t", string $null_as = "\\\\N"): array|false {}
+
+/** @param resource $connection */
+function pg_copy_from($connection, string $table_name, array $rows, string $delimiter = "\t", string $null_as = "\\\\N"): bool {}
+
+/** @param resource|string $connection */
+function pg_escape_string($connection, string $data = UNKNOWN): string {}
+
+/** @param resource|string $connection */
+function pg_escape_bytea($connection, string $data = UNKNOWN): string {}
+
+function pg_unescape_bytea(string $data = UNKNOWN): string|false {}
+
+/** @param resource|string $connection */
+function pg_escape_literal($connection, string $data = UNKNOWN): string|false {}
+
+/** @param resource|string $connection */
+function pg_escape_identifier($connection, string $data = UNKNOWN): string|false {}
+
+/** @param resource $result */
+function pg_result_error($result): string|false {}
+
+/** @param resource $result */
+function pg_result_error_field($result, int $fieldcode): string|false|null {}
+
+/** @param resource $connection */
+function pg_connection_status($connection): int {}
+
+/** @param resource $connection */
+function pg_transaction_status($connection): int {}
+
+/** @param resource $connection */
+function pg_connection_reset($connection): bool {}
+
+/** @param resource $connection */
+function pg_cancel_query($connection): bool {}
+
+/** @param resource $connection */
+function pg_connection_busy($connection): bool {}
+
+/** @param resource $connection */
+function pg_send_query($connection, string $query): int|bool {}
+
+/** @param resource $connection */
+function pg_send_query_params($connection, string $query, array $params): int|bool {}
+
+/** @param resource $connection */
+function pg_send_prepare($connection, string $stmtname, string $query): int|bool {}
+
+/** @param resource $connection */
+function pg_send_execute($connection, string $query, array $params): int|bool {}
+
+/**
+ * @param resource $connection
+ * @return resource|false
+ */
+function pg_get_result($connection) {}
+
+/** @param resource $result */
+function pg_result_status($result, int $result_type = PGSQL_RESULT_LONG): string|int|false {}
+
+/** @param resource $result */
+function pg_get_notify($result, int $result_type = PGSQL_ASSOC): array|false {}
+
+/** @param resource $connection */
+function pg_get_pid($connection): int {}
+
+/**
+ * @param resource $connection
+ * @return resource|false
+ */
+function pg_socket($connection) {}
+
+/** @param resource $connection */
+function pg_consume_input($connection): bool {}
+
+/** @param resource $connection */
+function pg_flush($connection): int|bool {}
+
+/** @param resource $connection */
+function pg_meta_data($connection, string $table_name, bool $extended = false): array|false {}
+
+/** @param resource $connection */
+function pg_convert($connection, string $table_name, array $values, int $options = 0): array|false {}
+
+/**
+ * @param resource $connection
+ * @return resource|string|bool
+ */
+function pg_insert($connection, string $table_name, array $values, int $options = 0) {}
+
+/** @param resource $connection */
+function pg_update($connection, string $table_name, array $values, array $ids, int $options = 0): string|bool {}
+
+/** @param resource $connection */
+function pg_delete($connection, string $table_name, array $ids, int $options = 0): string|bool {}
+
+/** @param resource $connection */
+function pg_select($connection, string $table_name, array $ids, int $options = 0): array|string|false {}
diff --git a/ext/pgsql/pgsql_arginfo.h b/ext/pgsql/pgsql_arginfo.h
new file mode 100644 (file)
index 0000000..5c91b16
--- /dev/null
@@ -0,0 +1,650 @@
+/* This is a generated file, edit the .stub.php file instead.
+ * Stub hash: 19b18db70bba298e3111913b1b94f95163ac86db */
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_connect, 0, 0, 1)
+       ZEND_ARG_TYPE_INFO(0, connection_string, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, connection_type, IS_LONG, 0, "0")
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_pconnect arginfo_pg_connect
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_connect_poll, 0, 1, IS_LONG, 0)
+       ZEND_ARG_INFO(0, connection)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_close, 0, 0, _IS_BOOL, 0)
+       ZEND_ARG_INFO(0, connection)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_dbname, 0, 0, IS_STRING, 0)
+       ZEND_ARG_INFO(0, connection)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_last_error arginfo_pg_dbname
+
+#define arginfo_pg_errormessage arginfo_pg_dbname
+
+#define arginfo_pg_options arginfo_pg_dbname
+
+#define arginfo_pg_port arginfo_pg_dbname
+
+#define arginfo_pg_tty arginfo_pg_dbname
+
+#define arginfo_pg_host arginfo_pg_dbname
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_version, 0, 0, IS_ARRAY, 0)
+       ZEND_ARG_INFO(0, connection)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_parameter_status, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, param_name, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_ping arginfo_pg_close
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_query, 0, 0, 1)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_exec arginfo_pg_query
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_query_params, 0, 0, 2)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_INFO(0, query)
+       ZEND_ARG_TYPE_INFO(0, params, IS_ARRAY, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_prepare, 0, 0, 2)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, stmt_name, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_execute, 0, 0, 2)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_INFO(0, stmt_name)
+       ZEND_ARG_TYPE_INFO(0, params, IS_ARRAY, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_num_rows, 0, 1, IS_LONG, 0)
+       ZEND_ARG_INFO(0, result)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_numrows arginfo_pg_num_rows
+
+#define arginfo_pg_num_fields arginfo_pg_num_rows
+
+#define arginfo_pg_numfields arginfo_pg_num_rows
+
+#define arginfo_pg_affected_rows arginfo_pg_num_rows
+
+#define arginfo_pg_cmdtuples arginfo_pg_num_rows
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_last_notice, 0, 1, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_BOOL)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, option, IS_LONG, 0, "PGSQL_NOTICE_LAST")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_field_table, 0, 2, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_TYPE_INFO(0, field_number, IS_LONG, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, oid_only, _IS_BOOL, 0, "false")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_field_name, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_TYPE_INFO(0, field_number, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_fieldname arginfo_pg_field_name
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_field_size, 0, 2, MAY_BE_LONG|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_TYPE_INFO(0, field_number, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_fieldsize arginfo_pg_field_size
+
+#define arginfo_pg_field_type arginfo_pg_field_name
+
+#define arginfo_pg_fieldtype arginfo_pg_field_name
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_field_type_oid, 0, 2, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_TYPE_INFO(0, field_number, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_field_num, 0, 2, IS_LONG, 0)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_TYPE_INFO(0, field_name, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_fieldnum arginfo_pg_field_num
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_fetch_result, 0, 2, MAY_BE_STRING|MAY_BE_FALSE|MAY_BE_NULL)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_INFO(0, row_number)
+       ZEND_ARG_INFO(0, field)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_result arginfo_pg_fetch_result
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_fetch_row, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, row_number, "null")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, result_type, IS_LONG, 0, "PGSQL_NUM")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_fetch_assoc, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, row_number, "null")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_fetch_array, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, row_number, "null")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, result_type, IS_LONG, 0, "PGSQL_BOTH")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_fetch_object, 0, 1, MAY_BE_OBJECT|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, row_number, "null")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, class_name, IS_STRING, 0, "\"stdClass\"")
+       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, ctor_params, "null")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_fetch_all, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, result_type, IS_LONG, 0, "PGSQL_ASSOC")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_fetch_all_columns, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, column_number, IS_LONG, 0, "0")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_result_seek, 0, 2, _IS_BOOL, 0)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_TYPE_INFO(0, row_number, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_field_prtlen, 0, 2, MAY_BE_LONG|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_INFO(0, row_number)
+       ZEND_ARG_INFO(0, field)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_fieldprtlen arginfo_pg_field_prtlen
+
+#define arginfo_pg_field_is_null arginfo_pg_field_prtlen
+
+#define arginfo_pg_fieldisnull arginfo_pg_field_prtlen
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_free_result, 0, 1, _IS_BOOL, 0)
+       ZEND_ARG_INFO(0, result)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_freeresult arginfo_pg_free_result
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_last_oid, 0, 1, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, result)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_getlastoid arginfo_pg_last_oid
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_trace, 0, 1, _IS_BOOL, 0)
+       ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_STRING, 0, "\"w\"")
+       ZEND_ARG_INFO(0, connection)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_untrace arginfo_pg_close
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_lo_create, 0, 0, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_INFO(0, large_object_id)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_locreate arginfo_pg_lo_create
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_lo_unlink, 0, 1, _IS_BOOL, 0)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_INFO(0, large_object_id)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_lounlink arginfo_pg_lo_unlink
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_lo_open, 0, 0, 1)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_INFO(0, large_object_id)
+       ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_loopen arginfo_pg_lo_open
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_lo_close, 0, 1, _IS_BOOL, 0)
+       ZEND_ARG_INFO(0, large_object)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_loclose arginfo_pg_lo_close
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_lo_read, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, large_object)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, len, IS_LONG, 0, "8192")
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_loread arginfo_pg_lo_read
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_lo_write, 0, 2, MAY_BE_LONG|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, large_object)
+       ZEND_ARG_TYPE_INFO(0, buf, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO(0, len, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_lowrite arginfo_pg_lo_write
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_lo_read_all, 0, 1, IS_LONG, 0)
+       ZEND_ARG_INFO(0, large_object)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_loreadall arginfo_pg_lo_read_all
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_lo_import, 0, 1, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_INFO(0, filename)
+       ZEND_ARG_INFO(0, large_object_id)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_loimport arginfo_pg_lo_import
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_lo_export, 0, 1, _IS_BOOL, 0)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_INFO(0, large_object_id)
+       ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_loexport arginfo_pg_lo_export
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_lo_seek, 0, 2, _IS_BOOL, 0)
+       ZEND_ARG_INFO(0, large_object)
+       ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, whence, IS_LONG, 0, "SEEK_CUR")
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_lo_tell arginfo_pg_lo_read_all
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_lo_truncate, 0, 2, _IS_BOOL, 0)
+       ZEND_ARG_INFO(0, large_object)
+       ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_set_error_verbosity, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, verbosity, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_set_client_encoding, 0, 1, IS_LONG, 0)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_setclientencoding arginfo_pg_set_client_encoding
+
+#define arginfo_pg_client_encoding arginfo_pg_dbname
+
+#define arginfo_pg_clientencoding arginfo_pg_dbname
+
+#define arginfo_pg_end_copy arginfo_pg_close
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_put_line, 0, 1, _IS_BOOL, 0)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_copy_to, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, table_name, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, delimiter, IS_STRING, 0, "\"\\t\"")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, null_as, IS_STRING, 0, "\"\\\\\\\\N\"")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_copy_from, 0, 3, _IS_BOOL, 0)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, table_name, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO(0, rows, IS_ARRAY, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, delimiter, IS_STRING, 0, "\"\\t\"")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, null_as, IS_STRING, 0, "\"\\\\\\\\N\"")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_escape_string, 0, 1, IS_STRING, 0)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_escape_bytea arginfo_pg_escape_string
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_unescape_bytea, 0, 0, MAY_BE_STRING|MAY_BE_FALSE)
+       ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_escape_literal, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_escape_identifier arginfo_pg_escape_literal
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_result_error, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, result)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_result_error_field, 0, 2, MAY_BE_STRING|MAY_BE_FALSE|MAY_BE_NULL)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_TYPE_INFO(0, fieldcode, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_connection_status arginfo_pg_connect_poll
+
+#define arginfo_pg_transaction_status arginfo_pg_connect_poll
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pg_connection_reset, 0, 1, _IS_BOOL, 0)
+       ZEND_ARG_INFO(0, connection)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_cancel_query arginfo_pg_connection_reset
+
+#define arginfo_pg_connection_busy arginfo_pg_connection_reset
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_send_query, 0, 2, MAY_BE_LONG|MAY_BE_BOOL)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_send_query_params, 0, 3, MAY_BE_LONG|MAY_BE_BOOL)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO(0, params, IS_ARRAY, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_send_prepare, 0, 3, MAY_BE_LONG|MAY_BE_BOOL)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, stmtname, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO(0, query, IS_STRING, 0)
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_send_execute arginfo_pg_send_query_params
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_get_result, 0, 0, 1)
+       ZEND_ARG_INFO(0, connection)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_result_status, 0, 1, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, result)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, result_type, IS_LONG, 0, "PGSQL_RESULT_LONG")
+ZEND_END_ARG_INFO()
+
+#define arginfo_pg_get_notify arginfo_pg_fetch_all
+
+#define arginfo_pg_get_pid arginfo_pg_connect_poll
+
+#define arginfo_pg_socket arginfo_pg_get_result
+
+#define arginfo_pg_consume_input arginfo_pg_connection_reset
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_flush, 0, 1, MAY_BE_LONG|MAY_BE_BOOL)
+       ZEND_ARG_INFO(0, connection)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_meta_data, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, table_name, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, extended, _IS_BOOL, 0, "false")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_convert, 0, 3, MAY_BE_ARRAY|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, table_name, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO(0, values, IS_ARRAY, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_insert, 0, 0, 3)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, table_name, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO(0, values, IS_ARRAY, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_update, 0, 4, MAY_BE_STRING|MAY_BE_BOOL)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, table_name, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO(0, values, IS_ARRAY, 0)
+       ZEND_ARG_TYPE_INFO(0, ids, IS_ARRAY, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_delete, 0, 3, MAY_BE_STRING|MAY_BE_BOOL)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, table_name, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO(0, ids, IS_ARRAY, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0")
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pg_select, 0, 3, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_FALSE)
+       ZEND_ARG_INFO(0, connection)
+       ZEND_ARG_TYPE_INFO(0, table_name, IS_STRING, 0)
+       ZEND_ARG_TYPE_INFO(0, ids, IS_ARRAY, 0)
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0")
+ZEND_END_ARG_INFO()
+
+
+ZEND_FUNCTION(pg_connect);
+ZEND_FUNCTION(pg_pconnect);
+ZEND_FUNCTION(pg_connect_poll);
+ZEND_FUNCTION(pg_close);
+ZEND_FUNCTION(pg_dbname);
+ZEND_FUNCTION(pg_last_error);
+ZEND_FUNCTION(pg_options);
+ZEND_FUNCTION(pg_port);
+ZEND_FUNCTION(pg_tty);
+ZEND_FUNCTION(pg_host);
+ZEND_FUNCTION(pg_version);
+ZEND_FUNCTION(pg_parameter_status);
+ZEND_FUNCTION(pg_ping);
+ZEND_FUNCTION(pg_query);
+ZEND_FUNCTION(pg_query_params);
+ZEND_FUNCTION(pg_prepare);
+ZEND_FUNCTION(pg_execute);
+ZEND_FUNCTION(pg_num_rows);
+ZEND_FUNCTION(pg_num_fields);
+ZEND_FUNCTION(pg_affected_rows);
+ZEND_FUNCTION(pg_last_notice);
+ZEND_FUNCTION(pg_field_table);
+ZEND_FUNCTION(pg_field_name);
+ZEND_FUNCTION(pg_field_size);
+ZEND_FUNCTION(pg_field_type);
+ZEND_FUNCTION(pg_field_type_oid);
+ZEND_FUNCTION(pg_field_num);
+ZEND_FUNCTION(pg_fetch_result);
+ZEND_FUNCTION(pg_fetch_row);
+ZEND_FUNCTION(pg_fetch_assoc);
+ZEND_FUNCTION(pg_fetch_array);
+ZEND_FUNCTION(pg_fetch_object);
+ZEND_FUNCTION(pg_fetch_all);
+ZEND_FUNCTION(pg_fetch_all_columns);
+ZEND_FUNCTION(pg_result_seek);
+ZEND_FUNCTION(pg_field_prtlen);
+ZEND_FUNCTION(pg_field_is_null);
+ZEND_FUNCTION(pg_free_result);
+ZEND_FUNCTION(pg_last_oid);
+ZEND_FUNCTION(pg_trace);
+ZEND_FUNCTION(pg_untrace);
+ZEND_FUNCTION(pg_lo_create);
+ZEND_FUNCTION(pg_lo_unlink);
+ZEND_FUNCTION(pg_lo_open);
+ZEND_FUNCTION(pg_lo_close);
+ZEND_FUNCTION(pg_lo_read);
+ZEND_FUNCTION(pg_lo_write);
+ZEND_FUNCTION(pg_lo_read_all);
+ZEND_FUNCTION(pg_lo_import);
+ZEND_FUNCTION(pg_lo_export);
+ZEND_FUNCTION(pg_lo_seek);
+ZEND_FUNCTION(pg_lo_tell);
+ZEND_FUNCTION(pg_lo_truncate);
+ZEND_FUNCTION(pg_set_error_verbosity);
+ZEND_FUNCTION(pg_set_client_encoding);
+ZEND_FUNCTION(pg_client_encoding);
+ZEND_FUNCTION(pg_end_copy);
+ZEND_FUNCTION(pg_put_line);
+ZEND_FUNCTION(pg_copy_to);
+ZEND_FUNCTION(pg_copy_from);
+ZEND_FUNCTION(pg_escape_string);
+ZEND_FUNCTION(pg_escape_bytea);
+ZEND_FUNCTION(pg_unescape_bytea);
+ZEND_FUNCTION(pg_escape_literal);
+ZEND_FUNCTION(pg_escape_identifier);
+ZEND_FUNCTION(pg_result_error);
+ZEND_FUNCTION(pg_result_error_field);
+ZEND_FUNCTION(pg_connection_status);
+ZEND_FUNCTION(pg_transaction_status);
+ZEND_FUNCTION(pg_connection_reset);
+ZEND_FUNCTION(pg_cancel_query);
+ZEND_FUNCTION(pg_connection_busy);
+ZEND_FUNCTION(pg_send_query);
+ZEND_FUNCTION(pg_send_query_params);
+ZEND_FUNCTION(pg_send_prepare);
+ZEND_FUNCTION(pg_send_execute);
+ZEND_FUNCTION(pg_get_result);
+ZEND_FUNCTION(pg_result_status);
+ZEND_FUNCTION(pg_get_notify);
+ZEND_FUNCTION(pg_get_pid);
+ZEND_FUNCTION(pg_socket);
+ZEND_FUNCTION(pg_consume_input);
+ZEND_FUNCTION(pg_flush);
+ZEND_FUNCTION(pg_meta_data);
+ZEND_FUNCTION(pg_convert);
+ZEND_FUNCTION(pg_insert);
+ZEND_FUNCTION(pg_update);
+ZEND_FUNCTION(pg_delete);
+ZEND_FUNCTION(pg_select);
+
+
+static const zend_function_entry ext_functions[] = {
+       ZEND_FE(pg_connect, arginfo_pg_connect)
+       ZEND_FE(pg_pconnect, arginfo_pg_pconnect)
+       ZEND_FE(pg_connect_poll, arginfo_pg_connect_poll)
+       ZEND_FE(pg_close, arginfo_pg_close)
+       ZEND_FE(pg_dbname, arginfo_pg_dbname)
+       ZEND_FE(pg_last_error, arginfo_pg_last_error)
+       ZEND_FALIAS(pg_errormessage, pg_last_error, arginfo_pg_errormessage)
+       ZEND_FE(pg_options, arginfo_pg_options)
+       ZEND_FE(pg_port, arginfo_pg_port)
+       ZEND_FE(pg_tty, arginfo_pg_tty)
+       ZEND_FE(pg_host, arginfo_pg_host)
+       ZEND_FE(pg_version, arginfo_pg_version)
+       ZEND_FE(pg_parameter_status, arginfo_pg_parameter_status)
+       ZEND_FE(pg_ping, arginfo_pg_ping)
+       ZEND_FE(pg_query, arginfo_pg_query)
+       ZEND_FALIAS(pg_exec, pg_query, arginfo_pg_exec)
+       ZEND_FE(pg_query_params, arginfo_pg_query_params)
+       ZEND_FE(pg_prepare, arginfo_pg_prepare)
+       ZEND_FE(pg_execute, arginfo_pg_execute)
+       ZEND_FE(pg_num_rows, arginfo_pg_num_rows)
+       ZEND_FALIAS(pg_numrows, pg_num_rows, arginfo_pg_numrows)
+       ZEND_FE(pg_num_fields, arginfo_pg_num_fields)
+       ZEND_FALIAS(pg_numfields, pg_num_fields, arginfo_pg_numfields)
+       ZEND_FE(pg_affected_rows, arginfo_pg_affected_rows)
+       ZEND_FALIAS(pg_cmdtuples, pg_affected_rows, arginfo_pg_cmdtuples)
+       ZEND_FE(pg_last_notice, arginfo_pg_last_notice)
+       ZEND_FE(pg_field_table, arginfo_pg_field_table)
+       ZEND_FE(pg_field_name, arginfo_pg_field_name)
+       ZEND_FALIAS(pg_fieldname, pg_field_name, arginfo_pg_fieldname)
+       ZEND_FE(pg_field_size, arginfo_pg_field_size)
+       ZEND_FALIAS(pg_fieldsize, pg_field_size, arginfo_pg_fieldsize)
+       ZEND_FE(pg_field_type, arginfo_pg_field_type)
+       ZEND_FALIAS(pg_fieldtype, pg_field_type, arginfo_pg_fieldtype)
+       ZEND_FE(pg_field_type_oid, arginfo_pg_field_type_oid)
+       ZEND_FE(pg_field_num, arginfo_pg_field_num)
+       ZEND_FALIAS(pg_fieldnum, pg_field_num, arginfo_pg_fieldnum)
+       ZEND_FE(pg_fetch_result, arginfo_pg_fetch_result)
+       ZEND_FALIAS(pg_result, pg_fetch_result, arginfo_pg_result)
+       ZEND_FE(pg_fetch_row, arginfo_pg_fetch_row)
+       ZEND_FE(pg_fetch_assoc, arginfo_pg_fetch_assoc)
+       ZEND_FE(pg_fetch_array, arginfo_pg_fetch_array)
+       ZEND_FE(pg_fetch_object, arginfo_pg_fetch_object)
+       ZEND_FE(pg_fetch_all, arginfo_pg_fetch_all)
+       ZEND_FE(pg_fetch_all_columns, arginfo_pg_fetch_all_columns)
+       ZEND_FE(pg_result_seek, arginfo_pg_result_seek)
+       ZEND_FE(pg_field_prtlen, arginfo_pg_field_prtlen)
+       ZEND_FALIAS(pg_fieldprtlen, pg_field_prtlen, arginfo_pg_fieldprtlen)
+       ZEND_FE(pg_field_is_null, arginfo_pg_field_is_null)
+       ZEND_FALIAS(pg_fieldisnull, pg_field_is_null, arginfo_pg_fieldisnull)
+       ZEND_FE(pg_free_result, arginfo_pg_free_result)
+       ZEND_FALIAS(pg_freeresult, pg_free_result, arginfo_pg_freeresult)
+       ZEND_FE(pg_last_oid, arginfo_pg_last_oid)
+       ZEND_FALIAS(pg_getlastoid, pg_last_oid, arginfo_pg_getlastoid)
+       ZEND_FE(pg_trace, arginfo_pg_trace)
+       ZEND_FE(pg_untrace, arginfo_pg_untrace)
+       ZEND_FE(pg_lo_create, arginfo_pg_lo_create)
+       ZEND_FALIAS(pg_locreate, pg_lo_create, arginfo_pg_locreate)
+       ZEND_FE(pg_lo_unlink, arginfo_pg_lo_unlink)
+       ZEND_FALIAS(pg_lounlink, pg_lo_unlink, arginfo_pg_lounlink)
+       ZEND_FE(pg_lo_open, arginfo_pg_lo_open)
+       ZEND_FALIAS(pg_loopen, pg_lo_open, arginfo_pg_loopen)
+       ZEND_FE(pg_lo_close, arginfo_pg_lo_close)
+       ZEND_FALIAS(pg_loclose, pg_lo_close, arginfo_pg_loclose)
+       ZEND_FE(pg_lo_read, arginfo_pg_lo_read)
+       ZEND_FALIAS(pg_loread, pg_lo_read, arginfo_pg_loread)
+       ZEND_FE(pg_lo_write, arginfo_pg_lo_write)
+       ZEND_FALIAS(pg_lowrite, pg_lo_write, arginfo_pg_lowrite)
+       ZEND_FE(pg_lo_read_all, arginfo_pg_lo_read_all)
+       ZEND_FALIAS(pg_loreadall, pg_lo_read_all, arginfo_pg_loreadall)
+       ZEND_FE(pg_lo_import, arginfo_pg_lo_import)
+       ZEND_FALIAS(pg_loimport, pg_lo_import, arginfo_pg_loimport)
+       ZEND_FE(pg_lo_export, arginfo_pg_lo_export)
+       ZEND_FALIAS(pg_loexport, pg_lo_export, arginfo_pg_loexport)
+       ZEND_FE(pg_lo_seek, arginfo_pg_lo_seek)
+       ZEND_FE(pg_lo_tell, arginfo_pg_lo_tell)
+       ZEND_FE(pg_lo_truncate, arginfo_pg_lo_truncate)
+       ZEND_FE(pg_set_error_verbosity, arginfo_pg_set_error_verbosity)
+       ZEND_FE(pg_set_client_encoding, arginfo_pg_set_client_encoding)
+       ZEND_FALIAS(pg_setclientencoding, pg_set_client_encoding, arginfo_pg_setclientencoding)
+       ZEND_FE(pg_client_encoding, arginfo_pg_client_encoding)
+       ZEND_FALIAS(pg_clientencoding, pg_client_encoding, arginfo_pg_clientencoding)
+       ZEND_FE(pg_end_copy, arginfo_pg_end_copy)
+       ZEND_FE(pg_put_line, arginfo_pg_put_line)
+       ZEND_FE(pg_copy_to, arginfo_pg_copy_to)
+       ZEND_FE(pg_copy_from, arginfo_pg_copy_from)
+       ZEND_FE(pg_escape_string, arginfo_pg_escape_string)
+       ZEND_FE(pg_escape_bytea, arginfo_pg_escape_bytea)
+       ZEND_FE(pg_unescape_bytea, arginfo_pg_unescape_bytea)
+       ZEND_FE(pg_escape_literal, arginfo_pg_escape_literal)
+       ZEND_FE(pg_escape_identifier, arginfo_pg_escape_identifier)
+       ZEND_FE(pg_result_error, arginfo_pg_result_error)
+       ZEND_FE(pg_result_error_field, arginfo_pg_result_error_field)
+       ZEND_FE(pg_connection_status, arginfo_pg_connection_status)
+       ZEND_FE(pg_transaction_status, arginfo_pg_transaction_status)
+       ZEND_FE(pg_connection_reset, arginfo_pg_connection_reset)
+       ZEND_FE(pg_cancel_query, arginfo_pg_cancel_query)
+       ZEND_FE(pg_connection_busy, arginfo_pg_connection_busy)
+       ZEND_FE(pg_send_query, arginfo_pg_send_query)
+       ZEND_FE(pg_send_query_params, arginfo_pg_send_query_params)
+       ZEND_FE(pg_send_prepare, arginfo_pg_send_prepare)
+       ZEND_FE(pg_send_execute, arginfo_pg_send_execute)
+       ZEND_FE(pg_get_result, arginfo_pg_get_result)
+       ZEND_FE(pg_result_status, arginfo_pg_result_status)
+       ZEND_FE(pg_get_notify, arginfo_pg_get_notify)
+       ZEND_FE(pg_get_pid, arginfo_pg_get_pid)
+       ZEND_FE(pg_socket, arginfo_pg_socket)
+       ZEND_FE(pg_consume_input, arginfo_pg_consume_input)
+       ZEND_FE(pg_flush, arginfo_pg_flush)
+       ZEND_FE(pg_meta_data, arginfo_pg_meta_data)
+       ZEND_FE(pg_convert, arginfo_pg_convert)
+       ZEND_FE(pg_insert, arginfo_pg_insert)
+       ZEND_FE(pg_update, arginfo_pg_update)
+       ZEND_FE(pg_delete, arginfo_pg_delete)
+       ZEND_FE(pg_select, arginfo_pg_select)
+       ZEND_FE_END
+};