Debian Codegraph @

codelitephp/resources/cc/pgsql.php

raw
1 <?php
2
3 // Start of pgsql v.
4
5 /**
6 * Open a PostgreSQL connection
7 * @link http://www.php.net/manual/en/function.pg-connect.php
8 * @param connection_string string <p>
9 * The connection_string can be empty to use all default parameters, or it
10 * can contain one or more parameter settings separated by whitespace.
11 * Each parameter setting is in the form keyword = value. Spaces around
12 * the equal sign are optional. To write an empty value or a value
13 * containing spaces, surround it with single quotes, e.g., keyword =
14 * 'a value'. Single quotes and backslashes within the value must be
15 * escaped with a backslash, i.e., \' and \\.
16 * </p>
17 * <p>
18 * The currently recognized parameter keywords are:
19 * host, hostaddr, port,
20 * dbname (defaults to value of user),
21 * user,
22 * password, connect_timeout,
23 * options, tty (ignored), sslmode,
24 * requiressl (deprecated in favor of sslmode), and
25 * service. Which of these arguments exist depends
26 * on your PostgreSQL version.
27 * </p>
28 * <p>
29 * The options parameter can be used to set command line parameters
30 * to be invoked by the server.
31 * </p>
32 * @param connect_type int[optional] <p>
33 * If PGSQL_CONNECT_FORCE_NEW is passed, then a new connection
34 * is created, even if the connection_string is identical to
35 * an existing connection.
36 * </p>
37 * <p>
38 * If PGSQL_CONNECT_ASYNC is given, then the
39 * connection is established asynchronously. The state of the connection
40 * can then be checked via pg_connect_poll or
41 * pg_connection_status.
42 * </p>
43 * @return resource PostgreSQL connection resource on success, false on failure.
44 */
45 function pg_connect ($connection_string, $connect_type = null) {}
46
47 /**
48 * Open a persistent PostgreSQL connection
49 * @link http://www.php.net/manual/en/function.pg-pconnect.php
50 * @param connection_string string <p>
51 * The connection_string can be empty to use all default parameters, or it
52 * can contain one or more parameter settings separated by whitespace.
53 * Each parameter setting is in the form keyword = value. Spaces around
54 * the equal sign are optional. To write an empty value or a value
55 * containing spaces, surround it with single quotes, e.g., keyword =
56 * 'a value'. Single quotes and backslashes within the value must be
57 * escaped with a backslash, i.e., \' and \\.
58 * </p>
59 * <p>
60 * The currently recognized parameter keywords are:
61 * host, hostaddr, port,
62 * dbname, user,
63 * password, connect_timeout,
64 * options, tty (ignored), sslmode,
65 * requiressl (deprecated in favor of sslmode), and
66 * service. Which of these arguments exist depends
67 * on your PostgreSQL version.
68 * </p>
69 * @param connect_type int[optional] <p>
70 * If PGSQL_CONNECT_FORCE_NEW is passed, then a new connection
71 * is created, even if the connection_string is identical to
72 * an existing connection.
73 * </p>
74 * @return resource PostgreSQL connection resource on success, false on failure.
75 */
76 function pg_pconnect ($connection_string, $connect_type = null) {}
77
78 /**
79 * Poll the status of an in-progress asynchronous PostgreSQL connection
80 attempt.
81 * @link http://www.php.net/manual/en/function.pg-connect-poll.php
82 * @param connection resource[optional] <p>
83 * PostgreSQL database connection resource.
84 * </p>
85 * @return int PGSQL_POLLING_FAILED,
86 * PGSQL_POLLING_READING,
87 * PGSQL_POLLING_WRITING,
88 * PGSQL_POLLING_OK, or
89 * PGSQL_POLLING_ACTIVE.
90 */
91 function pg_connect_poll ($connection = null) {}
92
93 /**
94 * Closes a PostgreSQL connection
95 * @link http://www.php.net/manual/en/function.pg-close.php
96 * @param connection resource[optional] <p>
97 * PostgreSQL database connection resource. When
98 * connection is not present, the default connection
99 * is used. The default connection is the last connection made by
100 * pg_connect or pg_pconnect.
101 * </p>
102 * @return bool Returns true on success, false on failure.
103 */
104 function pg_close ($connection = null) {}
105
106 /**
107 * Get connection status
108 * @link http://www.php.net/manual/en/function.pg-connection-status.php
109 * @param connection resource <p>
110 * PostgreSQL database connection resource.
111 * </p>
112 * @return int PGSQL_CONNECTION_OK or
113 * PGSQL_CONNECTION_BAD.
114 */
115 function pg_connection_status ($connection) {}
116
117 /**
118 * Get connection is busy or not
119 * @link http://www.php.net/manual/en/function.pg-connection-busy.php
120 * @param connection resource <p>
121 * PostgreSQL database connection resource.
122 * </p>
123 * @return bool true if the connection is busy, false otherwise.
124 */
125 function pg_connection_busy ($connection) {}
126
127 /**
128 * Reset connection (reconnect)
129 * @link http://www.php.net/manual/en/function.pg-connection-reset.php
130 * @param connection resource <p>
131 * PostgreSQL database connection resource.
132 * </p>
133 * @return bool Returns true on success, false on failure.
134 */
135 function pg_connection_reset ($connection) {}
136
137 /**
138 * Returns the host name associated with the connection
139 * @link http://www.php.net/manual/en/function.pg-host.php
140 * @param connection resource[optional] <p>
141 * PostgreSQL database connection resource. When
142 * connection is not present, the default connection
143 * is used. The default connection is the last connection made by
144 * pg_connect or pg_pconnect.
145 * </p>
146 * @return string A string containing the name of the host the
147 * connection is to, or false on error.
148 */
149 function pg_host ($connection = null) {}
150
151 /**
152 * Get the database name
153 * @link http://www.php.net/manual/en/function.pg-dbname.php
154 * @param connection resource[optional] <p>
155 * PostgreSQL database connection resource. When
156 * connection is not present, the default connection
157 * is used. The default connection is the last connection made by
158 * pg_connect or pg_pconnect.
159 * </p>
160 * @return string A string containing the name of the database the
161 * connection is to, or false on error.
162 */
163 function pg_dbname ($connection = null) {}
164
165 /**
166 * Return the port number associated with the connection
167 * @link http://www.php.net/manual/en/function.pg-port.php
168 * @param connection resource[optional] <p>
169 * PostgreSQL database connection resource. When
170 * connection is not present, the default connection
171 * is used. The default connection is the last connection made by
172 * pg_connect or pg_pconnect.
173 * </p>
174 * @return int An int containing the port number of the database
175 * server the connection is to,
176 * or false on error.
177 */
178 function pg_port ($connection = null) {}
179
180 /**
181 * Return the TTY name associated with the connection
182 * @link http://www.php.net/manual/en/function.pg-tty.php
183 * @param connection resource[optional] <p>
184 * PostgreSQL database connection resource. When
185 * connection is not present, the default connection
186 * is used. The default connection is the last connection made by
187 * pg_connect or pg_pconnect.
188 * </p>
189 * @return string A string containing the debug TTY of
190 * the connection, or false on error.
191 */
192 function pg_tty ($connection = null) {}
193
194 /**
195 * Get the options associated with the connection
196 * @link http://www.php.net/manual/en/function.pg-options.php
197 * @param connection resource[optional] <p>
198 * PostgreSQL database connection resource. When
199 * connection is not present, the default connection
200 * is used. The default connection is the last connection made by
201 * pg_connect or pg_pconnect.
202 * </p>
203 * @return string A string containing the connection
204 * options, or false on error.
205 */
206 function pg_options ($connection = null) {}
207
208 /**
209 * Returns an array with client, protocol and server version (when available)
210 * @link http://www.php.net/manual/en/function.pg-version.php
211 * @param connection resource[optional] <p>
212 * PostgreSQL database connection resource. When
213 * connection is not present, the default connection
214 * is used. The default connection is the last connection made by
215 * pg_connect or pg_pconnect.
216 * </p>
217 * @return array an array with client, protocol
218 * and server keys and values (if available). Returns
219 * false on error or invalid connection.
220 */
221 function pg_version ($connection = null) {}
222
223 /**
224 * Ping database connection
225 * @link http://www.php.net/manual/en/function.pg-ping.php
226 * @param connection resource[optional] <p>
227 * PostgreSQL database connection resource. When
228 * connection is not present, the default connection
229 * is used. The default connection is the last connection made by
230 * pg_connect or pg_pconnect.
231 * </p>
232 * @return bool Returns true on success, false on failure.
233 */
234 function pg_ping ($connection = null) {}
235
236 /**
237 * Looks up a current parameter setting of the server.
238 * @link http://www.php.net/manual/en/function.pg-parameter-status.php
239 * @param connection resource[optional] <p>
240 * PostgreSQL database connection resource. When
241 * connection is not present, the default connection
242 * is used. The default connection is the last connection made by
243 * pg_connect or pg_pconnect.
244 * </p>
245 * @param param_name string <p>
246 * Possible param_name values include server_version,
247 * server_encoding, client_encoding,
248 * is_superuser, session_authorization,
249 * DateStyle, TimeZone, and
250 * integer_datetimes.
251 * </p>
252 * @return string A string containing the value of the parameter, false on failure or invalid
253 * param_name.
254 */
255 function pg_parameter_status ($connection = null, $param_name) {}
256
257 /**
258 * Returns the current in-transaction status of the server.
259 * @link http://www.php.net/manual/en/function.pg-transaction-status.php
260 * @param connection resource <p>
261 * PostgreSQL database connection resource.
262 * </p>
263 * @return int The status can be PGSQL_TRANSACTION_IDLE (currently idle),
264 * PGSQL_TRANSACTION_ACTIVE (a command is in progress),
265 * PGSQL_TRANSACTION_INTRANS (idle, in a valid transaction block),
266 * or PGSQL_TRANSACTION_INERROR (idle, in a failed transaction block).
267 * PGSQL_TRANSACTION_UNKNOWN is reported if the connection is bad.
268 * PGSQL_TRANSACTION_ACTIVE is reported only when a query
269 * has been sent to the server and not yet completed.
270 */
271 function pg_transaction_status ($connection) {}
272
273 /**
274 * Execute a query
275 * @link http://www.php.net/manual/en/function.pg-query.php
276 * @param connection resource[optional] <p>
277 * PostgreSQL database connection resource. When
278 * connection is not present, the default connection
279 * is used. The default connection is the last connection made by
280 * pg_connect or pg_pconnect.
281 * </p>
282 * @param query string <p>
283 * The SQL statement or statements to be executed. When multiple statements are passed to the function,
284 * they are automatically executed as one transaction, unless there are explicit BEGIN/COMMIT commands
285 * included in the query string. However, using multiple transactions in one function call is not recommended.
286 * </p>
287 *
288 * <p>
289 * String interpolation of user-supplied data is extremely dangerous and is
290 * likely to lead to SQL
291 * injection vulnerabilities. In most cases
292 * pg_query_params should be preferred, passing
293 * user-supplied values as parameters rather than substituting them into
294 * the query string.
295 * </p>
296 * <p>
297 * Any user-supplied data substituted directly into a query string should
298 * be properly escaped.
299 * </p>
300 * @return resource A query result resource on success&return.falseforfailure;.
301 */
302 function pg_query ($connection = null, $query) {}
303
304 /**
305 * Submits a command to the server and waits for the result, with the ability to pass parameters separately from the SQL command text.
306 * @link http://www.php.net/manual/en/function.pg-query-params.php
307 * @param connection resource[optional] <p>
308 * PostgreSQL database connection resource. When
309 * connection is not present, the default connection
310 * is used. The default connection is the last connection made by
311 * pg_connect or pg_pconnect.
312 * </p>
313 * @param query string <p>
314 * The parameterized SQL statement. Must contain only a single statement.
315 * (multiple statements separated by semi-colons are not allowed.) If any parameters
316 * are used, they are referred to as $1, $2, etc.
317 * </p>
318 * <p>
319 * User-supplied values should always be passed as parameters, not
320 * interpolated into the query string, where they form possible
321 * SQL injection
322 * attack vectors and introduce bugs when handling data containing quotes.
323 * If for some reason you cannot use a parameter, ensure that interpolated
324 * values are properly escaped.
325 * </p>
326 * @param params array <p>
327 * An array of parameter values to substitute for the $1, $2, etc. placeholders
328 * in the original prepared query string. The number of elements in the array
329 * must match the number of placeholders.
330 * </p>
331 * <p>
332 * Values intended for bytea fields are not supported as
333 * parameters. Use pg_escape_bytea instead, or use the
334 * large object functions.
335 * </p>
336 * @return resource A query result resource on success&return.falseforfailure;.
337 */
338 function pg_query_params ($connection = null, $query, array $params) {}
339
340 /**
341 * Submits a request to create a prepared statement with the
342 given parameters, and waits for completion.
343 * @link http://www.php.net/manual/en/function.pg-prepare.php
344 * @param connection resource[optional] <p>
345 * PostgreSQL database connection resource. When
346 * connection is not present, the default connection
347 * is used. The default connection is the last connection made by
348 * pg_connect or pg_pconnect.
349 * </p>
350 * @param stmtname string <p>
351 * The name to give the prepared statement. Must be unique per-connection. If
352 * "" is specified, then an unnamed statement is created, overwriting any
353 * previously defined unnamed statement.
354 * </p>
355 * @param query string <p>
356 * The parameterized SQL statement. Must contain only a single statement.
357 * (multiple statements separated by semi-colons are not allowed.) If any parameters
358 * are used, they are referred to as $1, $2, etc.
359 * </p>
360 * @return resource A query result resource on success&return.falseforfailure;.
361 */
362 function pg_prepare ($connection = null, $stmtname, $query) {}
363
364 /**
365 * Sends a request to execute a prepared statement with given parameters, and waits for the result.
366 * @link http://www.php.net/manual/en/function.pg-execute.php
367 * @param connection resource[optional] <p>
368 * PostgreSQL database connection resource. When
369 * connection is not present, the default connection
370 * is used. The default connection is the last connection made by
371 * pg_connect or pg_pconnect.
372 * </p>
373 * @param stmtname string <p>
374 * The name of the prepared statement to execute. if
375 * "" is specified, then the unnamed statement is executed. The name must have
376 * been previously prepared using pg_prepare,
377 * pg_send_prepare or a PREPARE SQL
378 * command.
379 * </p>
380 * @param params array <p>
381 * An array of parameter values to substitute for the $1, $2, etc. placeholders
382 * in the original prepared query string. The number of elements in the array
383 * must match the number of placeholders.
384 * </p>
385 *
386 * <p>
387 * Elements are converted to strings by calling this function.
388 * </p>
389 * @return resource A query result resource on success&return.falseforfailure;.
390 */
391 function pg_execute ($connection = null, $stmtname, array $params) {}
392
393 /**
394 * Sends asynchronous query
395 * @link http://www.php.net/manual/en/function.pg-send-query.php
396 * @param connection resource <p>
397 * PostgreSQL database connection resource.
398 * </p>
399 * @param query string <p>
400 * The SQL statement or statements to be executed.
401 * </p>
402 * <p>
403 * Data inside the query should be properly escaped.
404 * </p>
405 * @return bool Returns true on success, false on failure.</p>
406 * <p>
407 * Use pg_get_result to determine the query result.
408 */
409 function pg_send_query ($connection, $query) {}
410
411 /**
412 * Submits a command and separate parameters to the server without waiting for the result(s).
413 * @link http://www.php.net/manual/en/function.pg-send-query-params.php
414 * @param connection resource <p>
415 * PostgreSQL database connection resource.
416 * </p>
417 * @param query string <p>
418 * The parameterized SQL statement. Must contain only a single statement.
419 * (multiple statements separated by semi-colons are not allowed.) If any parameters
420 * are used, they are referred to as $1, $2, etc.
421 * </p>
422 * @param params array <p>
423 * An array of parameter values to substitute for the $1, $2, etc. placeholders
424 * in the original prepared query string. The number of elements in the array
425 * must match the number of placeholders.
426 * </p>
427 * @return bool Returns true on success, false on failure.</p>
428 * <p>
429 * Use pg_get_result to determine the query result.
430 */
431 function pg_send_query_params ($connection, $query, array $params) {}
432
433 /**
434 * Sends a request to create a prepared statement with the given parameters, without waiting for completion.
435 * @link http://www.php.net/manual/en/function.pg-send-prepare.php
436 * @param connection resource <p>
437 * PostgreSQL database connection resource. When
438 * connection is not present, the default connection
439 * is used. The default connection is the last connection made by
440 * pg_connect or pg_pconnect.
441 * </p>
442 * @param stmtname string <p>
443 * The name to give the prepared statement. Must be unique per-connection. If
444 * "" is specified, then an unnamed statement is created, overwriting any
445 * previously defined unnamed statement.
446 * </p>
447 * @param query string <p>
448 * The parameterized SQL statement. Must contain only a single statement.
449 * (multiple statements separated by semi-colons are not allowed.) If any parameters
450 * are used, they are referred to as $1, $2, etc.
451 * </p>
452 * @return bool true on success, false on failure. Use pg_get_result
453 * to determine the query result.
454 */
455 function pg_send_prepare ($connection, $stmtname, $query) {}
456
457 /**
458 * Sends a request to execute a prepared statement with given parameters, without waiting for the result(s).
459 * @link http://www.php.net/manual/en/function.pg-send-execute.php
460 * @param connection resource <p>
461 * PostgreSQL database connection resource. When
462 * connection is not present, the default connection
463 * is used. The default connection is the last connection made by
464 * pg_connect or pg_pconnect.
465 * </p>
466 * @param stmtname string <p>
467 * The name of the prepared statement to execute. if
468 * "" is specified, then the unnamed statement is executed. The name must have
469 * been previously prepared using pg_prepare,
470 * pg_send_prepare or a PREPARE SQL
471 * command.
472 * </p>
473 * @param params array <p>
474 * An array of parameter values to substitute for the $1, $2, etc. placeholders
475 * in the original prepared query string. The number of elements in the array
476 * must match the number of placeholders.
477 * </p>
478 * @return bool true on success, false on failure. Use pg_get_result
479 * to determine the query result.
480 */
481 function pg_send_execute ($connection, $stmtname, array $params) {}
482
483 /**
484 * Cancel an asynchronous query
485 * @link http://www.php.net/manual/en/function.pg-cancel-query.php
486 * @param connection resource <p>
487 * PostgreSQL database connection resource.
488 * </p>
489 * @return bool Returns true on success, false on failure.
490 */
491 function pg_cancel_query ($connection) {}
492
493 /**
494 * Returns values from a result resource
495 * @link http://www.php.net/manual/en/function.pg-fetch-result.php
496 * @param result resource <p>
497 * PostgreSQL query result resource, returned by pg_query,
498 * pg_query_params or pg_execute
499 * (among others).
500 * </p>
501 * @param row int <p>
502 * Row number in result to fetch. Rows are numbered from 0 upwards. If omitted,
503 * next row is fetched.
504 * </p>
505 * @param field mixed <p>
506 * A string representing the name of the field (column) to fetch, otherwise
507 * an int representing the field number to fetch. Fields are
508 * numbered from 0 upwards.
509 * </p>
510 * @return string Boolean is returned as &quot;t&quot; or &quot;f&quot;. All
511 * other types, including arrays are returned as strings formatted
512 * in the same default PostgreSQL manner that you would see in the
513 * psql program. Database NULL
514 * values are returned as &null;.
515 * </p>
516 * <p>
517 * false is returned if row exceeds the number
518 * of rows in the set, or on any other error.
519 */
520 function pg_fetch_result ($result, $row, $field) {}
521
522 /**
523 * Get a row as an enumerated array
524 * @link http://www.php.net/manual/en/function.pg-fetch-row.php
525 * @param result resource <p>
526 * PostgreSQL query result resource, returned by pg_query,
527 * pg_query_params or pg_execute
528 * (among others).
529 * </p>
530 * @param row int[optional] <p>
531 * Row number in result to fetch. Rows are numbered from 0 upwards. If
532 * omitted or &null;, the next row is fetched.
533 * </p>
534 * @param result_type int[optional]
535 * @return array An array, indexed from 0 upwards, with each value
536 * represented as a string. Database NULL
537 * values are returned as &null;.
538 * </p>
539 * <p>
540 * false is returned if row exceeds the number
541 * of rows in the set, there are no more rows, or on any other error.
542 */
543 function pg_fetch_row ($result, $row = null, $result_type = null) {}
544
545 /**
546 * Fetch a row as an associative array
547 * @link http://www.php.net/manual/en/function.pg-fetch-assoc.php
548 * @param result resource <p>
549 * PostgreSQL query result resource, returned by pg_query,
550 * pg_query_params or pg_execute
551 * (among others).
552 * </p>
553 * @param row int[optional] <p>
554 * Row number in result to fetch. Rows are numbered from 0 upwards. If
555 * omitted or &null;, the next row is fetched.
556 * </p>
557 * @return array An array indexed associatively (by field name).
558 * Each value in the array is represented as a
559 * string. Database NULL
560 * values are returned as &null;.
561 * </p>
562 * <p>
563 * false is returned if row exceeds the number
564 * of rows in the set, there are no more rows, or on any other error.
565 */
566 function pg_fetch_assoc ($result, $row = null) {}
567
568 /**
569 * Fetch a row as an array
570 * @link http://www.php.net/manual/en/function.pg-fetch-array.php
571 * @param result resource <p>
572 * PostgreSQL query result resource, returned by pg_query,
573 * pg_query_params or pg_execute
574 * (among others).
575 * </p>
576 * @param row int[optional] <p>
577 * Row number in result to fetch. Rows are numbered from 0 upwards. If
578 * omitted or &null;, the next row is fetched.
579 * </p>
580 * @param result_type int[optional] <p>
581 * An optional parameter that controls
582 * how the returned array is indexed.
583 * result_type is a constant and can take the
584 * following values: PGSQL_ASSOC,
585 * PGSQL_NUM and PGSQL_BOTH.
586 * Using PGSQL_NUM, pg_fetch_array
587 * will return an array with numerical indices, using
588 * PGSQL_ASSOC it will return only associative indices
589 * while PGSQL_BOTH, the default, will return both
590 * numerical and associative indices.
591 * </p>
592 * @return array An array indexed numerically (beginning with 0) or
593 * associatively (indexed by field name), or both.
594 * Each value in the array is represented as a
595 * string. Database NULL
596 * values are returned as &null;.
597 * </p>
598 * <p>
599 * false is returned if row exceeds the number
600 * of rows in the set, there are no more rows, or on any other error.
601 */
602 function pg_fetch_array ($result, $row = null, $result_type = null) {}
603
604 /**
605 * Fetch a row as an object
606 * @link http://www.php.net/manual/en/function.pg-fetch-object.php
607 * @param result resource <p>
608 * PostgreSQL query result resource, returned by pg_query,
609 * pg_query_params or pg_execute
610 * (among others).
611 * </p>
612 * @param row int[optional] <p>
613 * Row number in result to fetch. Rows are numbered from 0 upwards. If
614 * omitted or &null;, the next row is fetched.
615 * </p>
616 * @param result_type int[optional] <p>
617 * Ignored and deprecated.
618 * </p>
619 * @return object An object with one attribute for each field
620 * name in the result. Database NULL
621 * values are returned as &null;.
622 * </p>
623 * <p>
624 * false is returned if row exceeds the number
625 * of rows in the set, there are no more rows, or on any other error.
626 */
627 function pg_fetch_object ($result, $row = null, $result_type = null) {}
628
629 /**
630 * Fetches all rows from a result as an array
631 * @link http://www.php.net/manual/en/function.pg-fetch-all.php
632 * @param result resource <p>
633 * PostgreSQL query result resource, returned by pg_query,
634 * pg_query_params or pg_execute
635 * (among others).
636 * </p>
637 * @return array An array with all rows in the result. Each row is an array
638 * of field values indexed by field name.
639 * </p>
640 * <p>
641 * false is returned if there are no rows in the result, or on any
642 * other error.
643 */
644 function pg_fetch_all ($result) {}
645
646 /**
647 * Fetches all rows in a particular result column as an array
648 * @link http://www.php.net/manual/en/function.pg-fetch-all-columns.php
649 * @param result resource <p>
650 * PostgreSQL query result resource, returned by pg_query,
651 * pg_query_params or pg_execute
652 * (among others).
653 * </p>
654 * @param column int[optional] <p>
655 * Column number, zero-based, to be retrieved from the result resource. Defaults
656 * to the first column if not specified.
657 * </p>
658 * @return array An array with all values in the result column.
659 * </p>
660 * <p>
661 * false is returned if column is larger than the number
662 * of columns in the result, or on any other error.
663 */
664 function pg_fetch_all_columns ($result, $column = null) {}
665
666 /**
667 * Returns number of affected records (tuples)
668 * @link http://www.php.net/manual/en/function.pg-affected-rows.php
669 * @param result resource <p>
670 * PostgreSQL query result resource, returned by pg_query,
671 * pg_query_params or pg_execute
672 * (among others).
673 * </p>
674 * @return int The number of rows affected by the query. If no tuple is
675 * affected, it will return 0.
676 */
677 function pg_affected_rows ($result) {}
678
679 /**
680 * Get asynchronous query result
681 * @link http://www.php.net/manual/en/function.pg-get-result.php
682 * @param connection resource[optional] <p>
683 * PostgreSQL database connection resource.
684 * </p>
685 * @return resource The result resource, or false if no more results are available.
686 */
687 function pg_get_result ($connection = null) {}
688
689 /**
690 * Set internal row offset in result resource
691 * @link http://www.php.net/manual/en/function.pg-result-seek.php
692 * @param result resource <p>
693 * PostgreSQL query result resource, returned by pg_query,
694 * pg_query_params or pg_execute
695 * (among others).
696 * </p>
697 * @param offset int <p>
698 * Row to move the internal offset to in the result resource.
699 * Rows are numbered starting from zero.
700 * </p>
701 * @return bool Returns true on success, false on failure.
702 */
703 function pg_result_seek ($result, $offset) {}
704
705 /**
706 * Get status of query result
707 * @link http://www.php.net/manual/en/function.pg-result-status.php
708 * @param result resource <p>
709 * PostgreSQL query result resource, returned by pg_query,
710 * pg_query_params or pg_execute
711 * (among others).
712 * </p>
713 * @param type int[optional] <p>
714 * Either PGSQL_STATUS_LONG to return the numeric status
715 * of the result, or PGSQL_STATUS_STRING
716 * to return the command tag of the result.
717 * If not specified, PGSQL_STATUS_LONG is the default.
718 * </p>
719 * @return mixed Possible return values are PGSQL_EMPTY_QUERY,
720 * PGSQL_COMMAND_OK, PGSQL_TUPLES_OK, PGSQL_COPY_OUT,
721 * PGSQL_COPY_IN, PGSQL_BAD_RESPONSE, PGSQL_NONFATAL_ERROR and
722 * PGSQL_FATAL_ERROR if PGSQL_STATUS_LONG is
723 * specified. Otherwise, a string containing the PostgreSQL command tag is returned.
724 */
725 function pg_result_status ($result, $type = null) {}
726
727 /**
728 * Free result memory
729 * @link http://www.php.net/manual/en/function.pg-free-result.php
730 * @param result resource <p>
731 * PostgreSQL query result resource, returned by pg_query,
732 * pg_query_params or pg_execute
733 * (among others).
734 * </p>
735 * @return bool Returns true on success, false on failure.
736 */
737 function pg_free_result ($result) {}
738
739 /**
740 * Returns the last row's OID
741 * @link http://www.php.net/manual/en/function.pg-last-oid.php
742 * @param result resource <p>
743 * PostgreSQL query result resource, returned by pg_query,
744 * pg_query_params or pg_execute
745 * (among others).
746 * </p>
747 * @return string A string containing the OID assigned to the most recently inserted
748 * row in the specified connection, or false on error or
749 * no available OID.
750 */
751 function pg_last_oid ($result) {}
752
753 /**
754 * Returns the number of rows in a result
755 * @link http://www.php.net/manual/en/function.pg-num-rows.php
756 * @param result resource <p>
757 * PostgreSQL query result resource, returned by pg_query,
758 * pg_query_params or pg_execute
759 * (among others).
760 * </p>
761 * @return int The number of rows in the result. On error, -1 is returned.
762 */
763 function pg_num_rows ($result) {}
764
765 /**
766 * Returns the number of fields in a result
767 * @link http://www.php.net/manual/en/function.pg-num-fields.php
768 * @param result resource <p>
769 * PostgreSQL query result resource, returned by pg_query,
770 * pg_query_params or pg_execute
771 * (among others).
772 * </p>
773 * @return int The number of fields (columns) in the result. On error, -1 is returned.
774 */
775 function pg_num_fields ($result) {}
776
777 /**
778 * Returns the name of a field
779 * @link http://www.php.net/manual/en/function.pg-field-name.php
780 * @param result resource <p>
781 * PostgreSQL query result resource, returned by pg_query,
782 * pg_query_params or pg_execute
783 * (among others).
784 * </p>
785 * @param field_number int <p>
786 * Field number, starting from 0.
787 * </p>
788 * @return string The field name, or false on error.
789 */
790 function pg_field_name ($result, $field_number) {}
791
792 /**
793 * Returns the field number of the named field
794 * @link http://www.php.net/manual/en/function.pg-field-num.php
795 * @param result resource <p>
796 * PostgreSQL query result resource, returned by pg_query,
797 * pg_query_params or pg_execute
798 * (among others).
799 * </p>
800 * @param field_name string <p>
801 * The name of the field.
802 * </p>
803 * @return int The field number (numbered from 0), or -1 on error.
804 */
805 function pg_field_num ($result, $field_name) {}
806
807 /**
808 * Returns the internal storage size of the named field
809 * @link http://www.php.net/manual/en/function.pg-field-size.php
810 * @param result resource <p>
811 * PostgreSQL query result resource, returned by pg_query,
812 * pg_query_params or pg_execute
813 * (among others).
814 * </p>
815 * @param field_number int <p>
816 * Field number, starting from 0.
817 * </p>
818 * @return int The internal field storage size (in bytes). -1 indicates a variable
819 * length field. false is returned on error.
820 */
821 function pg_field_size ($result, $field_number) {}
822
823 /**
824 * Returns the type name for the corresponding field number
825 * @link http://www.php.net/manual/en/function.pg-field-type.php
826 * @param result resource <p>
827 * PostgreSQL query result resource, returned by pg_query,
828 * pg_query_params or pg_execute
829 * (among others).
830 * </p>
831 * @param field_number int <p>
832 * Field number, starting from 0.
833 * </p>
834 * @return string A string containing the base name of the field's type, or false
835 * on error.
836 */
837 function pg_field_type ($result, $field_number) {}
838
839 /**
840 * Returns the type ID (OID) for the corresponding field number
841 * @link http://www.php.net/manual/en/function.pg-field-type-oid.php
842 * @param result resource <p>
843 * PostgreSQL query result resource, returned by pg_query,
844 * pg_query_params or pg_execute
845 * (among others).
846 * </p>
847 * @param field_number int <p>
848 * Field number, starting from 0.
849 * </p>
850 * @return int The OID of the field's base type. false is returned on error.
851 */
852 function pg_field_type_oid ($result, $field_number) {}
853
854 /**
855 * Returns the printed length
856 * @link http://www.php.net/manual/en/function.pg-field-prtlen.php
857 * @param result resource <p>
858 * PostgreSQL query result resource, returned by pg_query,
859 * pg_query_params or pg_execute
860 * (among others).
861 * </p>
862 * @param row_number int
863 * @param field_name_or_number mixed
864 * @return int The field printed length, or false on error.
865 */
866 function pg_field_prtlen ($result, $row_number, $field_name_or_number) {}
867
868 /**
869 * Test if a field is SQL <literal>NULL</literal>
870 * @link http://www.php.net/manual/en/function.pg-field-is-null.php
871 * @param result resource <p>
872 * PostgreSQL query result resource, returned by pg_query,
873 * pg_query_params or pg_execute
874 * (among others).
875 * </p>
876 * @param row int <p>
877 * Row number in result to fetch. Rows are numbered from 0 upwards. If omitted,
878 * current row is fetched.
879 * </p>
880 * @param field mixed <p>
881 * Field number (starting from 0) as an integer or
882 * the field name as a string.
883 * </p>
884 * @return int 1 if the field in the given row is SQL NULL, 0
885 * if not. false is returned if the row is out of range, or upon any other error.
886 */
887 function pg_field_is_null ($result, $row, $field) {}
888
889 /**
890 * Returns the name or oid of the tables field
891 * @link http://www.php.net/manual/en/function.pg-field-table.php
892 * @param result resource <p>
893 * PostgreSQL query result resource, returned by pg_query,
894 * pg_query_params or pg_execute
895 * (among others).
896 * </p>
897 * @param field_number int <p>
898 * Field number, starting from 0.
899 * </p>
900 * @param oid_only bool[optional] <p>
901 * By default the tables name that field belongs to is returned but
902 * if oid_only is set to true, then the
903 * oid will instead be returned.
904 * </p>
905 * @return mixed On success either the fields table name or oid. Or, false on failure.
906 */
907 function pg_field_table ($result, $field_number, $oid_only = null) {}
908
909 /**
910 * Gets SQL NOTIFY message
911 * @link http://www.php.net/manual/en/function.pg-get-notify.php
912 * @param connection resource <p>
913 * PostgreSQL database connection resource.
914 * </p>
915 * @param result_type int[optional] <p>
916 * An optional parameter that controls
917 * how the returned array is indexed.
918 * result_type is a constant and can take the
919 * following values: PGSQL_ASSOC,
920 * PGSQL_NUM and PGSQL_BOTH.
921 * Using PGSQL_NUM, pg_get_notify
922 * will return an array with numerical indices, using
923 * PGSQL_ASSOC it will return only associative indices
924 * while PGSQL_BOTH, the default, will return both
925 * numerical and associative indices.
926 * </p>
927 * @return array An array containing the NOTIFY message name and backend PID.
928 * Otherwise if no NOTIFY is waiting, then false is returned.
929 */
930 function pg_get_notify ($connection, $result_type = null) {}
931
932 /**
933 * Get a read only handle to the socket underlying a PostgreSQL connection
934 * @link http://www.php.net/manual/en/function.pg-socket.php
935 * @param connection resource <p>
936 * PostgreSQL database connection resource.
937 * </p>
938 * @return resource A socket resource on success&return.falseforfailure;.
939 */
940 function pg_socket ($connection) {}
941
942 /**
943 * Reads input on the connection
944 * @link http://www.php.net/manual/en/function.pg-consume-input.php
945 * @param connection resource <p>
946 * PostgreSQL database connection resource.
947 * </p>
948 * @return bool true if no error occurred, or false if there was an error. Note that
949 * true does not necessarily indicate that input was waiting to be read.
950 */
951 function pg_consume_input ($connection) {}
952
953 /**
954 * Flush outbound query data on the connection
955 * @link http://www.php.net/manual/en/function.pg-flush.php
956 * @param connection resource <p>
957 * PostgreSQL database connection resource.
958 * </p>
959 * @return mixed true if the flush was successful or no data was waiting to be
960 * flushed, 0 if part of the pending data was flushed but
961 * more remains&return.falseforfailure;.
962 */
963 function pg_flush ($connection) {}
964
965 /**
966 * Gets the backend's process ID
967 * @link http://www.php.net/manual/en/function.pg-get-pid.php
968 * @param connection resource <p>
969 * PostgreSQL database connection resource.
970 * </p>
971 * @return int The backend database process ID.
972 */
973 function pg_get_pid ($connection) {}
974
975 /**
976 * Get error message associated with result
977 * @link http://www.php.net/manual/en/function.pg-result-error.php
978 * @param result resource <p>
979 * PostgreSQL query result resource, returned by pg_query,
980 * pg_query_params or pg_execute
981 * (among others).
982 * </p>
983 * @return string a string. Returns empty string if there is no error. If there is an error associated with the
984 * result parameter, returns false.
985 */
986 function pg_result_error ($result) {}
987
988 /**
989 * Returns an individual field of an error report.
990 * @link http://www.php.net/manual/en/function.pg-result-error-field.php
991 * @param result resource <p>
992 * A PostgreSQL query result resource from a previously executed
993 * statement.
994 * </p>
995 * @param fieldcode int <p>
996 * Possible fieldcode values are: PGSQL_DIAG_SEVERITY,
997 * PGSQL_DIAG_SQLSTATE, PGSQL_DIAG_MESSAGE_PRIMARY,
998 * PGSQL_DIAG_MESSAGE_DETAIL,
999 * PGSQL_DIAG_MESSAGE_HINT, PGSQL_DIAG_STATEMENT_POSITION,
1000 * PGSQL_DIAG_INTERNAL_POSITION (PostgreSQL 8.0+ only),
1001 * PGSQL_DIAG_INTERNAL_QUERY (PostgreSQL 8.0+ only),
1002 * PGSQL_DIAG_CONTEXT, PGSQL_DIAG_SOURCE_FILE,
1003 * PGSQL_DIAG_SOURCE_LINE or
1004 * PGSQL_DIAG_SOURCE_FUNCTION.
1005 * </p>
1006 * @return string A string containing the contents of the error field, &null; if the field does not exist or false
1007 * on failure.
1008 */
1009 function pg_result_error_field ($result, $fieldcode) {}
1010
1011 /**
1012 * Get the last error message string of a connection
1013 * @link http://www.php.net/manual/en/function.pg-last-error.php
1014 * @param connection resource[optional] <p>
1015 * PostgreSQL database connection resource. When
1016 * connection is not present, the default connection
1017 * is used. The default connection is the last connection made by
1018 * pg_connect or pg_pconnect.
1019 * </p>
1020 * @return string A string containing the last error message on the
1021 * given connection, or false on error.
1022 */
1023 function pg_last_error ($connection = null) {}
1024
1025 /**
1026 * Returns the last notice message from PostgreSQL server
1027 * @link http://www.php.net/manual/en/function.pg-last-notice.php
1028 * @param connection resource <p>
1029 * PostgreSQL database connection resource.
1030 * </p>
1031 * @return string A string containing the last notice on the
1032 * given connection, or false on error.
1033 */
1034 function pg_last_notice ($connection) {}
1035
1036 /**
1037 * Send a NULL-terminated string to PostgreSQL backend
1038 * @link http://www.php.net/manual/en/function.pg-put-line.php
1039 * @param connection resource[optional] <p>
1040 * PostgreSQL database connection resource. When
1041 * connection is not present, the default connection
1042 * is used. The default connection is the last connection made by
1043 * pg_connect or pg_pconnect.
1044 * </p>
1045 * @param data string <p>
1046 * A line of text to be sent directly to the PostgreSQL backend. A NULL
1047 * terminator is added automatically.
1048 * </p>
1049 * @return bool Returns true on success, false on failure.
1050 */
1051 function pg_put_line ($connection = null, $data) {}
1052
1053 /**
1054 * Sync with PostgreSQL backend
1055 * @link http://www.php.net/manual/en/function.pg-end-copy.php
1056 * @param connection resource[optional] <p>
1057 * PostgreSQL database connection resource. When
1058 * connection is not present, the default connection
1059 * is used. The default connection is the last connection made by
1060 * pg_connect or pg_pconnect.
1061 * </p>
1062 * @return bool Returns true on success, false on failure.
1063 */
1064 function pg_end_copy ($connection = null) {}
1065
1066 /**
1067 * Copy a table to an array
1068 * @link http://www.php.net/manual/en/function.pg-copy-to.php
1069 * @param connection resource <p>
1070 * PostgreSQL database connection resource.
1071 * </p>
1072 * @param table_name string <p>
1073 * Name of the table from which to copy the data into rows.
1074 * </p>
1075 * @param delimiter string[optional] <p>
1076 * The token that separates values for each field in each element of
1077 * rows. Default is TAB.
1078 * </p>
1079 * @param null_as string[optional] <p>
1080 * How SQL NULL values are represented in the
1081 * rows. Default is \N ("\\N").
1082 * </p>
1083 * @return array An array with one element for each line of COPY data.
1084 * It returns false on failure.
1085 */
1086 function pg_copy_to ($connection, $table_name, $delimiter = null, $null_as = null) {}
1087
1088 /**
1089 * Insert records into a table from an array
1090 * @link http://www.php.net/manual/en/function.pg-copy-from.php
1091 * @param connection resource <p>
1092 * PostgreSQL database connection resource.
1093 * </p>
1094 * @param table_name string <p>
1095 * Name of the table into which to copy the rows.
1096 * </p>
1097 * @param rows array <p>
1098 * An array of data to be copied into table_name.
1099 * Each value in rows becomes a row in table_name.
1100 * Each value in rows should be a delimited string of the values
1101 * to insert into each field. Values should be linefeed terminated.
1102 * </p>
1103 * @param delimiter string[optional] <p>
1104 * The token that separates values for each field in each element of
1105 * rows. Default is TAB.
1106 * </p>
1107 * @param null_as string[optional] <p>
1108 * How SQL NULL values are represented in the
1109 * rows. Default is \N ("\\N").
1110 * </p>
1111 * @return bool Returns true on success, false on failure.
1112 */
1113 function pg_copy_from ($connection, $table_name, array $rows, $delimiter = null, $null_as = null) {}
1114
1115 /**
1116 * Enable tracing a PostgreSQL connection
1117 * @link http://www.php.net/manual/en/function.pg-trace.php
1118 * @param pathname string <p>
1119 * The full path and file name of the file in which to write the
1120 * trace log. Same as in fopen.
1121 * </p>
1122 * @param mode string[optional] <p>
1123 * An optional file access mode, same as for fopen.
1124 * </p>
1125 * @param connection resource[optional] <p>
1126 * PostgreSQL database connection resource. When
1127 * connection is not present, the default connection
1128 * is used. The default connection is the last connection made by
1129 * pg_connect or pg_pconnect.
1130 * </p>
1131 * @return bool Returns true on success, false on failure.
1132 */
1133 function pg_trace ($pathname, $mode = null, $connection = null) {}
1134
1135 /**
1136 * Disable tracing of a PostgreSQL connection
1137 * @link http://www.php.net/manual/en/function.pg-untrace.php
1138 * @param connection resource[optional] <p>
1139 * PostgreSQL database connection resource. When
1140 * connection is not present, the default connection
1141 * is used. The default connection is the last connection made by
1142 * pg_connect or pg_pconnect.
1143 * </p>
1144 * @return bool Always returns true.
1145 */
1146 function pg_untrace ($connection = null) {}
1147
1148 /**
1149 * Create a large object
1150 * @link http://www.php.net/manual/en/function.pg-lo-create.php
1151 * @param connection resource[optional] <p>
1152 * PostgreSQL database connection resource. When
1153 * connection is not present, the default connection
1154 * is used. The default connection is the last connection made by
1155 * pg_connect or pg_pconnect.
1156 * </p>
1157 * @param object_id mixed[optional] <p>
1158 * If an object_id is given the function
1159 * will try to create a large object with this id, else a free
1160 * object id is assigned by the server. The parameter
1161 * was added in PHP 5.3 and relies on functionality that first
1162 * appeared in PostgreSQL 8.1.
1163 * </p>
1164 * @return int A large object OID or false on error.
1165 */
1166 function pg_lo_create ($connection = null, $object_id = null) {}
1167
1168 /**
1169 * Delete a large object
1170 * @link http://www.php.net/manual/en/function.pg-lo-unlink.php
1171 * @param connection resource <p>
1172 * PostgreSQL database connection resource. When
1173 * connection is not present, the default connection
1174 * is used. The default connection is the last connection made by
1175 * pg_connect or pg_pconnect.
1176 * </p>
1177 * @param oid int <p>
1178 * The OID of the large object in the database.
1179 * </p>
1180 * @return bool Returns true on success, false on failure.
1181 */
1182 function pg_lo_unlink ($connection, $oid) {}
1183
1184 /**
1185 * Open a large object
1186 * @link http://www.php.net/manual/en/function.pg-lo-open.php
1187 * @param connection resource <p>
1188 * PostgreSQL database connection resource. When
1189 * connection is not present, the default connection
1190 * is used. The default connection is the last connection made by
1191 * pg_connect or pg_pconnect.
1192 * </p>
1193 * @param oid int <p>
1194 * The OID of the large object in the database.
1195 * </p>
1196 * @param mode string <p>
1197 * Can be either "r" for read-only, "w" for write only or "rw" for read and
1198 * write.
1199 * </p>
1200 * @return resource A large object resource or false on error.
1201 */
1202 function pg_lo_open ($connection, $oid, $mode) {}
1203
1204 /**
1205 * Close a large object
1206 * @link http://www.php.net/manual/en/function.pg-lo-close.php
1207 * @param large_object resource
1208 * @return bool Returns true on success, false on failure.
1209 */
1210 function pg_lo_close ($large_object) {}
1211
1212 /**
1213 * Read a large object
1214 * @link http://www.php.net/manual/en/function.pg-lo-read.php
1215 * @param large_object resource <p>
1216 * PostgreSQL large object (LOB) resource, returned by pg_lo_open.
1217 * </p>
1218 * @param len int[optional] <p>
1219 * An optional maximum number of bytes to return.
1220 * </p>
1221 * @return string A string containing len bytes from the
1222 * large object, or false on error.
1223 */
1224 function pg_lo_read ($large_object, $len = null) {}
1225
1226 /**
1227 * Write to a large object
1228 * @link http://www.php.net/manual/en/function.pg-lo-write.php
1229 * @param large_object resource <p>
1230 * PostgreSQL large object (LOB) resource, returned by pg_lo_open.
1231 * </p>
1232 * @param data string <p>
1233 * The data to be written to the large object. If len is
1234 * specified and is less than the length of data, only
1235 * len bytes will be written.
1236 * </p>
1237 * @param len int[optional] <p>
1238 * An optional maximum number of bytes to write. Must be greater than zero
1239 * and no greater than the length of data. Defaults to
1240 * the length of data.
1241 * </p>
1242 * @return int The number of bytes written to the large object, or false on error.
1243 */
1244 function pg_lo_write ($large_object, $data, $len = null) {}
1245
1246 /**
1247 * Reads an entire large object and send straight to browser
1248 * @link http://www.php.net/manual/en/function.pg-lo-read-all.php
1249 * @param large_object resource <p>
1250 * PostgreSQL large object (LOB) resource, returned by pg_lo_open.
1251 * </p>
1252 * @return int Number of bytes read or false on error.
1253 */
1254 function pg_lo_read_all ($large_object) {}
1255
1256 /**
1257 * Import a large object from file
1258 * @link http://www.php.net/manual/en/function.pg-lo-import.php
1259 * @param connection resource[optional] <p>
1260 * PostgreSQL database connection resource. When
1261 * connection is not present, the default connection
1262 * is used. The default connection is the last connection made by
1263 * pg_connect or pg_pconnect.
1264 * </p>
1265 * @param pathname string <p>
1266 * The full path and file name of the file on the client
1267 * filesystem from which to read the large object data.
1268 * </p>
1269 * @param object_id mixed[optional] <p>
1270 * If an object_id is given the function
1271 * will try to create a large object with this id, else a free
1272 * object id is assigned by the server. The parameter
1273 * was added in PHP 5.3 and relies on functionality that first
1274 * appeared in PostgreSQL 8.1.
1275 * </p>
1276 * @return int The OID of the newly created large object, or
1277 * false on failure.
1278 */
1279 function pg_lo_import ($connection = null, $pathname, $object_id = null) {}
1280
1281 /**
1282 * Export a large object to file
1283 * @link http://www.php.net/manual/en/function.pg-lo-export.php
1284 * @param connection resource[optional] <p>
1285 * PostgreSQL database connection resource. When
1286 * connection is not present, the default connection
1287 * is used. The default connection is the last connection made by
1288 * pg_connect or pg_pconnect.
1289 * </p>
1290 * @param oid int <p>
1291 * The OID of the large object in the database.
1292 * </p>
1293 * @param pathname string <p>
1294 * The full path and file name of the file in which to write the
1295 * large object on the client filesystem.
1296 * </p>
1297 * @return bool Returns true on success, false on failure.
1298 */
1299 function pg_lo_export ($connection = null, $oid, $pathname) {}
1300
1301 /**
1302 * Seeks position within a large object
1303 * @link http://www.php.net/manual/en/function.pg-lo-seek.php
1304 * @param large_object resource <p>
1305 * PostgreSQL large object (LOB) resource, returned by pg_lo_open.
1306 * </p>
1307 * @param offset int <p>
1308 * The number of bytes to seek.
1309 * </p>
1310 * @param whence int[optional] <p>
1311 * One of the constants PGSQL_SEEK_SET (seek from object start),
1312 * PGSQL_SEEK_CUR (seek from current position)
1313 * or PGSQL_SEEK_END (seek from object end) .
1314 * </p>
1315 * @return bool Returns true on success, false on failure.
1316 */
1317 function pg_lo_seek ($large_object, $offset, $whence = null) {}
1318
1319 /**
1320 * Returns current seek position a of large object
1321 * @link http://www.php.net/manual/en/function.pg-lo-tell.php
1322 * @param large_object resource <p>
1323 * PostgreSQL large object (LOB) resource, returned by pg_lo_open.
1324 * </p>
1325 * @return int The current seek offset (in number of bytes) from the beginning of the large
1326 * object. If there is an error, the return value is negative.
1327 */
1328 function pg_lo_tell ($large_object) {}
1329
1330 /**
1331 * Truncates a large object
1332 * @link http://www.php.net/manual/en/function.pg-lo-truncate.php
1333 * @param large_object resource <p>
1334 * PostgreSQL large object (LOB) resource, returned by pg_lo_open.
1335 * </p>
1336 * @param size int <p>
1337 * The number of bytes to truncate.
1338 * </p>
1339 * @return bool Returns true on success, false on failure.
1340 */
1341 function pg_lo_truncate ($large_object, $size) {}
1342
1343 /**
1344 * Escape a string for query
1345 * @link http://www.php.net/manual/en/function.pg-escape-string.php
1346 * @param connection resource[optional] <p>
1347 * PostgreSQL database connection resource. When
1348 * connection is not present, the default connection
1349 * is used. The default connection is the last connection made by
1350 * pg_connect or pg_pconnect.
1351 * </p>
1352 * @param data string <p>
1353 * A string containing text to be escaped.
1354 * </p>
1355 * @return string A string containing the escaped data.
1356 */
1357 function pg_escape_string ($connection = null, $data) {}
1358
1359 /**
1360 * Escape a string for insertion into a bytea field
1361 * @link http://www.php.net/manual/en/function.pg-escape-bytea.php
1362 * @param connection resource[optional] <p>
1363 * PostgreSQL database connection resource. When
1364 * connection is not present, the default connection
1365 * is used. The default connection is the last connection made by
1366 * pg_connect or pg_pconnect.
1367 * </p>
1368 * @param data string <p>
1369 * A string containing text or binary data to be inserted into a bytea
1370 * column.
1371 * </p>
1372 * @return string A string containing the escaped data.
1373 */
1374 function pg_escape_bytea ($connection = null, $data) {}
1375
1376 /**
1377 * Unescape binary for bytea type
1378 * @link http://www.php.net/manual/en/function.pg-unescape-bytea.php
1379 * @param data string <p>
1380 * A string containing PostgreSQL bytea data to be converted into
1381 * a PHP binary string.
1382 * </p>
1383 * @return string A string containing the unescaped data.
1384 */
1385 function pg_unescape_bytea ($data) {}
1386
1387 /**
1388 * Escape a literal for insertion into a text field
1389 * @link http://www.php.net/manual/en/function.pg-escape-literal.php
1390 * @param connection resource[optional] <p>
1391 * PostgreSQL database connection resource. When
1392 * connection is not present, the default connection
1393 * is used. The default connection is the last connection made by
1394 * pg_connect or pg_pconnect.
1395 * </p>
1396 * @param data string <p>
1397 * A string containing text to be escaped.
1398 * </p>
1399 * @return string A string containing the escaped data.
1400 */
1401 function pg_escape_literal ($connection = null, $data) {}
1402
1403 /**
1404 * Escape a identifier for insertion into a text field
1405 * @link http://www.php.net/manual/en/function.pg-escape-identifier.php
1406 * @param connection resource[optional] <p>
1407 * PostgreSQL database connection resource. When
1408 * connection is not present, the default connection
1409 * is used. The default connection is the last connection made by
1410 * pg_connect or pg_pconnect.
1411 * </p>
1412 * @param data string <p>
1413 * A string containing text to be escaped.
1414 * </p>
1415 * @return string A string containing the escaped data.
1416 */
1417 function pg_escape_identifier ($connection = null, $data) {}
1418
1419 /**
1420 * Determines the verbosity of messages returned by <function>pg_last_error</function>
1421 and <function>pg_result_error</function>.
1422 * @link http://www.php.net/manual/en/function.pg-set-error-verbosity.php
1423 * @param connection resource[optional] <p>
1424 * PostgreSQL database connection resource. When
1425 * connection is not present, the default connection
1426 * is used. The default connection is the last connection made by
1427 * pg_connect or pg_pconnect.
1428 * </p>
1429 * @param verbosity int <p>
1430 * The required verbosity: PGSQL_ERRORS_TERSE,
1431 * PGSQL_ERRORS_DEFAULT
1432 * or PGSQL_ERRORS_VERBOSE.
1433 * </p>
1434 * @return int The previous verbosity level: PGSQL_ERRORS_TERSE,
1435 * PGSQL_ERRORS_DEFAULT
1436 * or PGSQL_ERRORS_VERBOSE.
1437 */
1438 function pg_set_error_verbosity ($connection = null, $verbosity) {}
1439
1440 /**
1441 * Gets the client encoding
1442 * @link http://www.php.net/manual/en/function.pg-client-encoding.php
1443 * @param connection resource[optional] <p>
1444 * PostgreSQL database connection resource. When
1445 * connection is not present, the default connection
1446 * is used. The default connection is the last connection made by
1447 * pg_connect or pg_pconnect.
1448 * </p>
1449 * @return string The client encoding, or false on error.
1450 */
1451 function pg_client_encoding ($connection = null) {}
1452
1453 /**
1454 * Set the client encoding
1455 * @link http://www.php.net/manual/en/function.pg-set-client-encoding.php
1456 * @param connection resource[optional] <p>
1457 * PostgreSQL database connection resource. When
1458 * connection is not present, the default connection
1459 * is used. The default connection is the last connection made by
1460 * pg_connect or pg_pconnect.
1461 * </p>
1462 * @param encoding string <p>
1463 * The required client encoding. One of SQL_ASCII, EUC_JP,
1464 * EUC_CN, EUC_KR, EUC_TW,
1465 * UNICODE, MULE_INTERNAL, LATINX (X=1...9),
1466 * KOI8, WIN, ALT, SJIS,
1467 * BIG5 or WIN1250.
1468 * </p>
1469 * <p>
1470 * The exact list of available encodings depends on your PostgreSQL version, so check your
1471 * PostgreSQL manual for a more specific list.
1472 * </p>
1473 * @return int 0 on success or -1 on error.
1474 */
1475 function pg_set_client_encoding ($connection = null, $encoding) {}
1476
1477 /**
1478 * Get meta data for table
1479 * @link http://www.php.net/manual/en/function.pg-meta-data.php
1480 * @param connection resource <p>
1481 * PostgreSQL database connection resource.
1482 * </p>
1483 * @param table_name string <p>
1484 * The name of the table.
1485 * </p>
1486 * @param extended bool[optional] <p>
1487 * Flag for returning extended meta data. Default to false.
1488 * </p>
1489 * @return array An array of the table definition, or false on error.
1490 */
1491 function pg_meta_data ($connection, $table_name, $extended = null) {}
1492
1493 /**
1494 * Convert associative array values into suitable for SQL statement
1495 * @link http://www.php.net/manual/en/function.pg-convert.php
1496 * @param connection resource <p>
1497 * PostgreSQL database connection resource.
1498 * </p>
1499 * @param table_name string <p>
1500 * Name of the table against which to convert types.
1501 * </p>
1502 * @param assoc_array array <p>
1503 * Data to be converted.
1504 * </p>
1505 * @param options int[optional] <p>
1506 * Any number of PGSQL_CONV_IGNORE_DEFAULT,
1507 * PGSQL_CONV_FORCE_NULL or
1508 * PGSQL_CONV_IGNORE_NOT_NULL, combined.
1509 * </p>
1510 * @return array An array of converted values, or false on error.
1511 */
1512 function pg_convert ($connection, $table_name, array $assoc_array, $options = null) {}
1513
1514 /**
1515 * Insert array into table
1516 * @link http://www.php.net/manual/en/function.pg-insert.php
1517 * @param connection resource <p>
1518 * PostgreSQL database connection resource.
1519 * </p>
1520 * @param table_name string <p>
1521 * Name of the table into which to insert rows. The table table_name must at least
1522 * have as many columns as assoc_array has elements.
1523 * </p>
1524 * @param assoc_array array <p>
1525 * An array whose keys are field names in the table table_name,
1526 * and whose values are the values of those fields that are to be inserted.
1527 * </p>
1528 * @param options int[optional] <p>
1529 * Any number of PGSQL_CONV_OPTS,
1530 * PGSQL_DML_NO_CONV,
1531 * PGSQL_DML_ESCAPE,
1532 * PGSQL_DML_EXEC,
1533 * PGSQL_DML_ASYNC or
1534 * PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the
1535 * options then query string is returned. When PGSQL_DML_NO_CONV
1536 * or PGSQL_DML_ESCAPE is set, it does not call pg_convert internally.
1537 * </p>
1538 * @return mixed Returns true on success, false on failure. Returns string if PGSQL_DML_STRING is passed
1539 * via options.
1540 */
1541 function pg_insert ($connection, $table_name, array $assoc_array, $options = null) {}
1542
1543 /**
1544 * Update table
1545 * @link http://www.php.net/manual/en/function.pg-update.php
1546 * @param connection resource <p>
1547 * PostgreSQL database connection resource.
1548 * </p>
1549 * @param table_name string <p>
1550 * Name of the table into which to update rows.
1551 * </p>
1552 * @param data array <p>
1553 * An array whose keys are field names in the table table_name,
1554 * and whose values are what matched rows are to be updated to.
1555 * </p>
1556 * @param condition array <p>
1557 * An array whose keys are field names in the table table_name,
1558 * and whose values are the conditions that a row must meet to be updated.
1559 * </p>
1560 * @param options int[optional] <p>
1561 * Any number of PGSQL_CONV_FORCE_NULL,
1562 * PGSQL_DML_NO_CONV,
1563 * PGSQL_DML_ESCAPE,
1564 * PGSQL_DML_EXEC,
1565 * PGSQL_DML_ASYNC or
1566 * PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the
1567 * options then query string is returned. When PGSQL_DML_NO_CONV
1568 * or PGSQL_DML_ESCAPE is set, it does not call pg_convert internally.
1569 * </p>
1570 * @return mixed Returns true on success, false on failure. Returns string if PGSQL_DML_STRING is passed
1571 * via options.
1572 */
1573 function pg_update ($connection, $table_name, array $data, array $condition, $options = null) {}
1574
1575 /**
1576 * Deletes records
1577 * @link http://www.php.net/manual/en/function.pg-delete.php
1578 * @param connection resource <p>
1579 * PostgreSQL database connection resource.
1580 * </p>
1581 * @param table_name string <p>
1582 * Name of the table from which to delete rows.
1583 * </p>
1584 * @param assoc_array array <p>
1585 * An array whose keys are field names in the table table_name,
1586 * and whose values are the values of those fields that are to be deleted.
1587 * </p>
1588 * @param options int[optional] <p>
1589 * Any number of PGSQL_CONV_FORCE_NULL,
1590 * PGSQL_DML_NO_CONV,
1591 * PGSQL_DML_ESCAPE,
1592 * PGSQL_DML_EXEC,
1593 * PGSQL_DML_ASYNC or
1594 * PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the
1595 * options then query string is returned. When PGSQL_DML_NO_CONV
1596 * or PGSQL_DML_ESCAPE is set, it does not call pg_convert internally.
1597 * </p>
1598 * @return mixed Returns true on success, false on failure. Returns string if PGSQL_DML_STRING is passed
1599 * via options.
1600 */
1601 function pg_delete ($connection, $table_name, array $assoc_array, $options = null) {}
1602
1603 /**
1604 * Select records
1605 * @link http://www.php.net/manual/en/function.pg-select.php
1606 * @param connection resource <p>
1607 * PostgreSQL database connection resource.
1608 * </p>
1609 * @param table_name string <p>
1610 * Name of the table from which to select rows.
1611 * </p>
1612 * @param assoc_array array <p>
1613 * An array whose keys are field names in the table table_name,
1614 * and whose values are the conditions that a row must meet to be retrieved.
1615 * </p>
1616 * @param options int[optional] <p>
1617 * Any number of PGSQL_CONV_FORCE_NULL,
1618 * PGSQL_DML_NO_CONV,
1619 * PGSQL_DML_ESCAPE,
1620 * PGSQL_DML_EXEC,
1621 * PGSQL_DML_ASYNC or
1622 * PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the
1623 * options then query string is returned. When PGSQL_DML_NO_CONV
1624 * or PGSQL_DML_ESCAPE is set, it does not call pg_convert internally.
1625 * </p>
1626 * @return mixed Returns true on success, false on failure. Returns string if PGSQL_DML_STRING is passed
1627 * via options.
1628 */
1629 function pg_select ($connection, $table_name, array $assoc_array, $options = null) {}
1630
1631 /**
1632 * @param connection[optional]
1633 * @param query[optional]
1634 */
1635 function pg_exec ($connection, $query) {}
1636
1637 /**
1638 * @param result
1639 */
1640 function pg_getlastoid ($result) {}
1641
1642 /**
1643 * @param result
1644 */
1645 function pg_cmdtuples ($result) {}
1646
1647 /**
1648 * @param connection[optional]
1649 */
1650 function pg_errormessage ($connection) {}
1651
1652 /**
1653 * @param result
1654 */
1655 function pg_numrows ($result) {}
1656
1657 /**
1658 * @param result
1659 */
1660 function pg_numfields ($result) {}
1661
1662 /**
1663 * @param result
1664 * @param field_number
1665 */
1666 function pg_fieldname ($result, $field_number) {}
1667
1668 /**
1669 * @param result
1670 * @param field_number
1671 */
1672 function pg_fieldsize ($result, $field_number) {}
1673
1674 /**
1675 * @param result
1676 * @param field_number
1677 */
1678 function pg_fieldtype ($result, $field_number) {}
1679
1680 /**
1681 * @param result
1682 * @param field_name
1683 */
1684 function pg_fieldnum ($result, $field_name) {}
1685
1686 /**
1687 * @param result
1688 * @param row[optional]
1689 * @param field_name_or_number[optional]
1690 */
1691 function pg_fieldprtlen ($result, $row, $field_name_or_number) {}
1692
1693 /**
1694 * @param result
1695 * @param row[optional]
1696 * @param field_name_or_number[optional]
1697 */
1698 function pg_fieldisnull ($result, $row, $field_name_or_number) {}
1699
1700 /**
1701 * @param result
1702 */
1703 function pg_freeresult ($result) {}
1704
1705 /**
1706 * @param connection
1707 */
1708 function pg_result ($connection) {}
1709
1710 /**
1711 * @param large_object
1712 */
1713 function pg_loreadall ($large_object) {}
1714
1715 /**
1716 * @param connection[optional]
1717 * @param large_object_id[optional]
1718 */
1719 function pg_locreate ($connection, $large_object_id) {}
1720
1721 /**
1722 * @param connection[optional]
1723 * @param large_object_oid[optional]
1724 */
1725 function pg_lounlink ($connection, $large_object_oid) {}
1726
1727 /**
1728 * @param connection[optional]
1729 * @param large_object_oid[optional]
1730 * @param mode[optional]
1731 */
1732 function pg_loopen ($connection, $large_object_oid, $mode) {}
1733
1734 /**
1735 * @param large_object
1736 */
1737 function pg_loclose ($large_object) {}
1738
1739 /**
1740 * @param large_object
1741 * @param len[optional]
1742 */
1743 function pg_loread ($large_object, $len) {}
1744
1745 /**
1746 * @param large_object
1747 * @param buf
1748 * @param len[optional]
1749 */
1750 function pg_lowrite ($large_object, $buf, $len) {}
1751
1752 /**
1753 * @param connection[optional]
1754 * @param filename[optional]
1755 * @param large_object_oid[optional]
1756 */
1757 function pg_loimport ($connection, $filename, $large_object_oid) {}
1758
1759 /**
1760 * @param connection[optional]
1761 * @param objoid[optional]
1762 * @param filename[optional]
1763 */
1764 function pg_loexport ($connection, $objoid, $filename) {}
1765
1766 /**
1767 * @param connection[optional]
1768 */
1769 function pg_clientencoding ($connection) {}
1770
1771 /**
1772 * @param connection[optional]
1773 * @param encoding[optional]
1774 */
1775 function pg_setclientencoding ($connection, $encoding) {}
1776
1777
1778 /**
1779 * Short libpq version that contains only numbers and dots.
1780 * @link http://www.php.net/manual/en/pgsql.constants.php
1781 */
1782 define ('PGSQL_LIBPQ_VERSION', "8.4.17");
1783
1784 /**
1785 * Long libpq version that includes compiler information.
1786 * @link http://www.php.net/manual/en/pgsql.constants.php
1787 */
1788 define ('PGSQL_LIBPQ_VERSION_STR', "PostgreSQL 8.4.17 on x86_64-unknown-linux-gnu, compiled by GCC gcc (Debian 4.4.5-8) 4.4.5, 64-bit");
1789
1790 /**
1791 * Passed to pg_connect to force the creation of a new connection,
1792 * rather than re-using an existing identical connection.
1793 * @link http://www.php.net/manual/en/pgsql.constants.php
1794 */
1795 define ('PGSQL_CONNECT_FORCE_NEW', 2);
1796
1797 /**
1798 * Passed to pg_connect to create an asynchronous
1799 * connection. Added in PHP 5.6.0.
1800 * @link http://www.php.net/manual/en/pgsql.constants.php
1801 */
1802 define ('PGSQL_CONNECT_ASYNC', 4);
1803
1804 /**
1805 * Passed to pg_fetch_array. Return an associative array of field
1806 * names and values.
1807 * @link http://www.php.net/manual/en/pgsql.constants.php
1808 */
1809 define ('PGSQL_ASSOC', 1);
1810
1811 /**
1812 * Passed to pg_fetch_array. Return a numerically indexed array of field
1813 * numbers and values.
1814 * @link http://www.php.net/manual/en/pgsql.constants.php
1815 */
1816 define ('PGSQL_NUM', 2);
1817
1818 /**
1819 * Passed to pg_fetch_array. Return an array of field values
1820 * that is both numerically indexed (by field number) and associated (by field name).
1821 * @link http://www.php.net/manual/en/pgsql.constants.php
1822 */
1823 define ('PGSQL_BOTH', 3);
1824
1825 /**
1826 * Returned by pg_connection_status indicating that the database
1827 * connection is in an invalid state.
1828 * @link http://www.php.net/manual/en/pgsql.constants.php
1829 */
1830 define ('PGSQL_CONNECTION_BAD', 1);
1831
1832 /**
1833 * Returned by pg_connection_status indicating that the database
1834 * connection is in a valid state.
1835 * @link http://www.php.net/manual/en/pgsql.constants.php
1836 */
1837 define ('PGSQL_CONNECTION_OK', 0);
1838 define ('PGSQL_CONNECTION_STARTED', 2);
1839 define ('PGSQL_CONNECTION_MADE', 3);
1840 define ('PGSQL_CONNECTION_AWAITING_RESPONSE', 4);
1841 define ('PGSQL_CONNECTION_AUTH_OK', 5);
1842 define ('PGSQL_CONNECTION_SETENV', 6);
1843
1844 /**
1845 * Returned by pg_connect_poll to indicate that the
1846 * connection attempt failed.
1847 * @link http://www.php.net/manual/en/pgsql.constants.php
1848 */
1849 define ('PGSQL_POLLING_FAILED', 0);
1850
1851 /**
1852 * Returned by pg_connect_poll to indicate that the
1853 * connection is waiting for the PostgreSQL socket to be readable.
1854 * @link http://www.php.net/manual/en/pgsql.constants.php
1855 */
1856 define ('PGSQL_POLLING_READING', 1);
1857
1858 /**
1859 * Returned by pg_connect_poll to indicate that the
1860 * connection is waiting for the PostgreSQL socket to be writable.
1861 * @link http://www.php.net/manual/en/pgsql.constants.php
1862 */
1863 define ('PGSQL_POLLING_WRITING', 2);
1864
1865 /**
1866 * Returned by pg_connect_poll to indicate that the
1867 * connection is ready to be used.
1868 * @link http://www.php.net/manual/en/pgsql.constants.php
1869 */
1870 define ('PGSQL_POLLING_OK', 3);
1871
1872 /**
1873 * Returned by pg_connect_poll to indicate that the
1874 * connection is currently active.
1875 * @link http://www.php.net/manual/en/pgsql.constants.php
1876 */
1877 define ('PGSQL_POLLING_ACTIVE', 4);
1878
1879 /**
1880 * Returned by pg_transaction_status. Connection is
1881 * currently idle, not in a transaction.
1882 * @link http://www.php.net/manual/en/pgsql.constants.php
1883 */
1884 define ('PGSQL_TRANSACTION_IDLE', 0);
1885
1886 /**
1887 * Returned by pg_transaction_status. A command
1888 * is in progress on the connection. A query has been sent via the connection
1889 * and not yet completed.
1890 * @link http://www.php.net/manual/en/pgsql.constants.php
1891 */
1892 define ('PGSQL_TRANSACTION_ACTIVE', 1);
1893
1894 /**
1895 * Returned by pg_transaction_status. The connection
1896 * is idle, in a transaction block.
1897 * @link http://www.php.net/manual/en/pgsql.constants.php
1898 */
1899 define ('PGSQL_TRANSACTION_INTRANS', 2);
1900
1901 /**
1902 * Returned by pg_transaction_status. The connection
1903 * is idle, in a failed transaction block.
1904 * @link http://www.php.net/manual/en/pgsql.constants.php
1905 */
1906 define ('PGSQL_TRANSACTION_INERROR', 3);
1907
1908 /**
1909 * Returned by pg_transaction_status. The connection
1910 * is bad.
1911 * @link http://www.php.net/manual/en/pgsql.constants.php
1912 */
1913 define ('PGSQL_TRANSACTION_UNKNOWN', 4);
1914
1915 /**
1916 * Passed to pg_set_error_verbosity.
1917 * Specified that returned messages include severity, primary text,
1918 * and position only; this will normally fit on a single line.
1919 * @link http://www.php.net/manual/en/pgsql.constants.php
1920 */
1921 define ('PGSQL_ERRORS_TERSE', 0);
1922
1923 /**
1924 * Passed to pg_set_error_verbosity.
1925 * The default mode produces messages that include the above
1926 * plus any detail, hint, or context fields (these may span
1927 * multiple lines).
1928 * @link http://www.php.net/manual/en/pgsql.constants.php
1929 */
1930 define ('PGSQL_ERRORS_DEFAULT', 1);
1931
1932 /**
1933 * Passed to pg_set_error_verbosity.
1934 * The verbose mode includes all available fields.
1935 * @link http://www.php.net/manual/en/pgsql.constants.php
1936 */
1937 define ('PGSQL_ERRORS_VERBOSE', 2);
1938
1939 /**
1940 * Passed to pg_lo_seek. Seek operation is to begin
1941 * from the start of the object.
1942 * @link http://www.php.net/manual/en/pgsql.constants.php
1943 */
1944 define ('PGSQL_SEEK_SET', 0);
1945
1946 /**
1947 * Passed to pg_lo_seek. Seek operation is to begin
1948 * from the current position.
1949 * @link http://www.php.net/manual/en/pgsql.constants.php
1950 */
1951 define ('PGSQL_SEEK_CUR', 1);
1952
1953 /**
1954 * Passed to pg_lo_seek. Seek operation is to begin
1955 * from the end of the object.
1956 * @link http://www.php.net/manual/en/pgsql.constants.php
1957 */
1958 define ('PGSQL_SEEK_END', 2);
1959
1960 /**
1961 * Passed to pg_result_status. Indicates that
1962 * numerical result code is desired.
1963 * @link http://www.php.net/manual/en/pgsql.constants.php
1964 */
1965 define ('PGSQL_STATUS_LONG', 1);
1966
1967 /**
1968 * Passed to pg_result_status. Indicates that
1969 * textual result command tag is desired.
1970 * @link http://www.php.net/manual/en/pgsql.constants.php
1971 */
1972 define ('PGSQL_STATUS_STRING', 2);
1973
1974 /**
1975 * Returned by pg_result_status. The string sent to the server
1976 * was empty.
1977 * @link http://www.php.net/manual/en/pgsql.constants.php
1978 */
1979 define ('PGSQL_EMPTY_QUERY', 0);
1980
1981 /**
1982 * Returned by pg_result_status. Successful completion of a
1983 * command returning no data.
1984 * @link http://www.php.net/manual/en/pgsql.constants.php
1985 */
1986 define ('PGSQL_COMMAND_OK', 1);
1987
1988 /**
1989 * Returned by pg_result_status. Successful completion of a command
1990 * returning data (such as a SELECT or SHOW).
1991 * @link http://www.php.net/manual/en/pgsql.constants.php
1992 */
1993 define ('PGSQL_TUPLES_OK', 2);
1994
1995 /**
1996 * Returned by pg_result_status. Copy Out (from server) data
1997 * transfer started.
1998 * @link http://www.php.net/manual/en/pgsql.constants.php
1999 */
2000 define ('PGSQL_COPY_OUT', 3);
2001
2002 /**
2003 * Returned by pg_result_status. Copy In (to server) data
2004 * transfer started.
2005 * @link http://www.php.net/manual/en/pgsql.constants.php
2006 */
2007 define ('PGSQL_COPY_IN', 4);
2008
2009 /**
2010 * Returned by pg_result_status. The server's response
2011 * was not understood.
2012 * @link http://www.php.net/manual/en/pgsql.constants.php
2013 */
2014 define ('PGSQL_BAD_RESPONSE', 5);
2015
2016 /**
2017 * Returned by pg_result_status. A nonfatal error
2018 * (a notice or warning) occurred.
2019 * @link http://www.php.net/manual/en/pgsql.constants.php
2020 */
2021 define ('PGSQL_NONFATAL_ERROR', 6);
2022
2023 /**
2024 * Returned by pg_result_status. A fatal error
2025 * occurred.
2026 * @link http://www.php.net/manual/en/pgsql.constants.php
2027 */
2028 define ('PGSQL_FATAL_ERROR', 7);
2029
2030 /**
2031 * Passed to pg_result_error_field.
2032 * The severity; the field contents are ERROR,
2033 * FATAL, or PANIC (in an error message), or
2034 * WARNING, NOTICE, DEBUG,
2035 * INFO, or LOG (in a notice message), or a localized
2036 * translation of one of these. Always present.
2037 * @link http://www.php.net/manual/en/pgsql.constants.php
2038 */
2039 define ('PGSQL_DIAG_SEVERITY', 83);
2040
2041 /**
2042 * Passed to pg_result_error_field.
2043 * The SQLSTATE code for the error. The SQLSTATE code identifies the type of error
2044 * that has occurred; it can be used by front-end applications to perform specific
2045 * operations (such as error handling) in response to a particular database error.
2046 * This field is not localizable, and is always present.
2047 * @link http://www.php.net/manual/en/pgsql.constants.php
2048 */
2049 define ('PGSQL_DIAG_SQLSTATE', 67);
2050
2051 /**
2052 * Passed to pg_result_error_field.
2053 * The primary human-readable error message (typically one line). Always present.
2054 * @link http://www.php.net/manual/en/pgsql.constants.php
2055 */
2056 define ('PGSQL_DIAG_MESSAGE_PRIMARY', 77);
2057
2058 /**
2059 * Passed to pg_result_error_field.
2060 * Detail: an optional secondary error message carrying more detail about the problem. May run to multiple lines.
2061 * @link http://www.php.net/manual/en/pgsql.constants.php
2062 */
2063 define ('PGSQL_DIAG_MESSAGE_DETAIL', 68);
2064
2065 /**
2066 * Passed to pg_result_error_field.
2067 * Hint: an optional suggestion what to do about the problem. This is intended to differ from detail in that it
2068 * offers advice (potentially inappropriate) rather than hard facts. May run to multiple lines.
2069 * @link http://www.php.net/manual/en/pgsql.constants.php
2070 */
2071 define ('PGSQL_DIAG_MESSAGE_HINT', 72);
2072
2073 /**
2074 * Passed to pg_result_error_field.
2075 * A string containing a decimal integer indicating an error cursor position as an index into the original
2076 * statement string. The first character has index 1, and positions are measured in characters not bytes.
2077 * @link http://www.php.net/manual/en/pgsql.constants.php
2078 */
2079 define ('PGSQL_DIAG_STATEMENT_POSITION', 80);
2080
2081 /**
2082 * Passed to pg_result_error_field.
2083 * This is defined the same as the PG_DIAG_STATEMENT_POSITION field, but
2084 * it is used when the cursor position refers to an internally generated
2085 * command rather than the one submitted by the client. The
2086 * PG_DIAG_INTERNAL_QUERY field will always appear when this
2087 * field appears.
2088 * @link http://www.php.net/manual/en/pgsql.constants.php
2089 */
2090 define ('PGSQL_DIAG_INTERNAL_POSITION', 112);
2091
2092 /**
2093 * Passed to pg_result_error_field.
2094 * The text of a failed internally-generated command. This could be, for example, a
2095 * SQL query issued by a PL/pgSQL function.
2096 * @link http://www.php.net/manual/en/pgsql.constants.php
2097 */
2098 define ('PGSQL_DIAG_INTERNAL_QUERY', 113);
2099
2100 /**
2101 * Passed to pg_result_error_field.
2102 * An indication of the context in which the error occurred. Presently
2103 * this includes a call stack traceback of active procedural language
2104 * functions and internally-generated queries. The trace is one entry
2105 * per line, most recent first.
2106 * @link http://www.php.net/manual/en/pgsql.constants.php
2107 */
2108 define ('PGSQL_DIAG_CONTEXT', 87);
2109
2110 /**
2111 * Passed to pg_result_error_field.
2112 * The file name of the PostgreSQL source-code location where the error
2113 * was reported.
2114 * @link http://www.php.net/manual/en/pgsql.constants.php
2115 */
2116 define ('PGSQL_DIAG_SOURCE_FILE', 70);
2117
2118 /**
2119 * Passed to pg_result_error_field.
2120 * The line number of the PostgreSQL source-code location where the
2121 * error was reported.
2122 * @link http://www.php.net/manual/en/pgsql.constants.php
2123 */
2124 define ('PGSQL_DIAG_SOURCE_LINE', 76);
2125
2126 /**
2127 * Passed to pg_result_error_field.
2128 * The name of the PostgreSQL source-code function reporting the error.
2129 * @link http://www.php.net/manual/en/pgsql.constants.php
2130 */
2131 define ('PGSQL_DIAG_SOURCE_FUNCTION', 82);
2132
2133 /**
2134 * Passed to pg_convert.
2135 * Ignore default values in the table during conversion.
2136 * @link http://www.php.net/manual/en/pgsql.constants.php
2137 */
2138 define ('PGSQL_CONV_IGNORE_DEFAULT', 2);
2139
2140 /**
2141 * Passed to pg_convert.
2142 * Use SQL NULL in place of an empty string.
2143 * @link http://www.php.net/manual/en/pgsql.constants.php
2144 */
2145 define ('PGSQL_CONV_FORCE_NULL', 4);
2146
2147 /**
2148 * Passed to pg_convert.
2149 * Ignore conversion of &null; into SQL NOT NULL columns.
2150 * @link http://www.php.net/manual/en/pgsql.constants.php
2151 */
2152 define ('PGSQL_CONV_IGNORE_NOT_NULL', 8);
2153
2154 /**
2155 * Passed to pg_insert, pg_select,
2156 * pg_update and pg_delete.
2157 * Apply escape to all parameters instead of calling pg_convert
2158 * internally. This option omits meta data look up. Query could be as fast as
2159 * pg_query and pg_send_query.
2160 * @link http://www.php.net/manual/en/pgsql.constants.php
2161 */
2162 define ('PGSQL_DML_ESCAPE', 4096);
2163
2164 /**
2165 * Passed to pg_insert, pg_select,
2166 * pg_update and pg_delete.
2167 * All parameters passed as is. Manual escape is required
2168 * if parameters contain user supplied data. Use pg_escape_string
2169 * for it.
2170 * @link http://www.php.net/manual/en/pgsql.constants.php
2171 */
2172 define ('PGSQL_DML_NO_CONV', 256);
2173
2174 /**
2175 * Passed to pg_insert, pg_select,
2176 * pg_update and pg_delete.
2177 * Execute query by these functions.
2178 * @link http://www.php.net/manual/en/pgsql.constants.php
2179 */
2180 define ('PGSQL_DML_EXEC', 512);
2181
2182 /**
2183 * Passed to pg_insert, pg_select,
2184 * pg_update and pg_delete.
2185 * Execute asynchronous query by these functions.
2186 * @link http://www.php.net/manual/en/pgsql.constants.php
2187 */
2188 define ('PGSQL_DML_ASYNC', 1024);
2189
2190 /**
2191 * Passed to pg_insert, pg_select,
2192 * pg_update and pg_delete.
2193 * Return executed query string.
2194 * @link http://www.php.net/manual/en/pgsql.constants.php
2195 */
2196 define ('PGSQL_DML_STRING', 2048);
2197
2198 // End of pgsql v.
2199 ?>