xref: /PHP-8.4/ext/pgsql/pgsql.stub.php (revision 29f98e74)
1<?php
2
3/** @generate-class-entries */
4
5namespace {
6    /* libpq version */
7
8    /**
9     * @var string
10     * @cvalue pgsql_libpq_version
11     */
12    const PGSQL_LIBPQ_VERSION = UNKNOWN;
13    /**
14     * @var string
15     * @cvalue pgsql_libpq_version
16     * @deprecated
17     */
18    const PGSQL_LIBPQ_VERSION_STR = UNKNOWN;
19
20    /* For connection option */
21
22    /**
23     * @var int
24     * @cvalue PGSQL_CONNECT_FORCE_NEW
25     */
26    const PGSQL_CONNECT_FORCE_NEW = UNKNOWN;
27    /**
28     * @var int
29     * @cvalue PGSQL_CONNECT_ASYNC
30     */
31    const PGSQL_CONNECT_ASYNC = UNKNOWN;
32
33    /* For pg_fetch_array() */
34
35    /**
36     * @var int
37     * @cvalue PGSQL_ASSOC
38     */
39    const PGSQL_ASSOC = UNKNOWN;
40    /**
41     * @var int
42     * @cvalue PGSQL_NUM
43     */
44    const PGSQL_NUM = UNKNOWN;
45    /**
46     * @var int
47     * @cvalue PGSQL_BOTH
48     */
49    const PGSQL_BOTH = UNKNOWN;
50
51    /* For pg_last_notice() */
52
53    /**
54     * @var int
55     * @cvalue PGSQL_NOTICE_LAST
56     */
57    const PGSQL_NOTICE_LAST = UNKNOWN;
58    /**
59     * @var int
60     * @cvalue PGSQL_NOTICE_ALL
61     */
62    const PGSQL_NOTICE_ALL = UNKNOWN;
63    /**
64     * @var int
65     * @cvalue PGSQL_NOTICE_CLEAR
66     */
67    const PGSQL_NOTICE_CLEAR = UNKNOWN;
68
69    /* For pg_connection_status() */
70
71    /**
72     * @var int
73     * @cvalue CONNECTION_BAD
74     */
75    const PGSQL_CONNECTION_BAD = UNKNOWN;
76    /**
77     * @var int
78     * @cvalue CONNECTION_OK
79     */
80    const PGSQL_CONNECTION_OK = UNKNOWN;
81    /**
82     * @var int
83     * @cvalue CONNECTION_STARTED
84     */
85    const PGSQL_CONNECTION_STARTED = UNKNOWN;
86    /**
87     * @var int
88     * @cvalue CONNECTION_MADE
89     */
90    const PGSQL_CONNECTION_MADE = UNKNOWN;
91    /**
92     * @var int
93     * @cvalue CONNECTION_AWAITING_RESPONSE
94     */
95    const PGSQL_CONNECTION_AWAITING_RESPONSE = UNKNOWN;
96    /**
97     * @var int
98     * @cvalue CONNECTION_AUTH_OK
99     */
100    const PGSQL_CONNECTION_AUTH_OK = UNKNOWN;
101#ifdef CONNECTION_SSL_STARTUP
102    /**
103     * @var int
104     * @cvalue CONNECTION_SSL_STARTUP
105     */
106    const PGSQL_CONNECTION_SSL_STARTUP = UNKNOWN;
107#endif
108    /**
109     * @var int
110     * @cvalue CONNECTION_SETENV
111     */
112    const PGSQL_CONNECTION_SETENV = UNKNOWN;
113
114    /* For pg_connect_poll() */
115    /**
116     * @var int
117     * @cvalue PGRES_POLLING_FAILED
118     */
119    const PGSQL_POLLING_FAILED = UNKNOWN;
120    /**
121     * @var int
122     * @cvalue PGRES_POLLING_READING
123     */
124    const PGSQL_POLLING_READING = UNKNOWN;
125    /**
126     * @var int
127     * @cvalue PGRES_POLLING_WRITING
128     */
129    const PGSQL_POLLING_WRITING = UNKNOWN;
130    /**
131     * @var int
132     * @cvalue PGRES_POLLING_OK
133     */
134    const PGSQL_POLLING_OK = UNKNOWN;
135    /**
136     * @var int
137     * @cvalue PGRES_POLLING_ACTIVE
138     */
139    const PGSQL_POLLING_ACTIVE = UNKNOWN;
140
141    /* For pg_transaction_status() */
142
143    /**
144     * @var int
145     * @cvalue PQTRANS_IDLE
146     */
147    const PGSQL_TRANSACTION_IDLE = UNKNOWN;
148    /**
149     * @var int
150     * @cvalue PQTRANS_ACTIVE
151     */
152    const PGSQL_TRANSACTION_ACTIVE = UNKNOWN;
153    /**
154     * @var int
155     * @cvalue PQTRANS_INTRANS
156     */
157    const PGSQL_TRANSACTION_INTRANS = UNKNOWN;
158    /**
159     * @var int
160     * @cvalue PQTRANS_INERROR
161     */
162    const PGSQL_TRANSACTION_INERROR = UNKNOWN;
163    /**
164     * @var int
165     * @cvalue PQTRANS_UNKNOWN
166     */
167    const PGSQL_TRANSACTION_UNKNOWN = UNKNOWN;
168
169    /* For pg_set_error_verbosity() */
170
171    /**
172     * @var int
173     * @cvalue PQERRORS_TERSE
174     */
175    const PGSQL_ERRORS_TERSE = UNKNOWN;
176    /**
177     * @var int
178     * @cvalue PQERRORS_DEFAULT
179     */
180    const PGSQL_ERRORS_DEFAULT = UNKNOWN;
181    /**
182     * @var int
183     * @cvalue PQERRORS_VERBOSE
184     */
185    const PGSQL_ERRORS_VERBOSE = UNKNOWN;
186    #ifdef HAVE_PQERRORS_SQLSTATE
187    /**
188     * @var int
189     * @cvalue PQERRORS_SQLSTATE
190     */
191    const PGSQL_ERRORS_SQLSTATE = UNKNOWN;
192    #else
193    /**
194     * @var int
195     * @cvalue PQERRORS_TERSE
196     */
197    const PGSQL_ERRORS_SQLSTATE = UNKNOWN;
198    #endif
199
200    /* For lo_seek() */
201
202    /**
203     * @var int
204     * @cvalue SEEK_SET
205     */
206    const PGSQL_SEEK_SET = UNKNOWN;
207    /**
208     * @var int
209     * @cvalue SEEK_CUR
210     */
211    const PGSQL_SEEK_CUR = UNKNOWN;
212    /**
213     * @var int
214     * @cvalue SEEK_END
215     */
216    const PGSQL_SEEK_END = UNKNOWN;
217
218    /* For pg_result_status() return value type */
219
220    /**
221     * @var int
222     * @cvalue PGSQL_STATUS_LONG
223     */
224    const PGSQL_STATUS_LONG = UNKNOWN;
225    /**
226     * @var int
227     * @cvalue PGSQL_STATUS_STRING
228     */
229    const PGSQL_STATUS_STRING = UNKNOWN;
230
231    /* For pg_result_status() return value */
232
233    /**
234     * @var int
235     * @cvalue PGRES_EMPTY_QUERY
236     */
237    const PGSQL_EMPTY_QUERY = UNKNOWN;
238    /**
239     * @var int
240     * @cvalue PGRES_COMMAND_OK
241     */
242    const PGSQL_COMMAND_OK = UNKNOWN;
243    /**
244     * @var int
245     * @cvalue PGRES_TUPLES_OK
246     */
247    const PGSQL_TUPLES_OK = UNKNOWN;
248#ifdef HAVE_PG_SET_CHUNKED_ROWS_SIZE
249    /**
250     * @var int
251     * @cvalue PGRES_TUPLES_CHUNK
252     */
253    const PGSQL_TUPLES_CHUNK = UNKNOWN;
254#endif
255    /**
256     * @var int
257     * @cvalue PGRES_COPY_OUT
258     */
259    const PGSQL_COPY_OUT = UNKNOWN;
260    /**
261     * @var int
262     * @cvalue PGRES_COPY_IN
263     */
264    const PGSQL_COPY_IN = UNKNOWN;
265    /**
266     * @var int
267     * @cvalue PGRES_BAD_RESPONSE
268     */
269    const PGSQL_BAD_RESPONSE = UNKNOWN;
270    /**
271     * @var int
272     * @cvalue PGRES_NONFATAL_ERROR
273     */
274    const PGSQL_NONFATAL_ERROR = UNKNOWN;
275    /**
276     * @var int
277     * @cvalue PGRES_FATAL_ERROR
278     */
279    const PGSQL_FATAL_ERROR = UNKNOWN;
280
281    /* For pg_result_error_field() field codes */
282
283    /**
284     * @var int
285     * @cvalue PG_DIAG_SEVERITY
286     */
287    const PGSQL_DIAG_SEVERITY = UNKNOWN;
288    /**
289     * @var int
290     * @cvalue PG_DIAG_SQLSTATE
291     */
292    const PGSQL_DIAG_SQLSTATE = UNKNOWN;
293    /**
294     * @var int
295     * @cvalue PG_DIAG_MESSAGE_PRIMARY
296     */
297    const PGSQL_DIAG_MESSAGE_PRIMARY = UNKNOWN;
298    /**
299     * @var int
300     * @cvalue PG_DIAG_MESSAGE_DETAIL
301     */
302    const PGSQL_DIAG_MESSAGE_DETAIL = UNKNOWN;
303    /**
304     * @var int
305     * @cvalue PG_DIAG_MESSAGE_HINT
306     */
307    const PGSQL_DIAG_MESSAGE_HINT = UNKNOWN;
308    /**
309     * @var int
310     * @cvalue PG_DIAG_STATEMENT_POSITION
311     */
312    const PGSQL_DIAG_STATEMENT_POSITION = UNKNOWN;
313#ifdef PG_DIAG_INTERNAL_POSITION
314    /**
315     * @var int
316     * @cvalue PG_DIAG_INTERNAL_POSITION
317     */
318    const PGSQL_DIAG_INTERNAL_POSITION = UNKNOWN;
319#endif
320#ifdef PG_DIAG_INTERNAL_QUERY
321    /**
322     * @var int
323     * @cvalue PG_DIAG_INTERNAL_QUERY
324     */
325    const PGSQL_DIAG_INTERNAL_QUERY = UNKNOWN;
326#endif
327    /**
328     * @var int
329     * @cvalue PG_DIAG_CONTEXT
330     */
331    const PGSQL_DIAG_CONTEXT = UNKNOWN;
332    /**
333     * @var int
334     * @cvalue PG_DIAG_SOURCE_FILE
335     */
336    const PGSQL_DIAG_SOURCE_FILE = UNKNOWN;
337    /**
338     * @var int
339     * @cvalue PG_DIAG_SOURCE_LINE
340     */
341    const PGSQL_DIAG_SOURCE_LINE = UNKNOWN;
342    /**
343     * @var int
344     * @cvalue PG_DIAG_SOURCE_FUNCTION
345     */
346    const PGSQL_DIAG_SOURCE_FUNCTION = UNKNOWN;
347#ifdef PG_DIAG_SCHEMA_NAME
348    /**
349     * @var int
350     * @cvalue PG_DIAG_SCHEMA_NAME
351     */
352    const PGSQL_DIAG_SCHEMA_NAME = UNKNOWN;
353#endif
354#ifdef PG_DIAG_TABLE_NAME
355    /**
356     * @var int
357     * @cvalue PG_DIAG_TABLE_NAME
358     */
359    const PGSQL_DIAG_TABLE_NAME = UNKNOWN;
360#endif
361#ifdef PG_DIAG_COLUMN_NAME
362    /**
363     * @var int
364     * @cvalue PG_DIAG_COLUMN_NAME
365     */
366    const PGSQL_DIAG_COLUMN_NAME = UNKNOWN;
367#endif
368#ifdef PG_DIAG_DATATYPE_NAME
369    /**
370     * @var int
371     * @cvalue PG_DIAG_DATATYPE_NAME
372     */
373    const PGSQL_DIAG_DATATYPE_NAME = UNKNOWN;
374#endif
375#ifdef PG_DIAG_CONSTRAINT_NAME
376    /**
377     * @var int
378     * @cvalue PG_DIAG_CONSTRAINT_NAME
379     */
380    const PGSQL_DIAG_CONSTRAINT_NAME = UNKNOWN;
381#endif
382#ifdef PG_DIAG_SEVERITY_NONLOCALIZED
383    /**
384     * @var int
385     * @cvalue PG_DIAG_SEVERITY_NONLOCALIZED
386     */
387    const PGSQL_DIAG_SEVERITY_NONLOCALIZED = UNKNOWN;
388#endif
389
390    /* pg_convert options */
391
392    /**
393     * @var int
394     * @cvalue PGSQL_CONV_IGNORE_DEFAULT
395     */
396    const PGSQL_CONV_IGNORE_DEFAULT = UNKNOWN;
397    /**
398     * @var int
399     * @cvalue PGSQL_CONV_FORCE_NULL
400     */
401    const PGSQL_CONV_FORCE_NULL = UNKNOWN;
402    /**
403     * @var int
404     * @cvalue PGSQL_CONV_IGNORE_NOT_NULL
405     */
406    const PGSQL_CONV_IGNORE_NOT_NULL = UNKNOWN;
407
408    /* pg_insert/update/delete/select options */
409
410    /**
411     * @var int
412     * @cvalue PGSQL_DML_ESCAPE
413     */
414    const PGSQL_DML_ESCAPE = UNKNOWN;
415    /**
416     * @var int
417     * @cvalue PGSQL_DML_NO_CONV
418     */
419    const PGSQL_DML_NO_CONV = UNKNOWN;
420    /**
421     * @var int
422     * @cvalue PGSQL_DML_EXEC
423     */
424    const PGSQL_DML_EXEC = UNKNOWN;
425    /**
426     * @var int
427     * @cvalue PGSQL_DML_ASYNC
428     */
429    const PGSQL_DML_ASYNC = UNKNOWN;
430    /**
431     * @var int
432     * @cvalue PGSQL_DML_STRING
433     */
434    const PGSQL_DML_STRING = UNKNOWN;
435#ifdef PQTRACE_SUPPPRESS_TIMESTAMPS
436    /**
437     * @var int
438     * @cvalue PQTRACE_SUPPRESS_TIMESTAMPS
439     */
440    const PGSQL_TRACE_SUPPRESS_TIMESTAMPS = UNKNOWN;
441#endif
442#ifdef PQTRACE_REGRESS_MODE
443    /**
444     * @var int
445     * @cvalue PQTRACE_REGRESS_MODE
446     */
447    const PGSQL_TRACE_REGRESS_MODE = UNKNOWN;
448#endif
449
450    /* For pg_set_error_context_visibility() */
451
452    /**
453     * @var int
454     * @cvalue PQSHOW_CONTEXT_NEVER
455     */
456    const PGSQL_SHOW_CONTEXT_NEVER = UNKNOWN;
457    /**
458     * @var int
459     * @cvalue PQSHOW_CONTEXT_ERRORS
460     */
461    const PGSQL_SHOW_CONTEXT_ERRORS = UNKNOWN;
462    /**
463     * @var int
464     * @cvalue PQSHOW_CONTEXT_ALWAYS
465     */
466    const PGSQL_SHOW_CONTEXT_ALWAYS = UNKNOWN;
467
468    function pg_connect(string $connection_string, int $flags = 0): PgSql\Connection|false {}
469
470    function pg_pconnect(string $connection_string, int $flags = 0): PgSql\Connection|false {}
471
472    function pg_connect_poll(PgSql\Connection $connection): int {}
473
474    function pg_close(?PgSql\Connection $connection = null): true {}
475
476    /** @refcount 1 */
477    function pg_dbname(?PgSql\Connection $connection = null): string {}
478
479    function pg_last_error(?PgSql\Connection $connection = null): string {}
480
481    /**
482     * @alias pg_last_error
483     */
484    #[\Deprecated(since: '8.0', message: 'use pg_last_error() instead')]
485    function pg_errormessage(?PgSql\Connection $connection = null): string {}
486
487    /** @refcount 1 */
488    function pg_options(?PgSql\Connection $connection = null): string {}
489
490    /** @refcount 1 */
491    function pg_port(?PgSql\Connection $connection = null): string {}
492
493    /** @refcount 1 */
494    function pg_tty(?PgSql\Connection $connection = null): string {}
495
496    /** @refcount 1 */
497    function pg_host(?PgSql\Connection $connection = null): string {}
498
499    /**
500     * @return array<string, int|string|null>
501     * @refcount 1
502     */
503    function pg_version(?PgSql\Connection $connection = null): array {}
504
505    /**
506     * @return array<string, string|null>
507     * @refcount 1
508     */
509    function pg_jit(?PgSql\Connection $connection = null): array {}
510
511    /**
512     * @param PgSql\Connection|string $connection
513     * @refcount 1
514     */
515    function pg_parameter_status($connection, string $name = UNKNOWN): string|false {}
516
517    function pg_ping(?PgSql\Connection $connection = null): bool {}
518
519    /**
520     * @param PgSql\Connection|string $connection
521     * @refcount 1
522     */
523    function pg_query($connection, string $query = UNKNOWN): PgSql\Result|false {}
524
525    /**
526     * @param PgSql\Connection|string $connection
527     * @alias pg_query
528     */
529    function pg_exec($connection, string $query = UNKNOWN): PgSql\Result|false {}
530
531    /**
532     * @param PgSql\Connection|string $connection
533     * @param string|array $query
534     * @refcount 1
535     */
536    function pg_query_params($connection, $query, array $params = UNKNOWN): PgSql\Result|false {}
537
538    /**
539     * @param PgSql\Connection|string $connection
540     * @refcount 1
541     */
542    function pg_prepare($connection, string $statement_name, string $query = UNKNOWN): PgSql\Result|false {}
543
544    /**
545     * @param PgSql\Connection|string $connection
546     * @param string|array $statement_name
547     * @refcount 1
548     */
549    function pg_execute($connection, $statement_name, array $params = UNKNOWN): PgSql\Result|false {}
550
551    function pg_num_rows(PgSql\Result $result): int {}
552
553    /**
554     * @alias pg_num_rows
555     */
556    #[\Deprecated(since: '8.0', message: 'use pg_num_rows() instead')]
557    function pg_numrows(PgSql\Result $result): int {}
558
559    function pg_num_fields(PgSql\Result $result): int {}
560
561    /**
562     * @alias pg_num_fields
563     */
564    #[\Deprecated(since: '8.0', message: 'use pg_num_fields() instead')]
565    function pg_numfields(PgSql\Result $result): int {}
566
567    function pg_affected_rows(PgSql\Result $result): int {}
568
569    /**
570     * @alias pg_affected_rows
571     */
572    #[\Deprecated(since: '8.0', message: 'use pg_affected_rows() instead')]
573    function pg_cmdtuples(PgSql\Result $result): int {}
574
575    function pg_last_notice(PgSql\Connection $connection, int $mode = PGSQL_NOTICE_LAST): array|string|bool {}
576
577    function pg_field_table(PgSql\Result $result, int $field, bool $oid_only = false): string|int|false {}
578
579    /** @refcount 1 */
580    function pg_field_name(PgSql\Result $result, int $field): string {}
581
582    /**
583     * @alias pg_field_name
584     */
585    #[\Deprecated(since: '8.0', message: 'use pg_field_name() instead')]
586    function pg_fieldname(PgSql\Result $result, int $field): string {}
587
588    function pg_field_size(PgSql\Result $result, int $field): int {}
589
590    /**
591     * @alias pg_field_size
592     */
593    #[\Deprecated(since: '8.0', message: 'use pg_field_size() instead')]
594    function pg_fieldsize(PgSql\Result $result, int $field): int {}
595
596    function pg_field_type(PgSql\Result $result, int $field): string {}
597
598    /**
599     * @alias pg_field_type
600     */
601    #[\Deprecated(since: '8.0', message: 'use pg_field_type() instead')]
602    function pg_fieldtype(PgSql\Result $result, int $field): string {}
603
604    /** @refcount 1 */
605    function pg_field_type_oid(PgSql\Result $result, int $field): string|int {}
606
607    function pg_field_num(PgSql\Result $result, string $field): int {}
608
609    /**
610     * @alias pg_field_num
611     */
612    #[\Deprecated(since: '8.0', message: 'use pg_field_num() instead')]
613    function pg_fieldnum(PgSql\Result $result, string $field): int {}
614
615    /**
616     * @param string|int|null $row
617     * @refcount 1
618     */
619    function pg_fetch_result(PgSql\Result $result, $row, string|int $field = UNKNOWN): string|false|null {}
620
621    /**
622     * @param string|int $row
623     * @alias pg_fetch_result
624     */
625    #[\Deprecated(since: '8.0', message: 'use pg_fetch_result() instead')]
626    function pg_result(PgSql\Result $result, $row, string|int $field = UNKNOWN): string|false|null {}
627
628    /**
629     * @return array<int|string, string|null>|false
630     * @refcount 1
631     */
632    function pg_fetch_row(PgSql\Result $result, ?int $row = null, int $mode = PGSQL_NUM): array|false {}
633
634    /**
635     * @return array<int|string, string|null>|false
636     * @refcount 1
637     */
638    function pg_fetch_assoc(PgSql\Result $result, ?int $row = null): array|false {}
639
640    /**
641     * @return array<int|string, string|null>|false
642     * @refcount 1
643     */
644    function pg_fetch_array(PgSql\Result $result, ?int $row = null, int $mode = PGSQL_BOTH): array|false {}
645
646    /** @refcount 1 */
647    function pg_fetch_object(PgSql\Result $result, ?int $row = null, string $class = "stdClass", array $constructor_args = []): object|false {}
648
649    /**
650     * @return array<int, array>
651     * @refcount 1
652     */
653    function pg_fetch_all(PgSql\Result $result, int $mode = PGSQL_ASSOC): array {}
654
655    /**
656     * @return array<int, string|null>
657     * @refcount 1
658     */
659    function pg_fetch_all_columns(PgSql\Result $result, int $field = 0): array {}
660
661    function pg_result_seek(PgSql\Result $result, int $row): bool {}
662
663    /** @param string|int|null $row */
664    function pg_field_prtlen(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
665
666    /**
667     * @param string|int $row
668     */
669    #[\Deprecated(since: '8.0', message: 'use pg_field_prtlen() instead')]
670    function pg_fieldprtlen(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
671
672    /** @param string|int|null $row */
673    function pg_field_is_null(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
674
675    /**
676     * @param string|int $row
677     */
678    #[\Deprecated(since: '8.0', message: 'use pg_field_is_null() instead')]
679    function pg_fieldisnull(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
680
681    function pg_free_result(PgSql\Result $result): bool {}
682
683    /**
684     * @alias pg_free_result
685     */
686    #[\Deprecated(since: '8.0', message: 'use pg_free_result() instead')]
687    function pg_freeresult(PgSql\Result $result): bool {}
688
689    /** @refcount 1 */
690    function pg_last_oid(PgSql\Result $result): string|int|false {}
691
692    /**
693     * @alias pg_last_oid
694     */
695    #[\Deprecated(since: '8.0', message: 'use pg_last_oid() instead')]
696    function pg_getlastoid(PgSql\Result $result): string|int|false {}
697
698    function pg_trace(string $filename, string $mode = "w", ?PgSql\Connection $connection = null, int $trace_mode = 0): bool {}
699
700    function pg_untrace(?PgSql\Connection $connection = null): true {}
701
702    /**
703     * @param PgSql\Connection $connection
704     * @param string|int $oid
705     * @refcount 1
706     */
707    function pg_lo_create($connection = UNKNOWN, $oid = UNKNOWN): string|int|false {}
708
709    /**
710     * @param PgSql\Connection $connection
711     * @param string|int $oid
712     * @alias pg_lo_create
713     */
714    #[\Deprecated(since: '8.0', message: 'use pg_lo_create() instead')]
715    function pg_locreate($connection = UNKNOWN, $oid = UNKNOWN): string|int|false {}
716
717    /**
718     * @param PgSql\Connection $connection
719     * @param string|int $oid
720     */
721    function pg_lo_unlink($connection, $oid = UNKNOWN): bool {}
722
723    /**
724     * @param PgSql\Connection $connection
725     * @param string|int $oid
726     * @alias pg_lo_unlink
727     */
728    #[\Deprecated(since: '8.0', message: 'use pg_lo_unlink() instead')]
729    function pg_lounlink($connection, $oid = UNKNOWN): bool {}
730
731    /**
732     * @param PgSql\Connection $connection
733     * @param string|int $oid
734     * @refcount 1
735     */
736    function pg_lo_open($connection, $oid = UNKNOWN, string $mode = UNKNOWN): PgSql\Lob|false {}
737
738    /**
739     * @param PgSql\Connection $connection
740     * @param string|int $oid
741     * @alias pg_lo_open
742     */
743    #[\Deprecated(since: '8.0', message: 'use pg_lo_open() instead')]
744    function pg_loopen($connection, $oid = UNKNOWN, string $mode = UNKNOWN): PgSql\Lob|false {}
745
746    function pg_lo_close(PgSql\Lob $lob): bool {}
747
748    /**
749     * @alias pg_lo_close
750     */
751    #[\Deprecated(since: '8.0', message: 'use pg_lo_close() instead')]
752    function pg_loclose(PgSql\Lob $lob): bool {}
753
754    /** @refcount 1 */
755    function pg_lo_read(PgSql\Lob $lob, int $length = 8192): string|false {}
756
757    /**
758     * @alias pg_lo_read
759     */
760    #[\Deprecated(since: '8.0', message: 'use pg_lo_read() instead')]
761    function pg_loread(PgSql\Lob $lob, int $length = 8192): string|false {}
762
763    function pg_lo_write(PgSql\Lob $lob, string $data, ?int $length = null): int|false {}
764
765    /**
766     * @alias pg_lo_write
767     */
768    #[\Deprecated(since: '8.0', message: 'use pg_lo_write() instead')]
769    function pg_lowrite(PgSql\Lob $lob, string $data, ?int $length = null): int|false {}
770
771    function pg_lo_read_all(PgSql\Lob $lob): int {}
772
773    /**
774     * @alias pg_lo_read_all
775     */
776    #[\Deprecated(since: '8.0', message: 'use pg_lo_read_all() instead')]
777    function pg_loreadall(PgSql\Lob $lob): int {}
778
779    /**
780     * @param PgSql\Connection|string $connection
781     * @param string|int $filename
782     * @param string|int $oid
783     * @refcount 1
784     */
785    function pg_lo_import($connection, $filename = UNKNOWN, $oid = UNKNOWN): string|int|false {}
786
787    /**
788     * @param PgSql\Connection|string $connection
789     * @param string|int $filename
790     * @param string|int $oid
791     * @alias pg_lo_import
792     */
793    #[\Deprecated(since: '8.0', message: 'use pg_lo_import() instead')]
794    function pg_loimport($connection, $filename = UNKNOWN, $oid = UNKNOWN): string|int|false {}
795
796    /**
797     * @param PgSql\Connection|string|int $connection
798     * @param string|int $oid
799     * @param string|int $filename
800     */
801    function pg_lo_export($connection, $oid = UNKNOWN, $filename = UNKNOWN): bool {}
802
803    /**
804     * @param PgSql\Connection|string|int $connection
805     * @param string|int $oid
806     * @param string|int $filename
807     * @alias pg_lo_export
808     */
809    #[\Deprecated(since: '8.0', message: 'use pg_lo_export() instead')]
810    function pg_loexport($connection, $oid = UNKNOWN, $filename = UNKNOWN): bool {}
811
812    function pg_lo_seek(PgSql\Lob $lob, int $offset, int $whence = SEEK_CUR): bool {}
813
814    function pg_lo_tell(PgSql\Lob $lob): int {}
815
816    function pg_lo_truncate(PgSql\Lob $lob, int $size): bool {}
817
818    /** @param PgSql\Connection|int $connection */
819    function pg_set_error_verbosity($connection, int $verbosity = UNKNOWN): int|false {}
820
821    /** @param PgSql\Connection|string $connection */
822    function pg_set_client_encoding($connection, string $encoding = UNKNOWN): int {}
823
824    /**
825     * @param PgSql\Connection|string $connection
826     * @alias pg_set_client_encoding
827     */
828    #[\Deprecated(since: '8.0', message: 'use pg_set_client_encoding() instead')]
829    function pg_setclientencoding($connection, string $encoding = UNKNOWN): int {}
830
831    function pg_client_encoding(?PgSql\Connection $connection = null): string {}
832
833    /**
834     * @alias pg_client_encoding
835     */
836    #[\Deprecated(since: '8.0', message: 'use pg_client_encoding() instead')]
837    function pg_clientencoding(?PgSql\Connection $connection = null): string {}
838
839    function pg_end_copy(?PgSql\Connection $connection = null): bool {}
840
841    /** @param PgSql\Connection|string $connection */
842    function pg_put_line($connection, string $query = UNKNOWN): bool {}
843
844    /**
845     * @return array<int, string>|false
846     * @refcount 1
847     */
848    function pg_copy_to(PgSql\Connection $connection, string $table_name, string $separator = "\t", string $null_as = "\\\\N"): array|false {}
849
850    function pg_copy_from(PgSql\Connection $connection, string $table_name, array $rows, string $separator = "\t", string $null_as = "\\\\N"): bool {}
851
852    /**
853     * @param PgSql\Connection|string $connection
854     * @refcount 1
855     */
856    function pg_escape_string($connection, string $string = UNKNOWN): string {}
857
858    /**
859     * @param PgSql\Connection|string $connection
860     * @refcount 1
861     */
862    function pg_escape_bytea($connection, string $string = UNKNOWN): string {}
863
864    /** @refcount 1 */
865    function pg_unescape_bytea(string $string): string {}
866
867    /**
868     * @param PgSql\Connection|string $connection
869     * @refcount 1
870     */
871    function pg_escape_literal($connection, string $string = UNKNOWN): string|false {}
872
873    /**
874     * @param PgSql\Connection|string $connection
875     * @refcount 1
876     */
877    function pg_escape_identifier($connection, string $string = UNKNOWN): string|false {}
878
879    /** @refcount 1 */
880    function pg_result_error(PgSql\Result $result): string|false {}
881
882    /** @refcount 1 */
883    function pg_result_error_field(PgSql\Result $result, int $field_code): string|false|null {}
884
885    function pg_connection_status(PgSql\Connection $connection): int {}
886
887    function pg_transaction_status(PgSql\Connection $connection): int {}
888
889    function pg_connection_reset(PgSql\Connection $connection): bool {}
890
891    function pg_cancel_query(PgSql\Connection $connection): bool {}
892
893    function pg_connection_busy(PgSql\Connection $connection): bool {}
894
895    function pg_send_query(PgSql\Connection $connection, string $query): int|bool {}
896
897    function pg_send_query_params(PgSql\Connection $connection, string $query, array $params): int|bool {}
898
899    function pg_send_prepare(PgSql\Connection $connection, string $statement_name, string $query): int|bool {}
900
901    function pg_send_execute(PgSql\Connection $connection, string $statement_name, array $params): int|bool {}
902
903    /** @refcount 1 */
904    function pg_get_result(PgSql\Connection $connection): PgSql\Result|false {}
905
906    /** @refcount 1 */
907    function pg_result_status(PgSql\Result $result, int $mode = PGSQL_STATUS_LONG): string|int {}
908
909    /**
910     * @return array<int|string, int|string>
911     * @refcount 1
912     */
913    function pg_get_notify(PgSql\Connection $connection, int $mode = PGSQL_ASSOC): array|false {}
914
915    function pg_get_pid(PgSql\Connection $connection): int {}
916
917    /**
918     * @return resource|false
919     * @refcount 1
920     */
921    function pg_socket(PgSql\Connection $connection) {}
922
923    function pg_consume_input(PgSql\Connection $connection): bool {}
924
925    function pg_flush(PgSql\Connection $connection): int|bool {}
926
927    /**
928     * @return array<string, array>|false
929     * @refcount 1
930     */
931    function pg_meta_data(PgSql\Connection $connection, string $table_name, bool $extended = false): array|false {}
932
933    /**
934     * @return array<string, mixed>|false
935     * @refcount 1
936     */
937    function pg_convert(PgSql\Connection $connection, string $table_name, array $values, int $flags = 0): array|false {}
938
939    /** @refcount 1 */
940    function pg_insert(PgSql\Connection $connection, string $table_name, array $values, int $flags = PGSQL_DML_EXEC): PgSql\Result|string|bool {}
941
942    /** @refcount 1 */
943    function pg_update(PgSql\Connection $connection, string $table_name, array $values, array $conditions, int $flags = PGSQL_DML_EXEC): string|bool {}
944
945    /** @refcount 1 */
946    function pg_delete(PgSql\Connection $connection, string $table_name, array $conditions, int $flags = PGSQL_DML_EXEC): string|bool {}
947
948    /**
949     * @return array<int, array>|string|false
950     * @refcount 1
951     */
952    function pg_select(PgSql\Connection $connection, string $table_name, array $conditions = [], int $flags = PGSQL_DML_EXEC, int $mode = PGSQL_ASSOC): array|string|false {}
953
954    function pg_set_error_context_visibility(PgSql\Connection $connection, int $visibility): int {}
955
956#ifdef HAVE_PG_RESULT_MEMORY_SIZE
957    function pg_result_memory_size(PgSql\Result $result): int {}
958#endif
959
960    function pg_change_password(PgSql\Connection $connection, string $user, #[\SensitiveParameter] string $password): bool {}
961
962    function pg_put_copy_data(PgSql\Connection $connection, string $cmd): int {}
963    function pg_put_copy_end(PgSql\Connection $connection, ?string $error = null): int {}
964
965    /**
966     * @param resource $socket
967     */
968    function pg_socket_poll($socket, int $read, int $write, int $timeout = -1): int {}
969
970#ifdef HAVE_PG_SET_CHUNKED_ROWS_SIZE
971    function pg_set_chunked_rows_size(Pgsql\Connection $connection, int $size): bool {}
972#endif
973}
974
975namespace PgSql {
976    /**
977     * @strict-properties
978     * @not-serializable
979     */
980    final class Connection
981    {
982    }
983
984    /**
985     * @strict-properties
986     * @not-serializable
987     */
988    final class Result
989    {
990    }
991
992    /**
993     * @strict-properties
994     * @not-serializable
995     */
996    final class Lob
997    {
998    }
999
1000}
1001