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