xref: /PHP-8.3/ext/pgsql/pgsql.stub.php (revision 1e66e6ae)
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    #if PGVERSION_NUM > 110000
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    /**
249     * @var int
250     * @cvalue PGRES_COPY_OUT
251     */
252    const PGSQL_COPY_OUT = UNKNOWN;
253    /**
254     * @var int
255     * @cvalue PGRES_COPY_IN
256     */
257    const PGSQL_COPY_IN = UNKNOWN;
258    /**
259     * @var int
260     * @cvalue PGRES_BAD_RESPONSE
261     */
262    const PGSQL_BAD_RESPONSE = UNKNOWN;
263    /**
264     * @var int
265     * @cvalue PGRES_NONFATAL_ERROR
266     */
267    const PGSQL_NONFATAL_ERROR = UNKNOWN;
268    /**
269     * @var int
270     * @cvalue PGRES_FATAL_ERROR
271     */
272    const PGSQL_FATAL_ERROR = UNKNOWN;
273
274    /* For pg_result_error_field() field codes */
275
276    /**
277     * @var int
278     * @cvalue PG_DIAG_SEVERITY
279     */
280    const PGSQL_DIAG_SEVERITY = UNKNOWN;
281    /**
282     * @var int
283     * @cvalue PG_DIAG_SQLSTATE
284     */
285    const PGSQL_DIAG_SQLSTATE = UNKNOWN;
286    /**
287     * @var int
288     * @cvalue PG_DIAG_MESSAGE_PRIMARY
289     */
290    const PGSQL_DIAG_MESSAGE_PRIMARY = UNKNOWN;
291    /**
292     * @var int
293     * @cvalue PG_DIAG_MESSAGE_DETAIL
294     */
295    const PGSQL_DIAG_MESSAGE_DETAIL = UNKNOWN;
296    /**
297     * @var int
298     * @cvalue PG_DIAG_MESSAGE_HINT
299     */
300    const PGSQL_DIAG_MESSAGE_HINT = UNKNOWN;
301    /**
302     * @var int
303     * @cvalue PG_DIAG_STATEMENT_POSITION
304     */
305    const PGSQL_DIAG_STATEMENT_POSITION = UNKNOWN;
306#ifdef PG_DIAG_INTERNAL_POSITION
307    /**
308     * @var int
309     * @cvalue PG_DIAG_INTERNAL_POSITION
310     */
311    const PGSQL_DIAG_INTERNAL_POSITION = UNKNOWN;
312#endif
313#ifdef PG_DIAG_INTERNAL_QUERY
314    /**
315     * @var int
316     * @cvalue PG_DIAG_INTERNAL_QUERY
317     */
318    const PGSQL_DIAG_INTERNAL_QUERY = UNKNOWN;
319#endif
320    /**
321     * @var int
322     * @cvalue PG_DIAG_CONTEXT
323     */
324    const PGSQL_DIAG_CONTEXT = UNKNOWN;
325    /**
326     * @var int
327     * @cvalue PG_DIAG_SOURCE_FILE
328     */
329    const PGSQL_DIAG_SOURCE_FILE = UNKNOWN;
330    /**
331     * @var int
332     * @cvalue PG_DIAG_SOURCE_LINE
333     */
334    const PGSQL_DIAG_SOURCE_LINE = UNKNOWN;
335    /**
336     * @var int
337     * @cvalue PG_DIAG_SOURCE_FUNCTION
338     */
339    const PGSQL_DIAG_SOURCE_FUNCTION = UNKNOWN;
340#ifdef PG_DIAG_SCHEMA_NAME
341    /**
342     * @var int
343     * @cvalue PG_DIAG_SCHEMA_NAME
344     */
345    const PGSQL_DIAG_SCHEMA_NAME = UNKNOWN;
346#endif
347#ifdef PG_DIAG_TABLE_NAME
348    /**
349     * @var int
350     * @cvalue PG_DIAG_TABLE_NAME
351     */
352    const PGSQL_DIAG_TABLE_NAME = UNKNOWN;
353#endif
354#ifdef PG_DIAG_COLUMN_NAME
355    /**
356     * @var int
357     * @cvalue PG_DIAG_COLUMN_NAME
358     */
359    const PGSQL_DIAG_COLUMN_NAME = UNKNOWN;
360#endif
361#ifdef PG_DIAG_DATATYPE_NAME
362    /**
363     * @var int
364     * @cvalue PG_DIAG_DATATYPE_NAME
365     */
366    const PGSQL_DIAG_DATATYPE_NAME = UNKNOWN;
367#endif
368#ifdef PG_DIAG_CONSTRAINT_NAME
369    /**
370     * @var int
371     * @cvalue PG_DIAG_CONSTRAINT_NAME
372     */
373    const PGSQL_DIAG_CONSTRAINT_NAME = UNKNOWN;
374#endif
375#ifdef PG_DIAG_SEVERITY_NONLOCALIZED
376    /**
377     * @var int
378     * @cvalue PG_DIAG_SEVERITY_NONLOCALIZED
379     */
380    const PGSQL_DIAG_SEVERITY_NONLOCALIZED = UNKNOWN;
381#endif
382
383    /* pg_convert options */
384
385    /**
386     * @var int
387     * @cvalue PGSQL_CONV_IGNORE_DEFAULT
388     */
389    const PGSQL_CONV_IGNORE_DEFAULT = UNKNOWN;
390    /**
391     * @var int
392     * @cvalue PGSQL_CONV_FORCE_NULL
393     */
394    const PGSQL_CONV_FORCE_NULL = UNKNOWN;
395    /**
396     * @var int
397     * @cvalue PGSQL_CONV_IGNORE_NOT_NULL
398     */
399    const PGSQL_CONV_IGNORE_NOT_NULL = UNKNOWN;
400
401    /* pg_insert/update/delete/select options */
402
403    /**
404     * @var int
405     * @cvalue PGSQL_DML_ESCAPE
406     */
407    const PGSQL_DML_ESCAPE = UNKNOWN;
408    /**
409     * @var int
410     * @cvalue PGSQL_DML_NO_CONV
411     */
412    const PGSQL_DML_NO_CONV = UNKNOWN;
413    /**
414     * @var int
415     * @cvalue PGSQL_DML_EXEC
416     */
417    const PGSQL_DML_EXEC = UNKNOWN;
418    /**
419     * @var int
420     * @cvalue PGSQL_DML_ASYNC
421     */
422    const PGSQL_DML_ASYNC = UNKNOWN;
423    /**
424     * @var int
425     * @cvalue PGSQL_DML_STRING
426     */
427    const PGSQL_DML_STRING = UNKNOWN;
428#ifdef PQTRACE_SUPPPRESS_TIMESTAMPS
429    /**
430     * @var int
431     * @cvalue PQTRACE_SUPPRESS_TIMESTAMPS
432     */
433    const PGSQL_TRACE_SUPPRESS_TIMESTAMPS = UNKNOWN;
434#endif
435#ifdef PQTRACE_REGRESS_MODE
436    /**
437     * @var int
438     * @cvalue PQTRACE_REGRESS_MODE
439     */
440    const PGSQL_TRACE_REGRESS_MODE = UNKNOWN;
441#endif
442
443#ifdef HAVE_PG_CONTEXT_VISIBILITY
444    /* For pg_set_error_context_visibility() */
445
446    /**
447     * @var int
448     * @cvalue PQSHOW_CONTEXT_NEVER
449     */
450    const PGSQL_SHOW_CONTEXT_NEVER = UNKNOWN;
451    /**
452     * @var int
453     * @cvalue PQSHOW_CONTEXT_ERRORS
454     */
455    const PGSQL_SHOW_CONTEXT_ERRORS = UNKNOWN;
456    /**
457     * @var int
458     * @cvalue PQSHOW_CONTEXT_ALWAYS
459     */
460    const PGSQL_SHOW_CONTEXT_ALWAYS = UNKNOWN;
461#endif
462
463    function pg_connect(string $connection_string, int $flags = 0): PgSql\Connection|false {}
464
465    function pg_pconnect(string $connection_string, int $flags = 0): PgSql\Connection|false {}
466
467    function pg_connect_poll(PgSql\Connection $connection): int {}
468
469    function pg_close(?PgSql\Connection $connection = null): true {}
470
471    /** @refcount 1 */
472    function pg_dbname(?PgSql\Connection $connection = null): string {}
473
474    function pg_last_error(?PgSql\Connection $connection = null): string {}
475
476    /**
477     * @alias pg_last_error
478     * @deprecated
479     */
480    function pg_errormessage(?PgSql\Connection $connection = null): string {}
481
482    /** @refcount 1 */
483    function pg_options(?PgSql\Connection $connection = null): string {}
484
485    /** @refcount 1 */
486    function pg_port(?PgSql\Connection $connection = null): string {}
487
488    /** @refcount 1 */
489    function pg_tty(?PgSql\Connection $connection = null): string {}
490
491    /** @refcount 1 */
492    function pg_host(?PgSql\Connection $connection = null): string {}
493
494    /**
495     * @return array<string, int|string|null>
496     * @refcount 1
497     */
498    function pg_version(?PgSql\Connection $connection = null): array {}
499
500    /**
501     * @param PgSql\Connection|string $connection
502     * @refcount 1
503     */
504    function pg_parameter_status($connection, string $name = UNKNOWN): string|false {}
505
506    function pg_ping(?PgSql\Connection $connection = null): bool {}
507
508    /**
509     * @param PgSql\Connection|string $connection
510     * @refcount 1
511     */
512    function pg_query($connection, string $query = UNKNOWN): PgSql\Result|false {}
513
514    /**
515     * @param PgSql\Connection|string $connection
516     * @alias pg_query
517     */
518    function pg_exec($connection, string $query = UNKNOWN): PgSql\Result|false {}
519
520    /**
521     * @param PgSql\Connection|string $connection
522     * @param string|array $query
523     * @refcount 1
524     */
525    function pg_query_params($connection, $query, array $params = UNKNOWN): PgSql\Result|false {}
526
527    /**
528     * @param PgSql\Connection|string $connection
529     * @refcount 1
530     */
531    function pg_prepare($connection, string $statement_name, string $query = UNKNOWN): PgSql\Result|false {}
532
533    /**
534     * @param PgSql\Connection|string $connection
535     * @param string|array $statement_name
536     * @refcount 1
537     */
538    function pg_execute($connection, $statement_name, array $params = UNKNOWN): PgSql\Result|false {}
539
540    function pg_num_rows(PgSql\Result $result): int {}
541
542    /**
543     * @alias pg_num_rows
544     * @deprecated
545     */
546    function pg_numrows(PgSql\Result $result): int {}
547
548    function pg_num_fields(PgSql\Result $result): int {}
549
550    /**
551     * @alias pg_num_fields
552     * @deprecated
553     */
554    function pg_numfields(PgSql\Result $result): int {}
555
556    function pg_affected_rows(PgSql\Result $result): int {}
557
558    /**
559     * @alias pg_affected_rows
560     * @deprecated
561     */
562    function pg_cmdtuples(PgSql\Result $result): int {}
563
564    function pg_last_notice(PgSql\Connection $connection, int $mode = PGSQL_NOTICE_LAST): array|string|bool {}
565
566    function pg_field_table(PgSql\Result $result, int $field, bool $oid_only = false): string|int|false {}
567
568    /** @refcount 1 */
569    function pg_field_name(PgSql\Result $result, int $field): string {}
570
571    /**
572     * @alias pg_field_name
573     * @deprecated
574     */
575    function pg_fieldname(PgSql\Result $result, int $field): string {}
576
577    function pg_field_size(PgSql\Result $result, int $field): int {}
578
579    /**
580     * @alias pg_field_size
581     * @deprecated
582     */
583    function pg_fieldsize(PgSql\Result $result, int $field): int {}
584
585    function pg_field_type(PgSql\Result $result, int $field): string {}
586
587    /**
588     * @alias pg_field_type
589     * @deprecated
590     */
591    function pg_fieldtype(PgSql\Result $result, int $field): string {}
592
593    /** @refcount 1 */
594    function pg_field_type_oid(PgSql\Result $result, int $field): string|int {}
595
596    function pg_field_num(PgSql\Result $result, string $field): int {}
597
598    /**
599     * @alias pg_field_num
600     * @deprecated
601     */
602    function pg_fieldnum(PgSql\Result $result, string $field): int {}
603
604    /**
605     * @param string|int|null $row
606     * @refcount 1
607     */
608    function pg_fetch_result(PgSql\Result $result, $row, string|int $field = UNKNOWN): string|false|null {}
609
610    /**
611     * @param string|int $row
612     * @alias pg_fetch_result
613     * @deprecated
614     */
615    function pg_result(PgSql\Result $result, $row, string|int $field = UNKNOWN): string|false|null {}
616
617    /**
618     * @return array<int|string, string|null>|false
619     * @refcount 1
620     */
621    function pg_fetch_row(PgSql\Result $result, ?int $row = null, int $mode = PGSQL_NUM): array|false {}
622
623    /**
624     * @return array<int|string, string|null>|false
625     * @refcount 1
626     */
627    function pg_fetch_assoc(PgSql\Result $result, ?int $row = null): array|false {}
628
629    /**
630     * @return array<int|string, string|null>|false
631     * @refcount 1
632     */
633    function pg_fetch_array(PgSql\Result $result, ?int $row = null, int $mode = PGSQL_BOTH): array|false {}
634
635    /** @refcount 1 */
636    function pg_fetch_object(PgSql\Result $result, ?int $row = null, string $class = "stdClass", array $constructor_args = []): object|false {}
637
638    /**
639     * @return array<int, array>
640     * @refcount 1
641     */
642    function pg_fetch_all(PgSql\Result $result, int $mode = PGSQL_ASSOC): array {}
643
644    /**
645     * @return array<int, string|null>
646     * @refcount 1
647     */
648    function pg_fetch_all_columns(PgSql\Result $result, int $field = 0): array {}
649
650    function pg_result_seek(PgSql\Result $result, int $row): bool {}
651
652    /** @param string|int|null $row */
653    function pg_field_prtlen(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
654
655    /**
656     * @param string|int $row
657     * @deprecated
658     */
659    function pg_fieldprtlen(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
660
661    /** @param string|int|null $row */
662    function pg_field_is_null(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
663
664    /**
665     * @param string|int $row
666     * @deprecated
667     */
668    function pg_fieldisnull(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
669
670    function pg_free_result(PgSql\Result $result): bool {}
671
672    /**
673     * @alias pg_free_result
674     * @deprecated
675     */
676    function pg_freeresult(PgSql\Result $result): bool {}
677
678    /** @refcount 1 */
679    function pg_last_oid(PgSql\Result $result): string|int|false {}
680
681    /**
682     * @alias pg_last_oid
683     * @deprecated
684     */
685    function pg_getlastoid(PgSql\Result $result): string|int|false {}
686
687    function pg_trace(string $filename, string $mode = "w", ?PgSql\Connection $connection = null, int $trace_mode = 0): bool {}
688
689    function pg_untrace(?PgSql\Connection $connection = null): true {}
690
691    /**
692     * @param PgSql\Connection $connection
693     * @param string|int $oid
694     * @refcount 1
695     */
696    function pg_lo_create($connection = UNKNOWN, $oid = UNKNOWN): string|int|false {}
697
698    /**
699     * @param PgSql\Connection $connection
700     * @param string|int $oid
701     * @alias pg_lo_create
702     * @deprecated
703     */
704    function pg_locreate($connection = UNKNOWN, $oid = UNKNOWN): string|int|false {}
705
706    /**
707     * @param PgSql\Connection $connection
708     * @param string|int $oid
709     */
710    function pg_lo_unlink($connection, $oid = UNKNOWN): bool {}
711
712    /**
713     * @param PgSql\Connection $connection
714     * @param string|int $oid
715     * @alias pg_lo_unlink
716     * @deprecated
717     */
718    function pg_lounlink($connection, $oid = UNKNOWN): bool {}
719
720    /**
721     * @param PgSql\Connection $connection
722     * @param string|int $oid
723     * @refcount 1
724     */
725    function pg_lo_open($connection, $oid = UNKNOWN, string $mode = UNKNOWN): PgSql\Lob|false {}
726
727    /**
728     * @param PgSql\Connection $connection
729     * @param string|int $oid
730     * @alias pg_lo_open
731     * @deprecated
732     */
733    function pg_loopen($connection, $oid = UNKNOWN, string $mode = UNKNOWN): PgSql\Lob|false {}
734
735    function pg_lo_close(PgSql\Lob $lob): bool {}
736
737    /**
738     * @alias pg_lo_close
739     * @deprecated
740     */
741    function pg_loclose(PgSql\Lob $lob): bool {}
742
743    /** @refcount 1 */
744    function pg_lo_read(PgSql\Lob $lob, int $length = 8192): string|false {}
745
746    /**
747     * @alias pg_lo_read
748     * @deprecated
749     */
750    function pg_loread(PgSql\Lob $lob, int $length = 8192): string|false {}
751
752    function pg_lo_write(PgSql\Lob $lob, string $data, ?int $length = null): int|false {}
753
754    /**
755     * @alias pg_lo_write
756     * @deprecated
757     */
758    function pg_lowrite(PgSql\Lob $lob, string $data, ?int $length = null): int|false {}
759
760    function pg_lo_read_all(PgSql\Lob $lob): int {}
761
762    /**
763     * @alias pg_lo_read_all
764     * @deprecated
765     */
766    function pg_loreadall(PgSql\Lob $lob): int {}
767
768    /**
769     * @param PgSql\Connection|string $connection
770     * @param string|int $filename
771     * @param string|int $oid
772     * @refcount 1
773     */
774    function pg_lo_import($connection, $filename = UNKNOWN, $oid = UNKNOWN): string|int|false {}
775
776    /**
777     * @param PgSql\Connection|string $connection
778     * @param string|int $filename
779     * @param string|int $oid
780     * @alias pg_lo_import
781     * @deprecated
782     */
783    function pg_loimport($connection, $filename = UNKNOWN, $oid = UNKNOWN): string|int|false {}
784
785    /**
786     * @param PgSql\Connection|string|int $connection
787     * @param string|int $oid
788     * @param string|int $filename
789     */
790    function pg_lo_export($connection, $oid = UNKNOWN, $filename = UNKNOWN): bool {}
791
792    /**
793     * @param PgSql\Connection|string|int $connection
794     * @param string|int $oid
795     * @param string|int $filename
796     * @alias pg_lo_export
797     * @deprecated
798     */
799    function pg_loexport($connection, $oid = UNKNOWN, $filename = UNKNOWN): bool {}
800
801    function pg_lo_seek(PgSql\Lob $lob, int $offset, int $whence = SEEK_CUR): bool {}
802
803    function pg_lo_tell(PgSql\Lob $lob): int {}
804
805    function pg_lo_truncate(PgSql\Lob $lob, int $size): bool {}
806
807    /** @param PgSql\Connection|int $connection */
808    function pg_set_error_verbosity($connection, int $verbosity = UNKNOWN): int|false {}
809
810    /** @param PgSql\Connection|string $connection */
811    function pg_set_client_encoding($connection, string $encoding = UNKNOWN): int {}
812
813    /**
814     * @param PgSql\Connection|string $connection
815     * @alias pg_set_client_encoding
816     * @deprecated
817     */
818    function pg_setclientencoding($connection, string $encoding = UNKNOWN): int {}
819
820    function pg_client_encoding(?PgSql\Connection $connection = null): string {}
821
822    /**
823     * @alias pg_client_encoding
824     * @deprecated
825     */
826    function pg_clientencoding(?PgSql\Connection $connection = null): string {}
827
828    function pg_end_copy(?PgSql\Connection $connection = null): bool {}
829
830    /** @param PgSql\Connection|string $connection */
831    function pg_put_line($connection, string $query = UNKNOWN): bool {}
832
833    /**
834     * @return array<int, string>|false
835     * @refcount 1
836     */
837    function pg_copy_to(PgSql\Connection $connection, string $table_name, string $separator = "\t", string $null_as = "\\\\N"): array|false {}
838
839    function pg_copy_from(PgSql\Connection $connection, string $table_name, array $rows, string $separator = "\t", string $null_as = "\\\\N"): bool {}
840
841    /**
842     * @param PgSql\Connection|string $connection
843     * @refcount 1
844     */
845    function pg_escape_string($connection, string $string = UNKNOWN): string {}
846
847    /**
848     * @param PgSql\Connection|string $connection
849     * @refcount 1
850     */
851    function pg_escape_bytea($connection, string $string = UNKNOWN): string {}
852
853    /** @refcount 1 */
854    function pg_unescape_bytea(string $string): string {}
855
856    /**
857     * @param PgSql\Connection|string $connection
858     * @refcount 1
859     */
860    function pg_escape_literal($connection, string $string = UNKNOWN): string|false {}
861
862    /**
863     * @param PgSql\Connection|string $connection
864     * @refcount 1
865     */
866    function pg_escape_identifier($connection, string $string = UNKNOWN): string|false {}
867
868    /** @refcount 1 */
869    function pg_result_error(PgSql\Result $result): string|false {}
870
871    /** @refcount 1 */
872    function pg_result_error_field(PgSql\Result $result, int $field_code): string|false|null {}
873
874    function pg_connection_status(PgSql\Connection $connection): int {}
875
876    function pg_transaction_status(PgSql\Connection $connection): int {}
877
878    function pg_connection_reset(PgSql\Connection $connection): bool {}
879
880    function pg_cancel_query(PgSql\Connection $connection): bool {}
881
882    function pg_connection_busy(PgSql\Connection $connection): bool {}
883
884    function pg_send_query(PgSql\Connection $connection, string $query): int|bool {}
885
886    function pg_send_query_params(PgSql\Connection $connection, string $query, array $params): int|bool {}
887
888    function pg_send_prepare(PgSql\Connection $connection, string $statement_name, string $query): int|bool {}
889
890    function pg_send_execute(PgSql\Connection $connection, string $statement_name, array $params): int|bool {}
891
892    /** @refcount 1 */
893    function pg_get_result(PgSql\Connection $connection): PgSql\Result|false {}
894
895    /** @refcount 1 */
896    function pg_result_status(PgSql\Result $result, int $mode = PGSQL_STATUS_LONG): string|int {}
897
898    /**
899     * @return array<int|string, int|string>
900     * @refcount 1
901     */
902    function pg_get_notify(PgSql\Connection $connection, int $mode = PGSQL_ASSOC): array|false {}
903
904    function pg_get_pid(PgSql\Connection $connection): int {}
905
906    /**
907     * @return resource|false
908     * @refcount 1
909     */
910    function pg_socket(PgSql\Connection $connection) {}
911
912    function pg_consume_input(PgSql\Connection $connection): bool {}
913
914    function pg_flush(PgSql\Connection $connection): int|bool {}
915
916    /**
917     * @return array<string, array>|false
918     * @refcount 1
919     */
920    function pg_meta_data(PgSql\Connection $connection, string $table_name, bool $extended = false): array|false {}
921
922    /**
923     * @return array<string, mixed>|false
924     * @refcount 1
925     */
926    function pg_convert(PgSql\Connection $connection, string $table_name, array $values, int $flags = 0): array|false {}
927
928    /** @refcount 1 */
929    function pg_insert(PgSql\Connection $connection, string $table_name, array $values, int $flags = PGSQL_DML_EXEC): PgSql\Result|string|bool {}
930
931    /** @refcount 1 */
932    function pg_update(PgSql\Connection $connection, string $table_name, array $values, array $conditions, int $flags = PGSQL_DML_EXEC): string|bool {}
933
934    /** @refcount 1 */
935    function pg_delete(PgSql\Connection $connection, string $table_name, array $conditions, int $flags = PGSQL_DML_EXEC): string|bool {}
936
937    /**
938     * @return array<int, array>|string|false
939     * @refcount 1
940     */
941    function pg_select(PgSql\Connection $connection, string $table_name, array $conditions, int $flags = PGSQL_DML_EXEC, int $mode = PGSQL_ASSOC): array|string|false {}
942
943#ifdef HAVE_PG_CONTEXT_VISIBILITY
944    function pg_set_error_context_visibility(PgSql\Connection $connection, int $visibility): int {}
945#endif
946}
947
948namespace PgSql {
949    /**
950     * @strict-properties
951     * @not-serializable
952     */
953    final class Connection
954    {
955    }
956
957    /**
958     * @strict-properties
959     * @not-serializable
960     */
961    final class Result
962    {
963    }
964
965    /**
966     * @strict-properties
967     * @not-serializable
968     */
969    final class Lob
970    {
971    }
972
973}
974