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