xref: /PHP-8.0/ext/pgsql/pgsql.stub.php (revision ca219d7d)
1<?php
2
3/** @generate-function-entries */
4
5/** @return resource|false */
6function pg_connect(string $connection_string, int $flags = 0) {}
7
8/** @return resource|false */
9function pg_pconnect(string $connection_string, int $flags = 0) {}
10
11/** @param resource $connection */
12function pg_connect_poll($connection): int {}
13
14/** @param resource|null $connection */
15function pg_close($connection = null): bool {}
16
17/** @param resource|null $connection */
18function pg_dbname($connection = null): string {}
19
20/** @param resource|null $connection */
21function pg_last_error($connection = null): string {}
22
23/**
24 * @param resource|null $connection
25 * @alias pg_last_error
26 * @deprecated
27 */
28function pg_errormessage($connection = null): string {}
29
30/** @param resource|null $connection */
31function pg_options($connection = null): string {}
32
33/** @param resource|null $connection */
34function pg_port($connection = null): string {}
35
36/** @param resource|null $connection */
37function pg_tty($connection = null): string {}
38
39/** @param resource|null $connection */
40function pg_host($connection = null): string {}
41
42/** @param resource|null $connection */
43function pg_version($connection = null): array {}
44
45/** @param resource|string $connection */
46function pg_parameter_status($connection, string $name = UNKNOWN): string|false {}
47
48/** @param resource|null $connection */
49function pg_ping($connection = null): bool {}
50
51/**
52 * @param resource|string $connection
53 * @return resource|false
54 */
55function pg_query($connection, string $query = UNKNOWN) {}
56
57/**
58 * @param resource|string $connection
59 * @return resource|false
60 * @alias pg_query
61 */
62function pg_exec($connection, string $query = UNKNOWN) {}
63
64/**
65 * @param resource|string $connection
66 * @param string|array $query
67 * @return resource|false
68 */
69function pg_query_params($connection, $query, array $params = UNKNOWN) {}
70
71/**
72 * @param resource|string $connection
73 * @return resource|false
74 */
75function pg_prepare($connection, string $statement_name, string $query = UNKNOWN) {}
76
77/**
78 * @param resource|string $connection
79 * @param string|array $statement_name
80 * @return resource|false
81 */
82function pg_execute($connection, $statement_name, array $params = UNKNOWN) {}
83
84/** @param resource $result */
85function pg_num_rows($result): int {}
86
87/**
88 * @param resource $result
89 * @alias pg_num_rows
90 * @deprecated
91 */
92function pg_numrows($result): int {}
93
94/** @param resource $result */
95function pg_num_fields($result): int {}
96
97/**
98 * @param resource $result
99 * @alias pg_num_fields
100 * @deprecated
101 */
102function pg_numfields($result): int {}
103
104/** @param resource $result */
105function pg_affected_rows($result): int {}
106
107/**
108 * @param resource $result
109 * @alias pg_affected_rows
110 * @deprecated
111 */
112function pg_cmdtuples($result): int {}
113
114/** @param resource $connection */
115function pg_last_notice($connection, int $mode = PGSQL_NOTICE_LAST): array|string|bool {}
116
117/** @param resource $result */
118function pg_field_table($result, int $field, bool $oid_only = false): string|int|false {}
119
120/** @param resource $result */
121function pg_field_name($result, int $field): string {}
122
123/**
124 * @param resource $result
125 * @alias pg_field_name
126 * @deprecated
127 */
128function pg_fieldname($result, int $field): string {}
129
130/** @param resource $result */
131function pg_field_size($result, int $field): int {}
132
133/**
134 * @param resource $result
135 * @alias pg_field_size
136 * @deprecated
137 */
138function pg_fieldsize($result, int $field): int {}
139
140/** @param resource $result */
141function pg_field_type($result, int $field): string {}
142
143/**
144 * @param resource $result
145 * @alias pg_field_type
146 * @deprecated
147 */
148function pg_fieldtype($result, int $field): string {}
149
150/** @param resource $result */
151function pg_field_type_oid($result, int $field): string|int {}
152
153/** @param resource $result */
154function pg_field_num($result, string $field): int {}
155
156/**
157 * @param resource $result
158 * @alias pg_field_num
159 * @deprecated
160 */
161function pg_fieldnum($result, string $field): int {}
162
163/**
164 * @param resource $result
165 * @param string|int $row
166 */
167function pg_fetch_result($result, $row, string|int $field = UNKNOWN): string|false|null {}
168
169/**
170 * @param resource $result
171 * @param string|int $row
172 * @alias pg_fetch_result
173 * @deprecated
174 */
175function pg_result($result, $row, string|int $field = UNKNOWN): string|false|null {}
176
177/**
178 * @param resource $result
179 */
180function pg_fetch_row($result, ?int $row = null, int $mode = PGSQL_NUM): array|false {}
181
182/**
183 * @param resource $result
184 */
185function pg_fetch_assoc($result, ?int $row = null): array|false {}
186
187/**
188 * @param resource $result
189 */
190function pg_fetch_array($result, ?int $row = null, int $mode = PGSQL_BOTH): array|false {}
191
192/** @param resource $result */
193function pg_fetch_object($result, ?int $row = null, string $class = "stdClass", array $constructor_args = []): object|false {}
194
195/** @param resource $result */
196function pg_fetch_all($result, int $mode = PGSQL_ASSOC): array {}
197
198/** @param resource $result */
199function pg_fetch_all_columns($result, int $field = 0): array {}
200
201/** @param resource $result */
202function pg_result_seek($result, int $row): bool {}
203
204/**
205 * @param resource $result
206 * @param string|int $row
207 */
208function pg_field_prtlen($result, $row, string|int $field = UNKNOWN): int|false {}
209
210/**
211 * @param resource $result
212 * @param string|int $row
213 * @alias pg_field_prtlen
214 * @deprecated
215 */
216function pg_fieldprtlen($result, $row, string|int $field = UNKNOWN): int|false {}
217
218/**
219 * @param resource $result
220 * @param string|int $row
221 */
222function pg_field_is_null($result, $row, string|int $field = UNKNOWN): int|false {}
223
224/**
225 * @param resource $result
226 * @param string|int $row
227 * @alias pg_field_is_null
228 * @deprecated
229 */
230function pg_fieldisnull($result, $row, string|int $field = UNKNOWN): int|false {}
231
232/** @param resource $result */
233function pg_free_result($result): bool {}
234
235/**
236 * @param resource $result
237 * @alias pg_free_result
238 * @deprecated
239 */
240function pg_freeresult($result): bool {}
241
242/** @param resource $result */
243function pg_last_oid($result): string|int|false {}
244
245/**
246 * @param resource $result
247 * @alias pg_last_oid
248 * @deprecated
249 */
250function pg_getlastoid($result): string|int|false {}
251
252/** @param resource|null $connection */
253function pg_trace(string $filename, string $mode = "w", $connection = null): bool {}
254
255/** @param resource|null $connection */
256function pg_untrace($connection = null): bool {}
257
258/**
259 * @param resource $connection
260 * @param string|int $oid
261 */
262function pg_lo_create($connection = UNKNOWN, $oid = UNKNOWN): string|int|false {}
263
264/**
265 * @param resource $connection
266 * @param string|int $oid
267 * @alias pg_lo_create
268 * @deprecated
269 */
270function pg_locreate($connection = UNKNOWN, $oid = UNKNOWN): string|int|false {}
271
272/**
273 * @param resource $connection
274 * @param string|int $oid
275 */
276function pg_lo_unlink($connection, $oid = UNKNOWN): bool {}
277
278/**
279 * @param resource $connection
280 * @param string|int $oid
281 * @alias pg_lo_unlink
282 * @deprecated
283 */
284function pg_lounlink($connection, $oid = UNKNOWN): bool {}
285
286/**
287 * @param resource $connection
288 * @param string|int $oid
289 * @return resource|false
290 */
291function pg_lo_open($connection, $oid = UNKNOWN, string $mode = UNKNOWN) {}
292
293/**
294 * @param resource $connection
295 * @param string|int $oid
296 * @return resource|false
297 * @alias pg_lo_open
298 * @deprecated
299 */
300function pg_loopen($connection, $oid = UNKNOWN, string $mode = UNKNOWN) {}
301
302/** @param resource $lob */
303function pg_lo_close($lob): bool {}
304
305/**
306 * @param resource $lob
307 * @alias pg_lo_close
308 * @deprecated
309 */
310function pg_loclose($lob): bool {}
311
312/** @param resource $lob */
313function pg_lo_read($lob, int $length = 8192): string|false {}
314
315/**
316 * @param resource $lob
317 * @alias pg_lo_read
318 * @deprecated
319 */
320function pg_loread($lob, int $length = 8192): string|false {}
321
322/** @param resource $lob */
323function pg_lo_write($lob, string $data, ?int $length = null): int|false {}
324
325/**
326 * @param resource $lob
327 * @alias pg_lo_write
328 * @deprecated
329 */
330function pg_lowrite($lob, string $data, ?int $length = null): int|false {}
331
332/** @param resource $lob */
333function pg_lo_read_all($lob): int {}
334
335/**
336 * @param resource $lob
337 * @alias pg_lo_read_all
338 * @deprecated
339 */
340function pg_loreadall($lob): int {}
341
342/**
343 * @param resource|string $connection
344 * @param string|int $filename
345 * @param string|int $oid
346 * @return resource|false
347 */
348function pg_lo_import($connection, $filename = UNKNOWN, $oid = UNKNOWN): string|int|false {}
349
350/**
351 * @param resource|string $connection
352 * @param string|int $filename
353 * @param string|int $oid
354 * @return resource|false
355 * @alias pg_lo_import
356 * @deprecated
357 */
358function pg_loimport($connection, $filename = UNKNOWN, $oid = UNKNOWN): string|int|false {}
359
360/**
361 * @param resource|string|int $connection
362 * @param string|int $oid
363 * @param string|int $filename
364 * @return resource|false
365 */
366function pg_lo_export($connection, $oid = UNKNOWN, $filename = UNKNOWN): bool {}
367
368/**
369 * @param resource|string|int $connection
370 * @param string|int $oid
371 * @param string|int $filename
372 * @return resource|false
373 * @alias pg_lo_export
374 * @deprecated
375 */
376function pg_loexport($connection, $oid = UNKNOWN, $filename = UNKNOWN): bool {}
377
378/** @param resource $lob */
379function pg_lo_seek($lob, int $offset, int $whence = SEEK_CUR): bool {}
380
381/** @param resource $lob */
382function pg_lo_tell($lob): int {}
383
384/** @param resource $lob */
385function pg_lo_truncate($lob, int $size): bool {}
386
387/** @param resource|int $connection */
388function pg_set_error_verbosity($connection, int $verbosity = UNKNOWN): int|false {}
389
390/** @param resource|string $connection */
391function pg_set_client_encoding($connection, string $encoding = UNKNOWN): int {}
392
393/**
394 * @param resource|string $connection
395 * @alias pg_set_client_encoding
396 * @deprecated
397 */
398function pg_setclientencoding($connection, string $encoding = UNKNOWN): int {}
399
400/** @param resource|null $connection */
401function pg_client_encoding($connection = null): string {}
402
403/**
404 * @param resource|null $connection
405 * @alias pg_client_encoding
406 * @deprecated
407 */
408function pg_clientencoding($connection = null): string {}
409
410/** @param resource|null $connection */
411function pg_end_copy($connection = null): bool {}
412
413/** @param resource|string $connection */
414function pg_put_line($connection, string $query = UNKNOWN): bool {}
415
416/** @param resource $connection */
417function pg_copy_to($connection, string $table_name, string $separator = "\t", string $null_as = "\\\\N"): array|false {}
418
419/** @param resource $connection */
420function pg_copy_from($connection, string $table_name, array $rows, string $separator = "\t", string $null_as = "\\\\N"): bool {}
421
422/** @param resource|string $connection */
423function pg_escape_string($connection, string $string = UNKNOWN): string {}
424
425/** @param resource|string $connection */
426function pg_escape_bytea($connection, string $string = UNKNOWN): string {}
427
428function pg_unescape_bytea(string $string): string {}
429
430/** @param resource|string $connection */
431function pg_escape_literal($connection, string $string = UNKNOWN): string|false {}
432
433/** @param resource|string $connection */
434function pg_escape_identifier($connection, string $string = UNKNOWN): string|false {}
435
436/** @param resource $result */
437function pg_result_error($result): string|false {}
438
439/** @param resource $result */
440function pg_result_error_field($result, int $field_code): string|false|null {}
441
442/** @param resource $connection */
443function pg_connection_status($connection): int {}
444
445/** @param resource $connection */
446function pg_transaction_status($connection): int {}
447
448/** @param resource $connection */
449function pg_connection_reset($connection): bool {}
450
451/** @param resource $connection */
452function pg_cancel_query($connection): bool {}
453
454/** @param resource $connection */
455function pg_connection_busy($connection): bool {}
456
457/** @param resource $connection */
458function pg_send_query($connection, string $query): int|bool {}
459
460/** @param resource $connection */
461function pg_send_query_params($connection, string $query, array $params): int|bool {}
462
463/** @param resource $connection */
464function pg_send_prepare($connection, string $statement_name, string $query): int|bool {}
465
466/** @param resource $connection */
467function pg_send_execute($connection, string $statement_name, array $params): int|bool {}
468
469/**
470 * @param resource $connection
471 * @return resource|false
472 */
473function pg_get_result($connection) {}
474
475/** @param resource $result */
476function pg_result_status($result, int $mode = PGSQL_STATUS_LONG): string|int {}
477
478/** @param resource $connection */
479function pg_get_notify($connection, int $mode = PGSQL_ASSOC): array|false {}
480
481/** @param resource $connection */
482function pg_get_pid($connection): int {}
483
484/**
485 * @param resource $connection
486 * @return resource|false
487 */
488function pg_socket($connection) {}
489
490/** @param resource $connection */
491function pg_consume_input($connection): bool {}
492
493/** @param resource $connection */
494function pg_flush($connection): int|bool {}
495
496/** @param resource $connection */
497function pg_meta_data($connection, string $table_name, bool $extended = false): array|false {}
498
499/** @param resource $connection */
500function pg_convert($connection, string $table_name, array $values, int $flags = 0): array|false {}
501
502/**
503 * @param resource $connection
504 * @return resource|string|bool
505 */
506function pg_insert($connection, string $table_name, array $values, int $flags = PGSQL_DML_EXEC) {}
507
508/** @param resource $connection */
509function pg_update($connection, string $table_name, array $values, array $conditions, int $flags = PGSQL_DML_EXEC): string|bool {}
510
511/** @param resource $connection */
512function pg_delete($connection, string $table_name, array $conditions, int $flags = PGSQL_DML_EXEC): string|bool {}
513
514/** @param resource $connection */
515function pg_select($connection, string $table_name, array $conditions, int $flags = PGSQL_DML_EXEC, int $mode = PGSQL_ASSOC): array|string|false {}
516