php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
php_pdo_pgsql_int.h
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Copyright (c) The PHP Group |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.01 of the PHP license, |
6 | that is bundled with this package in the file LICENSE, and is |
7 | available through the world-wide-web at the following url: |
8 | https://www.php.net/license/3_01.txt |
9 | If you did not receive a copy of the PHP license and are unable to |
10 | obtain it through the world-wide-web, please send a note to |
11 | license@php.net so we can mail you a copy immediately. |
12 +----------------------------------------------------------------------+
13 | Authors: Edin Kadribasic <edink@emini.dk> |
14 | Ilia Alshanestsky <ilia@prohost.org> |
15 | Wez Furlong <wez@php.net> |
16 +----------------------------------------------------------------------+
17*/
18
19/* internal header; not supposed to be installed */
20
21#ifndef PHP_PDO_PGSQL_INT_H
22#define PHP_PDO_PGSQL_INT_H
23
24#include <libpq-fe.h>
25#include <libpq/libpq-fs.h>
26#include <php.h>
27
28#define PHP_PDO_PGSQL_CONNECTION_FAILURE_SQLSTATE "08006"
29
30typedef struct {
31 const char *file;
32 int line;
33 unsigned int errcode;
34 char *errmsg;
36
37/* stuff we use in a pgsql database handle */
38typedef struct {
39 PGconn *server;
40 unsigned attached:1;
41 unsigned _reserved:31;
43 Oid pgoid;
44 unsigned int stmt_counter;
45 /* The following two variables have the same purpose. Unfortunately we need
46 to keep track of two different attributes having the same effect. */
48 bool disable_native_prepares; /* deprecated since 5.6 */
53
54typedef struct {
57
72
73typedef struct {
74 Oid oid;
76
78
80
81extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *msg, const char *file, int line);
82#define pdo_pgsql_error(d,e,z) _pdo_pgsql_error(d, NULL, e, z, NULL, __FILE__, __LINE__)
83#define pdo_pgsql_error_msg(d,e,m) _pdo_pgsql_error(d, NULL, e, NULL, m, __FILE__, __LINE__)
84#define pdo_pgsql_error_stmt(s,e,z) _pdo_pgsql_error(s->dbh, s, e, z, NULL, __FILE__, __LINE__)
85#define pdo_pgsql_error_stmt_msg(stmt, e, sqlstate, msg) \
86 _pdo_pgsql_error(stmt->dbh, stmt, e, sqlstate, msg, __FILE__, __LINE__)
87
88extern const struct pdo_stmt_methods pgsql_stmt_methods;
89
90#define pdo_pgsql_sqlstate(r) PQresultErrorField(r, PG_DIAG_SQLSTATE)
91
92enum {
95};
96
99 PGconn *conn;
100 int lfd;
101 Oid oid;
102};
103
111
112php_stream *pdo_pgsql_create_lob_stream(zval *pdh, int lfd, Oid oid);
114
116
117void pdo_libpq_version(char *buf, size_t len);
119
129
130#endif /* PHP_PDO_PGSQL_INT_H */
size_t len
Definition apprentice.c:174
file(string $filename, int $flags=0, $context=null)
char s[4]
Definition cdf.c:77
zend_ffi_ctype_name_buf buf
Definition ffi.c:4685
#define H(x, y, z)
Definition md5.c:146
const php_stream_ops pdo_pgsql_lob_stream_ops
const pdo_driver_t pdo_pgsql_driver
const struct pdo_stmt_methods pgsql_stmt_methods
int line
Definition php_ffi.h:54
char sqlstate[6]
struct _pdo_dbh_t pdo_dbh_t
struct _pdo_stmt_t pdo_stmt_t
struct _pdo_scanner_t pdo_scanner_t
@ PDO_ATTR_DRIVER_SPECIFIC
int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *msg, const char *file, int line)
void pdo_pgsql_close_lob_streams(pdo_dbh_t *dbh)
php_stream * pdo_pgsql_create_lob_stream(zval *pdh, int lfd, Oid oid)
@ PDO_PGSQL_ATTR_RESULT_MEMORY_SIZE
@ PDO_PGSQL_ATTR_DISABLE_PREPARES
void pgsqlLOBUnlink_internal(INTERNAL_FUNCTION_PARAMETERS)
void pgsqlCopyFromArray_internal(INTERNAL_FUNCTION_PARAMETERS)
pdo_pgsql_specific_constants
@ PGSQL_TRANSACTION_INTRANS
@ PGSQL_TRANSACTION_UNKNOWN
@ PGSQL_TRANSACTION_IDLE
@ PGSQL_TRANSACTION_ACTIVE
@ PGSQL_TRANSACTION_INERROR
void pgsqlCopyToArray_internal(INTERNAL_FUNCTION_PARAMETERS)
void pdo_pgsql_cleanup_notice_callback(pdo_pgsql_db_handle *H)
int pdo_pgsql_scanner(pdo_scanner_t *s)
void pgsqlCopyFromFile_internal(INTERNAL_FUNCTION_PARAMETERS)
void pgsqlLOBCreate_internal(INTERNAL_FUNCTION_PARAMETERS)
void pgsqlGetPid_internal(INTERNAL_FUNCTION_PARAMETERS)
void pgsqlGetNotify_internal(INTERNAL_FUNCTION_PARAMETERS)
void pgsqlCopyToFile_internal(INTERNAL_FUNCTION_PARAMETERS)
void pdo_libpq_version(char *buf, size_t len)
void pgsqlLOBOpen_internal(INTERNAL_FUNCTION_PARAMETERS)
struct _php_stream php_stream
Definition php_streams.h:96
struct _php_stream_ops php_stream_ops
char * msg
Definition phpdbg.h:289
zend_fcall_info_cache * notice_callback
pdo_pgsql_error_info einfo
pdo_pgsql_db_handle * H
zend_string * query
pdo_pgsql_column * cols
#define INTERNAL_FUNCTION_PARAMETERS
Definition zend.h:49
struct _zend_fcall_info_cache zend_fcall_info_cache
struct _zval_struct zval
struct _zend_string zend_string
struct _zend_array HashTable
Definition zend_types.h:386