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