PostgreSQL Source Code git master
libpq-fe.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * libpq-fe.h
4 * This file contains definitions for structures and
5 * externs for functions used by frontend postgres applications.
6 *
7 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
9 *
10 * src/interfaces/libpq/libpq-fe.h
11 *
12 *-------------------------------------------------------------------------
13 */
14
15#ifndef LIBPQ_FE_H
16#define LIBPQ_FE_H
17
18#ifdef __cplusplus
19extern "C"
20{
21#endif
22
23#include <stdio.h>
24
25/*
26 * postgres_ext.h defines the backend's externally visible types,
27 * such as Oid.
28 */
29#include "postgres_ext.h"
30
31/*
32 * These symbols may be used in compile-time #ifdef tests for the availability
33 * of v14-and-newer libpq features.
34 */
35/* Features added in PostgreSQL v14: */
36/* Indicates presence of PQenterPipelineMode and friends */
37#define LIBPQ_HAS_PIPELINING 1
38/* Indicates presence of PQsetTraceFlags; also new PQtrace output format */
39#define LIBPQ_HAS_TRACE_FLAGS 1
40
41/* Features added in PostgreSQL v15: */
42/* Indicates that PQsslAttribute(NULL, "library") is useful */
43#define LIBPQ_HAS_SSL_LIBRARY_DETECTION 1
44
45/* Features added in PostgreSQL v17: */
46/* Indicates presence of PGcancelConn typedef and associated routines */
47#define LIBPQ_HAS_ASYNC_CANCEL 1
48/* Indicates presence of PQchangePassword */
49#define LIBPQ_HAS_CHANGE_PASSWORD 1
50/* Indicates presence of PQsetChunkedRowsMode, PGRES_TUPLES_CHUNK */
51#define LIBPQ_HAS_CHUNK_MODE 1
52/* Indicates presence of PQclosePrepared, PQclosePortal, etc */
53#define LIBPQ_HAS_CLOSE_PREPARED 1
54/* Indicates presence of PQsendPipelineSync */
55#define LIBPQ_HAS_SEND_PIPELINE_SYNC 1
56/* Indicates presence of PQsocketPoll, PQgetCurrentTimeUSec */
57#define LIBPQ_HAS_SOCKET_POLL 1
58
59/* Features added in PostgreSQL v18: */
60/* Indicates presence of PQfullProtocolVersion */
61#define LIBPQ_HAS_FULL_PROTOCOL_VERSION 1
62
63/*
64 * Option flags for PQcopyResult
65 */
66#define PG_COPYRES_ATTRS 0x01
67#define PG_COPYRES_TUPLES 0x02 /* Implies PG_COPYRES_ATTRS */
68#define PG_COPYRES_EVENTS 0x04
69#define PG_COPYRES_NOTICEHOOKS 0x08
70
71/* Application-visible enum types */
72
73/*
74 * Although it is okay to add to these lists, values which become unused
75 * should never be removed, nor should constants be redefined - that would
76 * break compatibility with existing code.
77 */
78
79typedef enum
80{
83 /* Non-blocking mode only below here */
84
85 /*
86 * The existence of these should never be relied upon - they should only
87 * be used for user feedback or similar purposes.
88 */
89 CONNECTION_STARTED, /* Waiting for connection to be made. */
90 CONNECTION_MADE, /* Connection OK; waiting to send. */
91 CONNECTION_AWAITING_RESPONSE, /* Waiting for a response from the
92 * postmaster. */
93 CONNECTION_AUTH_OK, /* Received authentication; waiting for
94 * backend startup. */
95 CONNECTION_SETENV, /* This state is no longer used. */
96 CONNECTION_SSL_STARTUP, /* Performing SSL handshake. */
97 CONNECTION_NEEDED, /* Internal state: connect() needed. */
98 CONNECTION_CHECK_WRITABLE, /* Checking if session is read-write. */
99 CONNECTION_CONSUME, /* Consuming any extra messages. */
100 CONNECTION_GSS_STARTUP, /* Negotiating GSSAPI. */
101 CONNECTION_CHECK_TARGET, /* Internal state: checking target server
102 * properties. */
103 CONNECTION_CHECK_STANDBY, /* Checking if server is in standby mode. */
104 CONNECTION_ALLOCATED, /* Waiting for connection attempt to be
105 * started. */
106 CONNECTION_AUTHENTICATING, /* Authentication is in progress with some
107 * external system. */
109
110typedef enum
111{
113 PGRES_POLLING_READING, /* These two indicate that one may */
114 PGRES_POLLING_WRITING, /* use select before polling again. */
116 PGRES_POLLING_ACTIVE /* unused; keep for backwards compatibility */
118
119typedef enum
120{
121 PGRES_EMPTY_QUERY = 0, /* empty query string was executed */
122 PGRES_COMMAND_OK, /* a query command that doesn't return
123 * anything was executed properly by the
124 * backend */
125 PGRES_TUPLES_OK, /* a query command that returns tuples was
126 * executed properly by the backend, PGresult
127 * contains the result tuples */
128 PGRES_COPY_OUT, /* Copy Out data transfer in progress */
129 PGRES_COPY_IN, /* Copy In data transfer in progress */
130 PGRES_BAD_RESPONSE, /* an unexpected response was recv'd from the
131 * backend */
132 PGRES_NONFATAL_ERROR, /* notice or warning message */
133 PGRES_FATAL_ERROR, /* query failed */
134 PGRES_COPY_BOTH, /* Copy In/Out data transfer in progress */
135 PGRES_SINGLE_TUPLE, /* single tuple from larger resultset */
136 PGRES_PIPELINE_SYNC, /* pipeline synchronization point */
137 PGRES_PIPELINE_ABORTED, /* Command didn't run because of an abort
138 * earlier in a pipeline */
139 PGRES_TUPLES_CHUNK /* chunk of tuples from larger resultset */
141
142typedef enum
143{
144 PQTRANS_IDLE, /* connection idle */
145 PQTRANS_ACTIVE, /* command in progress */
146 PQTRANS_INTRANS, /* idle, within transaction block */
147 PQTRANS_INERROR, /* idle, within failed transaction */
148 PQTRANS_UNKNOWN /* cannot determine status */
150
151typedef enum
152{
153 PQERRORS_TERSE, /* single-line error messages */
154 PQERRORS_DEFAULT, /* recommended style */
155 PQERRORS_VERBOSE, /* all the facts, ma'am */
156 PQERRORS_SQLSTATE /* only error severity and SQLSTATE code */
158
159typedef enum
160{
161 PQSHOW_CONTEXT_NEVER, /* never show CONTEXT field */
162 PQSHOW_CONTEXT_ERRORS, /* show CONTEXT for errors only (default) */
163 PQSHOW_CONTEXT_ALWAYS /* always show CONTEXT field */
165
166/*
167 * PGPing - The ordering of this enum should not be altered because the
168 * values are exposed externally via pg_isready.
169 */
170
171typedef enum
172{
173 PQPING_OK, /* server is accepting connections */
174 PQPING_REJECT, /* server is alive but rejecting connections */
175 PQPING_NO_RESPONSE, /* could not establish connection */
176 PQPING_NO_ATTEMPT /* connection not attempted (bad params) */
178
179/*
180 * PGpipelineStatus - Current status of pipeline mode
181 */
182typedef enum
183{
188
189/* PGconn encapsulates a connection to the backend.
190 * The contents of this struct are not supposed to be known to applications.
191 */
192typedef struct pg_conn PGconn;
193
194/* PGcancelConn encapsulates a cancel connection to the backend.
195 * The contents of this struct are not supposed to be known to applications.
196 */
198
199/* PGresult encapsulates the result of a query (or more precisely, of a single
200 * SQL command --- a query string given to PQsendQuery can contain multiple
201 * commands and thus return multiple PGresult objects).
202 * The contents of this struct are not supposed to be known to applications.
203 */
204typedef struct pg_result PGresult;
205
206/* PGcancel encapsulates the information needed to cancel a running
207 * query on an existing connection.
208 * The contents of this struct are not supposed to be known to applications.
209 */
210typedef struct pg_cancel PGcancel;
211
212/* PGnotify represents the occurrence of a NOTIFY message.
213 * Ideally this would be an opaque typedef, but it's so simple that it's
214 * unlikely to change.
215 * NOTE: in Postgres 6.4 and later, the be_pid is the notifying backend's,
216 * whereas in earlier versions it was always your own backend's PID.
217 */
218typedef struct pgNotify
219{
220 char *relname; /* notification condition name */
221 int be_pid; /* process ID of notifying server process */
222 char *extra; /* notification parameter */
223 /* Fields below here are private to libpq; apps should not use 'em */
224 struct pgNotify *next; /* list link */
226
227/* pg_usec_time_t is like time_t, but with microsecond resolution */
229
230/* Function types for notice-handling callbacks */
231typedef void (*PQnoticeReceiver) (void *arg, const PGresult *res);
232typedef void (*PQnoticeProcessor) (void *arg, const char *message);
233
234/* Print options for PQprint() */
235typedef char pqbool;
236
237typedef struct _PQprintOpt
238{
239 pqbool header; /* print output field headings and row count */
240 pqbool align; /* fill align the fields */
241 pqbool standard; /* old brain dead format */
242 pqbool html3; /* output html tables */
243 pqbool expanded; /* expand tables */
244 pqbool pager; /* use pager for output if needed */
245 char *fieldSep; /* field separator */
246 char *tableOpt; /* insert to HTML <table ...> */
247 char *caption; /* HTML <caption> */
248 char **fieldName; /* null terminated array of replacement field
249 * names */
251
252/* ----------------
253 * Structure for the conninfo parameter definitions returned by PQconndefaults
254 * or PQconninfoParse.
255 *
256 * All fields except "val" point at static strings which must not be altered.
257 * "val" is either NULL or a malloc'd current-value string. PQconninfoFree()
258 * will release both the val strings and the PQconninfoOption array itself.
259 * ----------------
260 */
261typedef struct _PQconninfoOption
262{
263 char *keyword; /* The keyword of the option */
264 char *envvar; /* Fallback environment variable name */
265 char *compiled; /* Fallback compiled in default value */
266 char *val; /* Option's current value, or NULL */
267 char *label; /* Label for field in connect dialog */
268 char *dispchar; /* Indicates how to display this field in a
269 * connect dialog. Values are: "" Display
270 * entered value as is "*" Password field -
271 * hide value "D" Debug option - don't show
272 * by default */
273 int dispsize; /* Field size in characters for dialog */
275
276/* ----------------
277 * PQArgBlock -- structure for PQfn() arguments
278 * ----------------
279 */
280typedef struct
281{
282 int len;
283 int isint;
284 union
285 {
286 int *ptr; /* can't use void (dec compiler barfs) */
288 } u;
289} PQArgBlock;
290
291/* ----------------
292 * PGresAttDesc -- Data about a single attribute (column) of a query result
293 * ----------------
294 */
295typedef struct pgresAttDesc
296{
297 char *name; /* column name */
298 Oid tableid; /* source table, if known */
299 int columnid; /* source column, if known */
300 int format; /* format code for value (text/binary) */
301 Oid typid; /* type id */
302 int typlen; /* type size */
303 int atttypmod; /* type-specific modifier info */
305
306/* ----------------
307 * Exported functions of libpq
308 * ----------------
309 */
310
311/* === in fe-connect.c === */
312
313/* make a new client connection to the backend */
314/* Asynchronous (non-blocking) */
315extern PGconn *PQconnectStart(const char *conninfo);
316extern PGconn *PQconnectStartParams(const char *const *keywords,
317 const char *const *values, int expand_dbname);
319
320/* Synchronous (blocking) */
321extern PGconn *PQconnectdb(const char *conninfo);
322extern PGconn *PQconnectdbParams(const char *const *keywords,
323 const char *const *values, int expand_dbname);
324extern PGconn *PQsetdbLogin(const char *pghost, const char *pgport,
325 const char *pgoptions, const char *pgtty,
326 const char *dbName,
327 const char *login, const char *pwd);
328
329#define PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME) \
330 PQsetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, NULL, NULL)
331
332/* close the current connection and free the PGconn data structure */
333extern void PQfinish(PGconn *conn);
334
335/* get info about connection options known to PQconnectdb */
336extern PQconninfoOption *PQconndefaults(void);
337
338/* parse connection options in same way as PQconnectdb */
339extern PQconninfoOption *PQconninfoParse(const char *conninfo, char **errmsg);
340
341/* return the connection options used by a live connection */
343
344/* free the data structure returned by PQconndefaults() or PQconninfoParse() */
345extern void PQconninfoFree(PQconninfoOption *connOptions);
346
347/*
348 * close the current connection and reestablish a new one with the same
349 * parameters
350 */
351/* Asynchronous (non-blocking) */
352extern int PQresetStart(PGconn *conn);
354
355/* Synchronous (blocking) */
356extern void PQreset(PGconn *conn);
357
358/* Create a PGcancelConn that's used to cancel a query on the given PGconn */
360
361/* issue a cancel request in a non-blocking manner */
363
364/* issue a blocking cancel request */
366
367/* poll a non-blocking cancel request */
370extern int PQcancelSocket(const PGcancelConn *cancelConn);
371extern char *PQcancelErrorMessage(const PGcancelConn *cancelConn);
374
375
376/* request a cancel structure */
378
379/* free a cancel structure */
380extern void PQfreeCancel(PGcancel *cancel);
381
382/* deprecated version of PQcancelBlocking, but one which is signal-safe */
383extern int PQcancel(PGcancel *cancel, char *errbuf, int errbufsize);
384
385/* deprecated version of PQcancel; not thread-safe */
386extern int PQrequestCancel(PGconn *conn);
387
388/* Accessor functions for PGconn objects */
389extern char *PQdb(const PGconn *conn);
390extern char *PQservice(const PGconn *conn);
391extern char *PQuser(const PGconn *conn);
392extern char *PQpass(const PGconn *conn);
393extern char *PQhost(const PGconn *conn);
394extern char *PQhostaddr(const PGconn *conn);
395extern char *PQport(const PGconn *conn);
396extern char *PQtty(const PGconn *conn);
397extern char *PQoptions(const PGconn *conn);
398extern ConnStatusType PQstatus(const PGconn *conn);
400extern const char *PQparameterStatus(const PGconn *conn,
401 const char *paramName);
402extern int PQprotocolVersion(const PGconn *conn);
403extern int PQfullProtocolVersion(const PGconn *conn);
404extern int PQserverVersion(const PGconn *conn);
405extern char *PQerrorMessage(const PGconn *conn);
406extern int PQsocket(const PGconn *conn);
407extern int PQbackendPID(const PGconn *conn);
409extern int PQconnectionNeedsPassword(const PGconn *conn);
410extern int PQconnectionUsedPassword(const PGconn *conn);
411extern int PQconnectionUsedGSSAPI(const PGconn *conn);
412extern int PQclientEncoding(const PGconn *conn);
413extern int PQsetClientEncoding(PGconn *conn, const char *encoding);
414
415/* SSL information functions */
416extern int PQsslInUse(PGconn *conn);
417extern void *PQsslStruct(PGconn *conn, const char *struct_name);
418extern const char *PQsslAttribute(PGconn *conn, const char *attribute_name);
419extern const char *const *PQsslAttributeNames(PGconn *conn);
420
421/* Get the OpenSSL structure associated with a connection. Returns NULL for
422 * unencrypted connections or if any other TLS library is in use. */
423extern void *PQgetssl(PGconn *conn);
424
425/* Tell libpq whether it needs to initialize OpenSSL */
426extern void PQinitSSL(int do_init);
427
428/* More detailed way to tell libpq whether it needs to initialize OpenSSL */
429extern void PQinitOpenSSL(int do_ssl, int do_crypto);
430
431/* Return true if GSSAPI encryption is in use */
432extern int PQgssEncInUse(PGconn *conn);
433
434/* Returns GSSAPI context if GSSAPI is in use */
435extern void *PQgetgssctx(PGconn *conn);
436
437/* Set verbosity for PQerrorMessage and PQresultErrorMessage */
439
440/* Set CONTEXT visibility for PQerrorMessage and PQresultErrorMessage */
442 PGContextVisibility show_context);
443
444/* Override default notice handling routines */
446 PQnoticeReceiver proc,
447 void *arg);
450 void *arg);
451
452/*
453 * Used to set callback that prevents concurrent access to
454 * non-thread safe functions that libpq needs.
455 * The default implementation uses a libpq internal mutex.
456 * Only required for multithreaded apps that use kerberos
457 * both within their app and for postgresql connections.
458 */
459typedef void (*pgthreadlock_t) (int acquire);
460
462
463/* === in fe-trace.c === */
464extern void PQtrace(PGconn *conn, FILE *debug_port);
465extern void PQuntrace(PGconn *conn);
466
467/* flags controlling trace output: */
468/* omit timestamps from each line */
469#define PQTRACE_SUPPRESS_TIMESTAMPS (1<<0)
470/* redact portions of some messages, for testing frameworks */
471#define PQTRACE_REGRESS_MODE (1<<1)
472extern void PQsetTraceFlags(PGconn *conn, int flags);
473
474/* === in fe-exec.c === */
475
476/* Simple synchronous query */
477extern PGresult *PQexec(PGconn *conn, const char *query);
479 const char *command,
480 int nParams,
481 const Oid *paramTypes,
482 const char *const *paramValues,
483 const int *paramLengths,
484 const int *paramFormats,
485 int resultFormat);
486extern PGresult *PQprepare(PGconn *conn, const char *stmtName,
487 const char *query, int nParams,
488 const Oid *paramTypes);
490 const char *stmtName,
491 int nParams,
492 const char *const *paramValues,
493 const int *paramLengths,
494 const int *paramFormats,
495 int resultFormat);
496
497/* Interface for multiple-result or asynchronous queries */
498#define PQ_QUERY_PARAM_MAX_LIMIT 65535
499
500extern int PQsendQuery(PGconn *conn, const char *query);
501extern int PQsendQueryParams(PGconn *conn,
502 const char *command,
503 int nParams,
504 const Oid *paramTypes,
505 const char *const *paramValues,
506 const int *paramLengths,
507 const int *paramFormats,
508 int resultFormat);
509extern int PQsendPrepare(PGconn *conn, const char *stmtName,
510 const char *query, int nParams,
511 const Oid *paramTypes);
513 const char *stmtName,
514 int nParams,
515 const char *const *paramValues,
516 const int *paramLengths,
517 const int *paramFormats,
518 int resultFormat);
519extern int PQsetSingleRowMode(PGconn *conn);
520extern int PQsetChunkedRowsMode(PGconn *conn, int chunkSize);
522
523/* Routines for managing an asynchronous query */
524extern int PQisBusy(PGconn *conn);
525extern int PQconsumeInput(PGconn *conn);
526
527/* Routines for pipeline mode management */
528extern int PQenterPipelineMode(PGconn *conn);
529extern int PQexitPipelineMode(PGconn *conn);
530extern int PQpipelineSync(PGconn *conn);
531extern int PQsendFlushRequest(PGconn *conn);
532extern int PQsendPipelineSync(PGconn *conn);
533
534/* LISTEN/NOTIFY support */
536
537/* Routines for copy in/out */
538extern int PQputCopyData(PGconn *conn, const char *buffer, int nbytes);
539extern int PQputCopyEnd(PGconn *conn, const char *errormsg);
540extern int PQgetCopyData(PGconn *conn, char **buffer, int async);
541
542/* Deprecated routines for copy in/out */
543extern int PQgetline(PGconn *conn, char *buffer, int length);
544extern int PQputline(PGconn *conn, const char *string);
545extern int PQgetlineAsync(PGconn *conn, char *buffer, int bufsize);
546extern int PQputnbytes(PGconn *conn, const char *buffer, int nbytes);
547extern int PQendcopy(PGconn *conn);
548
549/* Set blocking/nonblocking connection to the backend */
550extern int PQsetnonblocking(PGconn *conn, int arg);
551extern int PQisnonblocking(const PGconn *conn);
552extern int PQisthreadsafe(void);
553extern PGPing PQping(const char *conninfo);
554extern PGPing PQpingParams(const char *const *keywords,
555 const char *const *values, int expand_dbname);
556
557/* Force the write buffer to be written (or at least try) */
558extern int PQflush(PGconn *conn);
559
560/*
561 * "Fast path" interface --- not really recommended for application
562 * use
563 */
564extern PGresult *PQfn(PGconn *conn,
565 int fnid,
566 int *result_buf,
567 int *result_len,
568 int result_is_int,
569 const PQArgBlock *args,
570 int nargs);
571
572/* Accessor functions for PGresult objects */
574extern char *PQresStatus(ExecStatusType status);
575extern char *PQresultErrorMessage(const PGresult *res);
576extern char *PQresultVerboseErrorMessage(const PGresult *res,
577 PGVerbosity verbosity,
578 PGContextVisibility show_context);
579extern char *PQresultErrorField(const PGresult *res, int fieldcode);
580extern int PQntuples(const PGresult *res);
581extern int PQnfields(const PGresult *res);
582extern int PQbinaryTuples(const PGresult *res);
583extern char *PQfname(const PGresult *res, int field_num);
584extern int PQfnumber(const PGresult *res, const char *field_name);
585extern Oid PQftable(const PGresult *res, int field_num);
586extern int PQftablecol(const PGresult *res, int field_num);
587extern int PQfformat(const PGresult *res, int field_num);
588extern Oid PQftype(const PGresult *res, int field_num);
589extern int PQfsize(const PGresult *res, int field_num);
590extern int PQfmod(const PGresult *res, int field_num);
591extern char *PQcmdStatus(PGresult *res);
592extern char *PQoidStatus(const PGresult *res); /* old and ugly */
593extern Oid PQoidValue(const PGresult *res); /* new and improved */
594extern char *PQcmdTuples(PGresult *res);
595extern char *PQgetvalue(const PGresult *res, int tup_num, int field_num);
596extern int PQgetlength(const PGresult *res, int tup_num, int field_num);
597extern int PQgetisnull(const PGresult *res, int tup_num, int field_num);
598extern int PQnparams(const PGresult *res);
599extern Oid PQparamtype(const PGresult *res, int param_num);
600
601/* Describe prepared statements and portals */
602extern PGresult *PQdescribePrepared(PGconn *conn, const char *stmt);
603extern PGresult *PQdescribePortal(PGconn *conn, const char *portal);
604extern int PQsendDescribePrepared(PGconn *conn, const char *stmt);
605extern int PQsendDescribePortal(PGconn *conn, const char *portal);
606
607/* Close prepared statements and portals */
608extern PGresult *PQclosePrepared(PGconn *conn, const char *stmt);
609extern PGresult *PQclosePortal(PGconn *conn, const char *portal);
610extern int PQsendClosePrepared(PGconn *conn, const char *stmt);
611extern int PQsendClosePortal(PGconn *conn, const char *portal);
612
613/* Delete a PGresult */
614extern void PQclear(PGresult *res);
615
616/* For freeing other alloc'd results, such as PGnotify structs */
617extern void PQfreemem(void *ptr);
618
619/* Exists for backward compatibility. bjm 2003-03-24 */
620#define PQfreeNotify(ptr) PQfreemem(ptr)
621
622/* Error when no password was given. */
623/* Note: depending on this is deprecated; use PQconnectionNeedsPassword(). */
624#define PQnoPasswordSupplied "fe_sendauth: no password supplied\n"
625
626/* Create and manipulate PGresults */
628extern PGresult *PQcopyResult(const PGresult *src, int flags);
629extern int PQsetResultAttrs(PGresult *res, int numAttributes, PGresAttDesc *attDescs);
630extern void *PQresultAlloc(PGresult *res, size_t nBytes);
631extern size_t PQresultMemorySize(const PGresult *res);
632extern int PQsetvalue(PGresult *res, int tup_num, int field_num, char *value, int len);
633
634/* Quoting strings before inclusion in queries. */
635extern size_t PQescapeStringConn(PGconn *conn,
636 char *to, const char *from, size_t length,
637 int *error);
638extern char *PQescapeLiteral(PGconn *conn, const char *str, size_t len);
639extern char *PQescapeIdentifier(PGconn *conn, const char *str, size_t len);
640extern unsigned char *PQescapeByteaConn(PGconn *conn,
641 const unsigned char *from, size_t from_length,
642 size_t *to_length);
643extern unsigned char *PQunescapeBytea(const unsigned char *strtext,
644 size_t *retbuflen);
645
646/* These forms are deprecated! */
647extern size_t PQescapeString(char *to, const char *from, size_t length);
648extern unsigned char *PQescapeBytea(const unsigned char *from, size_t from_length,
649 size_t *to_length);
650
651
652
653/* === in fe-print.c === */
654
655extern void PQprint(FILE *fout, /* output stream */
656 const PGresult *res,
657 const PQprintOpt *po); /* option structure */
658
659/*
660 * really old printing routines
661 */
662extern void PQdisplayTuples(const PGresult *res,
663 FILE *fp, /* where to send the output */
664 int fillAlign, /* pad the fields with spaces */
665 const char *fieldSep, /* field separator */
666 int printHeader, /* display headers? */
667 int quiet);
668
669extern void PQprintTuples(const PGresult *res,
670 FILE *fout, /* output stream */
671 int PrintAttNames, /* print attribute names */
672 int TerseOutput, /* delimiter bars */
673 int colWidth); /* width of column, if 0, use
674 * variable width */
675
676
677/* === in fe-lobj.c === */
678
679/* Large-object access routines */
680extern int lo_open(PGconn *conn, Oid lobjId, int mode);
681extern int lo_close(PGconn *conn, int fd);
682extern int lo_read(PGconn *conn, int fd, char *buf, size_t len);
683extern int lo_write(PGconn *conn, int fd, const char *buf, size_t len);
684extern int lo_lseek(PGconn *conn, int fd, int offset, int whence);
685extern pg_int64 lo_lseek64(PGconn *conn, int fd, pg_int64 offset, int whence);
686extern Oid lo_creat(PGconn *conn, int mode);
687extern Oid lo_create(PGconn *conn, Oid lobjId);
688extern int lo_tell(PGconn *conn, int fd);
689extern pg_int64 lo_tell64(PGconn *conn, int fd);
690extern int lo_truncate(PGconn *conn, int fd, size_t len);
691extern int lo_truncate64(PGconn *conn, int fd, pg_int64 len);
692extern int lo_unlink(PGconn *conn, Oid lobjId);
693extern Oid lo_import(PGconn *conn, const char *filename);
694extern Oid lo_import_with_oid(PGconn *conn, const char *filename, Oid lobjId);
695extern int lo_export(PGconn *conn, Oid lobjId, const char *filename);
696
697/* === in fe-misc.c === */
698
699/* Get the version of the libpq library in use */
700extern int PQlibVersion(void);
701
702/* Poll a socket for reading and/or writing with an optional timeout */
703extern int PQsocketPoll(int sock, int forRead, int forWrite,
705
706/* Get current time in the form PQsocketPoll wants */
708
709/* Determine length of multibyte encoded char at *s */
710extern int PQmblen(const char *s, int encoding);
711
712/* Same, but not more than the distance to the end of string s */
713extern int PQmblenBounded(const char *s, int encoding);
714
715/* Determine display length of multibyte encoded char at *s */
716extern int PQdsplen(const char *s, int encoding);
717
718/* Get encoding id from environment variable PGCLIENTENCODING */
719extern int PQenv2encoding(void);
720
721/* === in fe-auth.c === */
722
723extern char *PQencryptPassword(const char *passwd, const char *user);
724extern char *PQencryptPasswordConn(PGconn *conn, const char *passwd, const char *user, const char *algorithm);
725extern PGresult *PQchangePassword(PGconn *conn, const char *user, const char *passwd);
726
727/* === in encnames.c === */
728
729extern int pg_char_to_encoding(const char *name);
730extern const char *pg_encoding_to_char(int encoding);
732
733/* === in fe-secure-openssl.c === */
734
735/* Support for overriding sslpassword handling with a callback */
736typedef int (*PQsslKeyPassHook_OpenSSL_type) (char *buf, int size, PGconn *conn);
739extern int PQdefaultSSLKeyPassHook_OpenSSL(char *buf, int size, PGconn *conn);
740
741#ifdef __cplusplus
742}
743#endif
744
745#endif /* LIBPQ_FE_H */
static Datum values[MAXATTR]
Definition: bootstrap.c:151
static PGcancel *volatile cancelConn
Definition: cancel.c:43
int errmsg(const char *fmt,...)
Definition: elog.c:1070
const char * str
#define stmt
Definition: indent_codes.h:59
#define bufsize
Definition: indent_globs.h:36
static struct @162 value
static const JsonPathKeyword keywords[]
ConnStatusType
Definition: libpq-fe.h:80
@ CONNECTION_CONSUME
Definition: libpq-fe.h:99
@ CONNECTION_AUTHENTICATING
Definition: libpq-fe.h:106
@ CONNECTION_CHECK_STANDBY
Definition: libpq-fe.h:103
@ CONNECTION_STARTED
Definition: libpq-fe.h:89
@ CONNECTION_AWAITING_RESPONSE
Definition: libpq-fe.h:91
@ CONNECTION_MADE
Definition: libpq-fe.h:90
@ CONNECTION_CHECK_WRITABLE
Definition: libpq-fe.h:98
@ CONNECTION_BAD
Definition: libpq-fe.h:82
@ CONNECTION_OK
Definition: libpq-fe.h:81
@ CONNECTION_GSS_STARTUP
Definition: libpq-fe.h:100
@ CONNECTION_ALLOCATED
Definition: libpq-fe.h:104
@ CONNECTION_SSL_STARTUP
Definition: libpq-fe.h:96
@ CONNECTION_AUTH_OK
Definition: libpq-fe.h:93
@ CONNECTION_CHECK_TARGET
Definition: libpq-fe.h:101
@ CONNECTION_NEEDED
Definition: libpq-fe.h:97
@ CONNECTION_SETENV
Definition: libpq-fe.h:95
int PQserverVersion(const PGconn *conn)
Definition: fe-connect.c:7497
char * PQencryptPasswordConn(PGconn *conn, const char *passwd, const char *user, const char *algorithm)
Definition: fe-auth.c:1404
int PQprotocolVersion(const PGconn *conn)
Definition: fe-connect.c:7477
char pqbool
Definition: libpq-fe.h:235
int PQresetStart(PGconn *conn)
Definition: fe-connect.c:5225
int PQsendQueryParams(PGconn *conn, const char *command, int nParams, const Oid *paramTypes, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat)
Definition: fe-exec.c:1492
int PQgetlength(const PGresult *res, int tup_num, int field_num)
Definition: fe-exec.c:3887
int PQsetSingleRowMode(PGconn *conn)
Definition: fe-exec.c:1948
char * PQoptions(const PGconn *conn)
Definition: fe-connect.c:7436
int PQbinaryTuples(const PGresult *res)
Definition: fe-exec.c:3497
int PQflush(PGconn *conn)
Definition: fe-exec.c:4000
PGresult * PQcopyResult(const PGresult *src, int flags)
Definition: fe-exec.c:318
void PQfreemem(void *ptr)
Definition: fe-exec.c:4032
void PQdisplayTuples(const PGresult *res, FILE *fp, int fillAlign, const char *fieldSep, int printHeader, int quiet)
Definition: fe-print.c:574
int PQgetline(PGconn *conn, char *buffer, int length)
Definition: fe-exec.c:2854
ExecStatusType
Definition: libpq-fe.h:120
@ PGRES_COPY_IN
Definition: libpq-fe.h:129
@ PGRES_COPY_BOTH
Definition: libpq-fe.h:134
@ PGRES_COMMAND_OK
Definition: libpq-fe.h:122
@ PGRES_TUPLES_CHUNK
Definition: libpq-fe.h:139
@ PGRES_FATAL_ERROR
Definition: libpq-fe.h:133
@ PGRES_SINGLE_TUPLE
Definition: libpq-fe.h:135
@ PGRES_COPY_OUT
Definition: libpq-fe.h:128
@ PGRES_EMPTY_QUERY
Definition: libpq-fe.h:121
@ PGRES_PIPELINE_SYNC
Definition: libpq-fe.h:136
@ PGRES_BAD_RESPONSE
Definition: libpq-fe.h:130
@ PGRES_PIPELINE_ABORTED
Definition: libpq-fe.h:137
@ PGRES_NONFATAL_ERROR
Definition: libpq-fe.h:132
@ PGRES_TUPLES_OK
Definition: libpq-fe.h:125
char * PQdb(const PGconn *conn)
Definition: fe-connect.c:7335
void PQinitSSL(int do_init)
Definition: fe-secure.c:117
Oid PQftype(const PGresult *res, int field_num)
Definition: fe-exec.c:3719
PGresult * PQchangePassword(PGconn *conn, const char *user, const char *passwd)
Definition: fe-auth.c:1529
void(* pgthreadlock_t)(int acquire)
Definition: libpq-fe.h:459
int lo_tell(PGconn *conn, int fd)
Definition: fe-lobj.c:515
void * PQgetssl(PGconn *conn)
char * PQresultVerboseErrorMessage(const PGresult *res, PGVerbosity verbosity, PGContextVisibility show_context)
Definition: fe-exec.c:3435
PGresult * PQdescribePrepared(PGconn *conn, const char *stmt)
Definition: fe-exec.c:2455
PGresult * PQexecParams(PGconn *conn, const char *command, int nParams, const Oid *paramTypes, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat)
Definition: fe-exec.c:2276
int PQexitPipelineMode(PGconn *conn)
Definition: fe-exec.c:3073
PGresult * PQexecPrepared(PGconn *conn, const char *stmtName, int nParams, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat)
Definition: fe-exec.c:2323
int PQsendClosePortal(PGconn *conn, const char *portal)
Definition: fe-exec.c:2569
PGPing
Definition: libpq-fe.h:172
@ PQPING_OK
Definition: libpq-fe.h:173
@ PQPING_REJECT
Definition: libpq-fe.h:174
@ PQPING_NO_RESPONSE
Definition: libpq-fe.h:175
@ PQPING_NO_ATTEMPT
Definition: libpq-fe.h:176
PGcancel * PQgetCancel(PGconn *conn)
Definition: fe-cancel.c:349
int PQsetResultAttrs(PGresult *res, int numAttributes, PGresAttDesc *attDescs)
Definition: fe-exec.c:249
PGContextVisibility
Definition: libpq-fe.h:160
@ PQSHOW_CONTEXT_NEVER
Definition: libpq-fe.h:161
@ PQSHOW_CONTEXT_ALWAYS
Definition: libpq-fe.h:163
@ PQSHOW_CONTEXT_ERRORS
Definition: libpq-fe.h:162
void PQcancelReset(PGcancelConn *cancelConn)
Definition: fe-cancel.c:318
int lo_close(PGconn *conn, int fd)
Definition: fe-lobj.c:96
struct _PQconninfoOption PQconninfoOption
unsigned char * PQunescapeBytea(const unsigned char *strtext, size_t *retbuflen)
Definition: fe-exec.c:4560
pg_int64 lo_tell64(PGconn *conn, int fd)
Definition: fe-lobj.c:548
int PQenv2encoding(void)
Definition: fe-misc.c:1262
const char * pg_encoding_to_char(int encoding)
Definition: encnames.c:587
PQsslKeyPassHook_OpenSSL_type PQgetSSLKeyPassHook_OpenSSL(void)
void * PQsslStruct(PGconn *conn, const char *struct_name)
int PQfullProtocolVersion(const PGconn *conn)
Definition: fe-connect.c:7487
void PQreset(PGconn *conn)
Definition: fe-connect.c:5192
int PQenterPipelineMode(PGconn *conn)
Definition: fe-exec.c:3042
int PQsocketPoll(int sock, int forRead, int forWrite, pg_usec_time_t end_time)
Definition: fe-misc.c:1115
size_t PQescapeStringConn(PGconn *conn, char *to, const char *from, size_t length, int *error)
Definition: fe-exec.c:4183
void PQtrace(PGconn *conn, FILE *debug_port)
Definition: fe-trace.c:35
char * PQport(const PGconn *conn)
Definition: fe-connect.c:7412
PGresult * PQclosePrepared(PGconn *conn, const char *stmt)
Definition: fe-exec.c:2521
PGTransactionStatusType PQtransactionStatus(const PGconn *conn)
Definition: fe-connect.c:7452
PGcancelConn * PQcancelCreate(PGconn *conn)
Definition: fe-cancel.c:65
PGTransactionStatusType
Definition: libpq-fe.h:143
@ PQTRANS_INTRANS
Definition: libpq-fe.h:146
@ PQTRANS_IDLE
Definition: libpq-fe.h:144
@ PQTRANS_ACTIVE
Definition: libpq-fe.h:145
@ PQTRANS_UNKNOWN
Definition: libpq-fe.h:148
@ PQTRANS_INERROR
Definition: libpq-fe.h:147
char * PQgetvalue(const PGresult *res, int tup_num, int field_num)
Definition: fe-exec.c:3876
void * PQgetgssctx(PGconn *conn)
PGresult * PQclosePortal(PGconn *conn, const char *portal)
Definition: fe-exec.c:2539
PGresult * PQgetResult(PGconn *conn)
Definition: fe-exec.c:2062
ExecStatusType PQresultStatus(const PGresult *res)
Definition: fe-exec.c:3411
Oid PQparamtype(const PGresult *res, int param_num)
Definition: fe-exec.c:3926
PGconn * PQconnectdb(const char *conninfo)
Definition: fe-connect.c:772
char * PQhost(const PGconn *conn)
Definition: fe-connect.c:7376
int PQnparams(const PGresult *res)
Definition: fe-exec.c:3915
int PQdefaultSSLKeyPassHook_OpenSSL(char *buf, int size, PGconn *conn)
int pg_char_to_encoding(const char *name)
Definition: encnames.c:549
void PQprintTuples(const PGresult *res, FILE *fout, int PrintAttNames, int TerseOutput, int colWidth)
Definition: fe-print.c:671
void PQclear(PGresult *res)
Definition: fe-exec.c:721
int PQsendClosePrepared(PGconn *conn, const char *stmt)
Definition: fe-exec.c:2556
char * PQservice(const PGconn *conn)
Definition: fe-connect.c:7343
char * PQcmdTuples(PGresult *res)
Definition: fe-exec.c:3822
struct _PQprintOpt PQprintOpt
int PQconnectionUsedPassword(const PGconn *conn)
Definition: fe-connect.c:7575
PQconninfoOption * PQconninfo(PGconn *conn)
Definition: fe-connect.c:7278
int PQfformat(const PGresult *res, int field_num)
Definition: fe-exec.c:3708
void(* PQnoticeReceiver)(void *arg, const PGresult *res)
Definition: libpq-fe.h:231
int PQlibVersion(void)
Definition: fe-misc.c:63
void(* PQnoticeProcessor)(void *arg, const char *message)
Definition: libpq-fe.h:232
int PQendcopy(PGconn *conn)
Definition: fe-exec.c:2949
int PQgssEncInUse(PGconn *conn)
PostgresPollingStatusType PQconnectPoll(PGconn *conn)
Definition: fe-connect.c:2818
int PQputCopyEnd(PGconn *conn, const char *errormsg)
Definition: fe-exec.c:2749
void PQconninfoFree(PQconninfoOption *connOptions)
Definition: fe-connect.c:7322
Oid lo_creat(PGconn *conn, int mode)
Definition: fe-lobj.c:438
int PQsendPipelineSync(PGconn *conn)
Definition: fe-exec.c:3282
int(* PQsslKeyPassHook_OpenSSL_type)(char *buf, int size, PGconn *conn)
Definition: libpq-fe.h:736
int lo_read(PGconn *conn, int fd, char *buf, size_t len)
Definition: fe-lobj.c:245
int lo_lseek(PGconn *conn, int fd, int offset, int whence)
Definition: fe-lobj.c:344
int PQntuples(const PGresult *res)
Definition: fe-exec.c:3481
int PQputnbytes(PGconn *conn, const char *buffer, int nbytes)
Definition: fe-exec.c:2928
void PQprint(FILE *fout, const PGresult *res, const PQprintOpt *po)
Definition: fe-print.c:68
pg_int64 lo_lseek64(PGconn *conn, int fd, pg_int64 offset, int whence)
Definition: fe-lobj.c:385
int pg_valid_server_encoding_id(int encoding)
Definition: encnames.c:513
int PQmblen(const char *s, int encoding)
Definition: fe-misc.c:1233
int PQputline(PGconn *conn, const char *string)
Definition: fe-exec.c:2918
int PQgetlineAsync(PGconn *conn, char *buffer, int bufsize)
Definition: fe-exec.c:2901
int lo_open(PGconn *conn, Oid lobjId, int mode)
Definition: fe-lobj.c:57
PostgresPollingStatusType
Definition: libpq-fe.h:111
@ PGRES_POLLING_ACTIVE
Definition: libpq-fe.h:116
@ PGRES_POLLING_OK
Definition: libpq-fe.h:115
@ PGRES_POLLING_READING
Definition: libpq-fe.h:113
@ PGRES_POLLING_WRITING
Definition: libpq-fe.h:114
@ PGRES_POLLING_FAILED
Definition: libpq-fe.h:112
char * PQtty(const PGconn *conn)
Definition: fe-connect.c:7428
int PQputCopyData(PGconn *conn, const char *buffer, int nbytes)
Definition: fe-exec.c:2695
PQconninfoOption * PQconninfoParse(const char *conninfo, char **errmsg)
Definition: fe-connect.c:6038
const char * PQparameterStatus(const PGconn *conn, const char *paramName)
Definition: fe-connect.c:7462
PGresult * PQmakeEmptyPGresult(PGconn *conn, ExecStatusType status)
Definition: fe-exec.c:159
ConnStatusType PQcancelStatus(const PGcancelConn *cancelConn)
Definition: fe-cancel.c:283
pg_int64 pg_usec_time_t
Definition: libpq-fe.h:228
PGresult * PQprepare(PGconn *conn, const char *stmtName, const char *query, int nParams, const Oid *paramTypes)
Definition: fe-exec.c:2306
int lo_write(PGconn *conn, int fd, const char *buf, size_t len)
Definition: fe-lobj.c:295
int PQisthreadsafe(void)
Definition: fe-exec.c:3992
int PQconnectionNeedsPassword(const PGconn *conn)
Definition: fe-connect.c:7560
char * PQresultErrorMessage(const PGresult *res)
Definition: fe-exec.c:3427
char * PQencryptPassword(const char *passwd, const char *user)
Definition: fe-auth.c:1361
char * PQpass(const PGconn *conn)
Definition: fe-connect.c:7359
void PQinitOpenSSL(int do_ssl, int do_crypto)
Definition: fe-secure.c:129
int PQcancelBlocking(PGcancelConn *cancelConn)
Definition: fe-cancel.c:171
int lo_truncate(PGconn *conn, int fd, size_t len)
Definition: fe-lobj.c:131
int PQsendDescribePrepared(PGconn *conn, const char *stmt)
Definition: fe-exec.c:2491
char * PQfname(const PGresult *res, int field_num)
Definition: fe-exec.c:3567
Oid lo_create(PGconn *conn, Oid lobjId)
Definition: fe-lobj.c:474
PostgresPollingStatusType PQresetPoll(PGconn *conn)
Definition: fe-connect.c:5244
int PQsslInUse(PGconn *conn)
Definition: fe-secure.c:103
int PQconnectionUsedGSSAPI(const PGconn *conn)
Definition: fe-connect.c:7586
size_t PQescapeString(char *to, const char *from, size_t length)
Definition: fe-exec.c:4205
int PQconsumeInput(PGconn *conn)
Definition: fe-exec.c:1984
int PQcancel(PGcancel *cancel, char *errbuf, int errbufsize)
Definition: fe-cancel.c:463
struct pgNotify PGnotify
ConnStatusType PQstatus(const PGconn *conn)
Definition: fe-connect.c:7444
PGconn * PQconnectStart(const char *conninfo)
Definition: fe-connect.c:900
Oid PQftable(const PGresult *res, int field_num)
Definition: fe-exec.c:3686
int PQfnumber(const PGresult *res, const char *field_name)
Definition: fe-exec.c:3589
unsigned char * PQescapeBytea(const unsigned char *from, size_t from_length, size_t *to_length)
Definition: fe-exec.c:4535
int PQsetnonblocking(PGconn *conn, int arg)
Definition: fe-exec.c:3944
int PQclientEncoding(const PGconn *conn)
Definition: fe-connect.c:7597
PGconn * PQconnectStartParams(const char *const *keywords, const char *const *values, int expand_dbname)
Definition: fe-connect.c:819
char * PQescapeLiteral(PGconn *conn, const char *str, size_t len)
Definition: fe-exec.c:4370
void PQfinish(PGconn *conn)
Definition: fe-connect.c:5178
PGresult * PQfn(PGconn *conn, int fnid, int *result_buf, int *result_len, int result_is_int, const PQArgBlock *args, int nargs)
Definition: fe-exec.c:2980
PGPing PQping(const char *conninfo)
Definition: fe-connect.c:788
int PQsendPrepare(PGconn *conn, const char *stmtName, const char *query, int nParams, const Oid *paramTypes)
Definition: fe-exec.c:1536
PGresult * PQdescribePortal(PGconn *conn, const char *portal)
Definition: fe-exec.c:2474
int PQfmod(const PGresult *res, int field_num)
Definition: fe-exec.c:3741
PGContextVisibility PQsetErrorContextVisibility(PGconn *conn, PGContextVisibility show_context)
Definition: fe-connect.c:7659
PGpipelineStatus
Definition: libpq-fe.h:183
@ PQ_PIPELINE_OFF
Definition: libpq-fe.h:184
@ PQ_PIPELINE_ABORTED
Definition: libpq-fe.h:186
@ PQ_PIPELINE_ON
Definition: libpq-fe.h:185
int PQdsplen(const char *s, int encoding)
Definition: fe-misc.c:1253
int PQgetisnull(const PGresult *res, int tup_num, int field_num)
Definition: fe-exec.c:3901
int PQftablecol(const PGresult *res, int field_num)
Definition: fe-exec.c:3697
int PQsetChunkedRowsMode(PGconn *conn, int chunkSize)
Definition: fe-exec.c:1965
const char * PQsslAttribute(PGconn *conn, const char *attribute_name)
char * PQresultErrorField(const PGresult *res, int fieldcode)
Definition: fe-exec.c:3466
int PQsetvalue(PGresult *res, int tup_num, int field_num, char *value, int len)
Definition: fe-exec.c:452
int PQsendQuery(PGconn *conn, const char *query)
Definition: fe-exec.c:1416
char * PQcmdStatus(PGresult *res)
Definition: fe-exec.c:3752
int PQpipelineSync(PGconn *conn)
Definition: fe-exec.c:3272
PostgresPollingStatusType PQcancelPoll(PGcancelConn *cancelConn)
Definition: fe-cancel.c:207
char * PQoidStatus(const PGresult *res)
Definition: fe-exec.c:3765
PQnoticeReceiver PQsetNoticeReceiver(PGconn *conn, PQnoticeReceiver proc, void *arg)
Definition: fe-connect.c:7671
int PQsendDescribePortal(PGconn *conn, const char *portal)
Definition: fe-exec.c:2504
void PQcancelFinish(PGcancelConn *cancelConn)
Definition: fe-cancel.c:334
PGconn * PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions, const char *pgtty, const char *dbName, const char *login, const char *pwd)
Definition: fe-connect.c:2141
void PQsetTraceFlags(PGconn *conn, int flags)
Definition: fe-trace.c:64
char * PQhostaddr(const PGconn *conn)
Definition: fe-connect.c:7399
char * PQresStatus(ExecStatusType status)
Definition: fe-exec.c:3419
size_t PQresultMemorySize(const PGresult *res)
Definition: fe-exec.c:663
int PQbackendPID(const PGconn *conn)
Definition: fe-connect.c:7543
void * PQresultAlloc(PGresult *res, size_t nBytes)
Definition: fe-exec.c:543
PQconninfoOption * PQconndefaults(void)
Definition: fe-connect.c:2103
int PQisBusy(PGconn *conn)
Definition: fe-exec.c:2031
PGresult * PQexec(PGconn *conn, const char *query)
Definition: fe-exec.c:2262
pg_usec_time_t PQgetCurrentTimeUSec(void)
Definition: fe-misc.c:1209
unsigned char * PQescapeByteaConn(PGconn *conn, const unsigned char *from, size_t from_length, size_t *to_length)
Definition: fe-exec.c:4519
int PQsendQueryPrepared(PGconn *conn, const char *stmtName, int nParams, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat)
Definition: fe-exec.c:1633
char * PQescapeIdentifier(PGconn *conn, const char *str, size_t len)
Definition: fe-exec.c:4376
PGVerbosity
Definition: libpq-fe.h:152
@ PQERRORS_VERBOSE
Definition: libpq-fe.h:155
@ PQERRORS_DEFAULT
Definition: libpq-fe.h:154
@ PQERRORS_TERSE
Definition: libpq-fe.h:153
@ PQERRORS_SQLSTATE
Definition: libpq-fe.h:156
int PQsendFlushRequest(PGconn *conn)
Definition: fe-exec.c:3371
int PQrequestCancel(PGconn *conn)
Definition: fe-cancel.c:661
void PQfreeCancel(PGcancel *cancel)
Definition: fe-cancel.c:417
char * PQuser(const PGconn *conn)
Definition: fe-connect.c:7351
int PQcancelSocket(const PGcancelConn *cancelConn)
Definition: fe-cancel.c:294
PGpipelineStatus PQpipelineStatus(const PGconn *conn)
Definition: fe-connect.c:7551
int lo_unlink(PGconn *conn, Oid lobjId)
Definition: fe-lobj.c:589
int PQisnonblocking(const PGconn *conn)
Definition: fe-exec.c:3983
void PQuntrace(PGconn *conn)
Definition: fe-trace.c:49
PGVerbosity PQsetErrorVerbosity(PGconn *conn, PGVerbosity verbosity)
Definition: fe-connect.c:7647
PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn, PQnoticeProcessor proc, void *arg)
Definition: fe-connect.c:7688
char * PQcancelErrorMessage(const PGcancelConn *cancelConn)
Definition: fe-cancel.c:306
Oid lo_import(PGconn *conn, const char *filename)
Definition: fe-lobj.c:626
Oid PQoidValue(const PGresult *res)
Definition: fe-exec.c:3793
int PQmblenBounded(const char *s, int encoding)
Definition: fe-misc.c:1243
int lo_export(PGconn *conn, Oid lobjId, const char *filename)
Definition: fe-lobj.c:748
const char *const * PQsslAttributeNames(PGconn *conn)
int PQcancelStart(PGcancelConn *cancelConn)
Definition: fe-cancel.c:185
int PQnfields(const PGresult *res)
Definition: fe-exec.c:3489
char * PQerrorMessage(const PGconn *conn)
Definition: fe-connect.c:7507
Oid lo_import_with_oid(PGconn *conn, const char *filename, Oid lobjId)
Definition: fe-lobj.c:641
void PQsetSSLKeyPassHook_OpenSSL(PQsslKeyPassHook_OpenSSL_type hook)
PGPing PQpingParams(const char *const *keywords, const char *const *values, int expand_dbname)
Definition: fe-connect.c:735
int PQsocket(const PGconn *conn)
Definition: fe-connect.c:7533
int PQfsize(const PGresult *res, int field_num)
Definition: fe-exec.c:3730
PGnotify * PQnotifies(PGconn *conn)
Definition: fe-exec.c:2667
int lo_truncate64(PGconn *conn, int fd, pg_int64 len)
Definition: fe-lobj.c:195
int PQsetClientEncoding(PGconn *conn, const char *encoding)
Definition: fe-connect.c:7605
PGconn * PQconnectdbParams(const char *const *keywords, const char *const *values, int expand_dbname)
Definition: fe-connect.c:717
struct pgresAttDesc PGresAttDesc
pgthreadlock_t PQregisterThreadLock(pgthreadlock_t newhandler)
Definition: fe-connect.c:8133
int PQgetCopyData(PGconn *conn, char **buffer, int async)
Definition: fe-exec.c:2816
void * arg
static PgChecksumMode mode
Definition: pg_checksums.c:55
const void size_t len
static void do_init(void)
Definition: pg_ctl.c:902
int32 encoding
Definition: pg_database.h:41
static char * filename
Definition: pg_dumpall.c:119
static char * user
Definition: pg_regress.c:119
static char * buf
Definition: pg_test_fsync.c:72
static int64 end_time
Definition: pgbench.c:176
static const char * pghost
Definition: pgbench.c:295
static const char * pgport
Definition: pgbench.c:296
static const char * dbName
Definition: pgbench.c:298
unsigned int Oid
Definition: postgres_ext.h:32
int64_t pg_int64
Definition: postgres_ext.h:48
static int fd(const char *x, int i)
Definition: preproc-init.c:105
static pg_noinline void Size size
Definition: slab.c:607
static void error(void)
Definition: sql-dyntest.c:147
PGconn * conn
Definition: streamutil.c:53
int isint
Definition: libpq-fe.h:283
int * ptr
Definition: libpq-fe.h:286
int integer
Definition: libpq-fe.h:287
pqbool align
Definition: libpq-fe.h:240
pqbool pager
Definition: libpq-fe.h:244
pqbool standard
Definition: libpq-fe.h:241
pqbool html3
Definition: libpq-fe.h:242
char * caption
Definition: libpq-fe.h:247
pqbool header
Definition: libpq-fe.h:239
pqbool expanded
Definition: libpq-fe.h:243
char * fieldSep
Definition: libpq-fe.h:245
char ** fieldName
Definition: libpq-fe.h:248
char * tableOpt
Definition: libpq-fe.h:246
struct pgNotify * next
Definition: libpq-fe.h:224
int be_pid
Definition: libpq-fe.h:221
char * relname
Definition: libpq-fe.h:220
char * extra
Definition: libpq-fe.h:222
char * name
Definition: libpq-fe.h:297
int columnid
Definition: libpq-fe.h:299
int atttypmod
Definition: libpq-fe.h:303
const char * name