]> granicus.if.org Git - postgresql/blob - src/interfaces/libpq/libpq-fe.h
pgindent run for 9.4
[postgresql] / src / interfaces / libpq / libpq-fe.h
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-2014, 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  * Option flags for PQcopyResult
33  */
34 #define PG_COPYRES_ATTRS                  0x01
35 #define PG_COPYRES_TUPLES                 0x02  /* Implies PG_COPYRES_ATTRS */
36 #define PG_COPYRES_EVENTS                 0x04
37 #define PG_COPYRES_NOTICEHOOKS    0x08
38
39 /* Application-visible enum types */
40
41 /*
42  * Although it is okay to add to these lists, values which become unused
43  * should never be removed, nor should constants be redefined - that would
44  * break compatibility with existing code.
45  */
46
47 typedef enum
48 {
49         CONNECTION_OK,
50         CONNECTION_BAD,
51         /* Non-blocking mode only below here */
52
53         /*
54          * The existence of these should never be relied upon - they should only
55          * be used for user feedback or similar purposes.
56          */
57         CONNECTION_STARTED,                     /* Waiting for connection to be made.  */
58         CONNECTION_MADE,                        /* Connection OK; waiting to send.     */
59         CONNECTION_AWAITING_RESPONSE,           /* Waiting for a response from the
60                                                                                  * postmaster.        */
61         CONNECTION_AUTH_OK,                     /* Received authentication; waiting for
62                                                                  * backend startup. */
63         CONNECTION_SETENV,                      /* Negotiating environment. */
64         CONNECTION_SSL_STARTUP,         /* Negotiating SSL. */
65         CONNECTION_NEEDED                       /* Internal state: connect() needed */
66 } ConnStatusType;
67
68 typedef enum
69 {
70         PGRES_POLLING_FAILED = 0,
71         PGRES_POLLING_READING,          /* These two indicate that one may        */
72         PGRES_POLLING_WRITING,          /* use select before polling again.   */
73         PGRES_POLLING_OK,
74         PGRES_POLLING_ACTIVE            /* unused; keep for awhile for backwards
75                                                                  * compatibility */
76 } PostgresPollingStatusType;
77
78 typedef enum
79 {
80         PGRES_EMPTY_QUERY = 0,          /* empty query string was executed */
81         PGRES_COMMAND_OK,                       /* a query command that doesn't return
82                                                                  * anything was executed properly by the
83                                                                  * backend */
84         PGRES_TUPLES_OK,                        /* a query command that returns tuples was
85                                                                  * executed properly by the backend, PGresult
86                                                                  * contains the result tuples */
87         PGRES_COPY_OUT,                         /* Copy Out data transfer in progress */
88         PGRES_COPY_IN,                          /* Copy In data transfer in progress */
89         PGRES_BAD_RESPONSE,                     /* an unexpected response was recv'd from the
90                                                                  * backend */
91         PGRES_NONFATAL_ERROR,           /* notice or warning message */
92         PGRES_FATAL_ERROR,                      /* query failed */
93         PGRES_COPY_BOTH,                        /* Copy In/Out data transfer in progress */
94         PGRES_SINGLE_TUPLE                      /* single tuple from larger resultset */
95 } ExecStatusType;
96
97 typedef enum
98 {
99         PQTRANS_IDLE,                           /* connection idle */
100         PQTRANS_ACTIVE,                         /* command in progress */
101         PQTRANS_INTRANS,                        /* idle, within transaction block */
102         PQTRANS_INERROR,                        /* idle, within failed transaction */
103         PQTRANS_UNKNOWN                         /* cannot determine status */
104 } PGTransactionStatusType;
105
106 typedef enum
107 {
108         PQERRORS_TERSE,                         /* single-line error messages */
109         PQERRORS_DEFAULT,                       /* recommended style */
110         PQERRORS_VERBOSE                        /* all the facts, ma'am */
111 } PGVerbosity;
112
113 /*
114  * PGPing - The ordering of this enum should not be altered because the
115  * values are exposed externally via pg_isready.
116  */
117
118 typedef enum
119 {
120         PQPING_OK,                                      /* server is accepting connections */
121         PQPING_REJECT,                          /* server is alive but rejecting connections */
122         PQPING_NO_RESPONSE,                     /* could not establish connection */
123         PQPING_NO_ATTEMPT                       /* connection not attempted (bad params) */
124 } PGPing;
125
126 /* PGconn encapsulates a connection to the backend.
127  * The contents of this struct are not supposed to be known to applications.
128  */
129 typedef struct pg_conn PGconn;
130
131 /* PGresult encapsulates the result of a query (or more precisely, of a single
132  * SQL command --- a query string given to PQsendQuery can contain multiple
133  * commands and thus return multiple PGresult objects).
134  * The contents of this struct are not supposed to be known to applications.
135  */
136 typedef struct pg_result PGresult;
137
138 /* PGcancel encapsulates the information needed to cancel a running
139  * query on an existing connection.
140  * The contents of this struct are not supposed to be known to applications.
141  */
142 typedef struct pg_cancel PGcancel;
143
144 /* PGnotify represents the occurrence of a NOTIFY message.
145  * Ideally this would be an opaque typedef, but it's so simple that it's
146  * unlikely to change.
147  * NOTE: in Postgres 6.4 and later, the be_pid is the notifying backend's,
148  * whereas in earlier versions it was always your own backend's PID.
149  */
150 typedef struct pgNotify
151 {
152         char       *relname;            /* notification condition name */
153         int                     be_pid;                 /* process ID of notifying server process */
154         char       *extra;                      /* notification parameter */
155         /* Fields below here are private to libpq; apps should not use 'em */
156         struct pgNotify *next;          /* list link */
157 } PGnotify;
158
159 /* Function types for notice-handling callbacks */
160 typedef void (*PQnoticeReceiver) (void *arg, const PGresult *res);
161 typedef void (*PQnoticeProcessor) (void *arg, const char *message);
162
163 /* Print options for PQprint() */
164 typedef char pqbool;
165
166 typedef struct _PQprintOpt
167 {
168         pqbool          header;                 /* print output field headings and row count */
169         pqbool          align;                  /* fill align the fields */
170         pqbool          standard;               /* old brain dead format */
171         pqbool          html3;                  /* output html tables */
172         pqbool          expanded;               /* expand tables */
173         pqbool          pager;                  /* use pager for output if needed */
174         char       *fieldSep;           /* field separator */
175         char       *tableOpt;           /* insert to HTML <table ...> */
176         char       *caption;            /* HTML <caption> */
177         char      **fieldName;          /* null terminated array of replacement field
178                                                                  * names */
179 } PQprintOpt;
180
181 /* ----------------
182  * Structure for the conninfo parameter definitions returned by PQconndefaults
183  * or PQconninfoParse.
184  *
185  * All fields except "val" point at static strings which must not be altered.
186  * "val" is either NULL or a malloc'd current-value string.  PQconninfoFree()
187  * will release both the val strings and the PQconninfoOption array itself.
188  * ----------------
189  */
190 typedef struct _PQconninfoOption
191 {
192         char       *keyword;            /* The keyword of the option                    */
193         char       *envvar;                     /* Fallback environment variable name   */
194         char       *compiled;           /* Fallback compiled in default value   */
195         char       *val;                        /* Option's current value, or NULL               */
196         char       *label;                      /* Label for field in connect dialog    */
197         char       *dispchar;           /* Indicates how to display this field in a
198                                                                  * connect dialog. Values are: "" Display
199                                                                  * entered value as is "*" Password field -
200                                                                  * hide value "D"  Debug option - don't show
201                                                                  * by default */
202         int                     dispsize;               /* Field size in characters for dialog  */
203 } PQconninfoOption;
204
205 /* ----------------
206  * PQArgBlock -- structure for PQfn() arguments
207  * ----------------
208  */
209 typedef struct
210 {
211         int                     len;
212         int                     isint;
213         union
214         {
215                 int                *ptr;                /* can't use void (dec compiler barfs)   */
216                 int                     integer;
217         }                       u;
218 } PQArgBlock;
219
220 /* ----------------
221  * PGresAttDesc -- Data about a single attribute (column) of a query result
222  * ----------------
223  */
224 typedef struct pgresAttDesc
225 {
226         char       *name;                       /* column name */
227         Oid                     tableid;                /* source table, if known */
228         int                     columnid;               /* source column, if known */
229         int                     format;                 /* format code for value (text/binary) */
230         Oid                     typid;                  /* type id */
231         int                     typlen;                 /* type size */
232         int                     atttypmod;              /* type-specific modifier info */
233 } PGresAttDesc;
234
235 /* ----------------
236  * Exported functions of libpq
237  * ----------------
238  */
239
240 /* ===  in fe-connect.c === */
241
242 /* make a new client connection to the backend */
243 /* Asynchronous (non-blocking) */
244 extern PGconn *PQconnectStart(const char *conninfo);
245 extern PGconn *PQconnectStartParams(const char *const * keywords,
246                                          const char *const * values, int expand_dbname);
247 extern PostgresPollingStatusType PQconnectPoll(PGconn *conn);
248
249 /* Synchronous (blocking) */
250 extern PGconn *PQconnectdb(const char *conninfo);
251 extern PGconn *PQconnectdbParams(const char *const * keywords,
252                                   const char *const * values, int expand_dbname);
253 extern PGconn *PQsetdbLogin(const char *pghost, const char *pgport,
254                          const char *pgoptions, const char *pgtty,
255                          const char *dbName,
256                          const char *login, const char *pwd);
257
258 #define PQsetdb(M_PGHOST,M_PGPORT,M_PGOPT,M_PGTTY,M_DBNAME)  \
259         PQsetdbLogin(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME, NULL, NULL)
260
261 /* close the current connection and free the PGconn data structure */
262 extern void PQfinish(PGconn *conn);
263
264 /* get info about connection options known to PQconnectdb */
265 extern PQconninfoOption *PQconndefaults(void);
266
267 /* parse connection options in same way as PQconnectdb */
268 extern PQconninfoOption *PQconninfoParse(const char *conninfo, char **errmsg);
269
270 /* return the connection options used by a live connection */
271 extern PQconninfoOption *PQconninfo(PGconn *conn);
272
273 /* free the data structure returned by PQconndefaults() or PQconninfoParse() */
274 extern void PQconninfoFree(PQconninfoOption *connOptions);
275
276 /*
277  * close the current connection and restablish a new one with the same
278  * parameters
279  */
280 /* Asynchronous (non-blocking) */
281 extern int      PQresetStart(PGconn *conn);
282 extern PostgresPollingStatusType PQresetPoll(PGconn *conn);
283
284 /* Synchronous (blocking) */
285 extern void PQreset(PGconn *conn);
286
287 /* request a cancel structure */
288 extern PGcancel *PQgetCancel(PGconn *conn);
289
290 /* free a cancel structure */
291 extern void PQfreeCancel(PGcancel *cancel);
292
293 /* issue a cancel request */
294 extern int      PQcancel(PGcancel *cancel, char *errbuf, int errbufsize);
295
296 /* backwards compatible version of PQcancel; not thread-safe */
297 extern int      PQrequestCancel(PGconn *conn);
298
299 /* Accessor functions for PGconn objects */
300 extern char *PQdb(const PGconn *conn);
301 extern char *PQuser(const PGconn *conn);
302 extern char *PQpass(const PGconn *conn);
303 extern char *PQhost(const PGconn *conn);
304 extern char *PQhostaddr(const PGconn *conn);
305 extern char *PQport(const PGconn *conn);
306 extern char *PQtty(const PGconn *conn);
307 extern char *PQoptions(const PGconn *conn);
308 extern ConnStatusType PQstatus(const PGconn *conn);
309 extern PGTransactionStatusType PQtransactionStatus(const PGconn *conn);
310 extern const char *PQparameterStatus(const PGconn *conn,
311                                   const char *paramName);
312 extern int      PQprotocolVersion(const PGconn *conn);
313 extern int      PQserverVersion(const PGconn *conn);
314 extern char *PQerrorMessage(const PGconn *conn);
315 extern int      PQsocket(const PGconn *conn);
316 extern int      PQbackendPID(const PGconn *conn);
317 extern int      PQconnectionNeedsPassword(const PGconn *conn);
318 extern int      PQconnectionUsedPassword(const PGconn *conn);
319 extern int      PQclientEncoding(const PGconn *conn);
320 extern int      PQsetClientEncoding(PGconn *conn, const char *encoding);
321
322 /* Get the OpenSSL structure associated with a connection. Returns NULL for
323  * unencrypted connections or if any other TLS library is in use. */
324 extern void *PQgetssl(PGconn *conn);
325
326 /* Tell libpq whether it needs to initialize OpenSSL */
327 extern void PQinitSSL(int do_init);
328
329 /* More detailed way to tell libpq whether it needs to initialize OpenSSL */
330 extern void PQinitOpenSSL(int do_ssl, int do_crypto);
331
332 /* Set verbosity for PQerrorMessage and PQresultErrorMessage */
333 extern PGVerbosity PQsetErrorVerbosity(PGconn *conn, PGVerbosity verbosity);
334
335 /* Enable/disable tracing */
336 extern void PQtrace(PGconn *conn, FILE *debug_port);
337 extern void PQuntrace(PGconn *conn);
338
339 /* Override default notice handling routines */
340 extern PQnoticeReceiver PQsetNoticeReceiver(PGconn *conn,
341                                         PQnoticeReceiver proc,
342                                         void *arg);
343 extern PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn,
344                                          PQnoticeProcessor proc,
345                                          void *arg);
346
347 /*
348  *         Used to set callback that prevents concurrent access to
349  *         non-thread safe functions that libpq needs.
350  *         The default implementation uses a libpq internal mutex.
351  *         Only required for multithreaded apps that use kerberos
352  *         both within their app and for postgresql connections.
353  */
354 typedef void (*pgthreadlock_t) (int acquire);
355
356 extern pgthreadlock_t PQregisterThreadLock(pgthreadlock_t newhandler);
357
358 /* === in fe-exec.c === */
359
360 /* Simple synchronous query */
361 extern PGresult *PQexec(PGconn *conn, const char *query);
362 extern PGresult *PQexecParams(PGconn *conn,
363                          const char *command,
364                          int nParams,
365                          const Oid *paramTypes,
366                          const char *const * paramValues,
367                          const int *paramLengths,
368                          const int *paramFormats,
369                          int resultFormat);
370 extern PGresult *PQprepare(PGconn *conn, const char *stmtName,
371                   const char *query, int nParams,
372                   const Oid *paramTypes);
373 extern PGresult *PQexecPrepared(PGconn *conn,
374                            const char *stmtName,
375                            int nParams,
376                            const char *const * paramValues,
377                            const int *paramLengths,
378                            const int *paramFormats,
379                            int resultFormat);
380
381 /* Interface for multiple-result or asynchronous queries */
382 extern int      PQsendQuery(PGconn *conn, const char *query);
383 extern int PQsendQueryParams(PGconn *conn,
384                                   const char *command,
385                                   int nParams,
386                                   const Oid *paramTypes,
387                                   const char *const * paramValues,
388                                   const int *paramLengths,
389                                   const int *paramFormats,
390                                   int resultFormat);
391 extern int PQsendPrepare(PGconn *conn, const char *stmtName,
392                           const char *query, int nParams,
393                           const Oid *paramTypes);
394 extern int PQsendQueryPrepared(PGconn *conn,
395                                         const char *stmtName,
396                                         int nParams,
397                                         const char *const * paramValues,
398                                         const int *paramLengths,
399                                         const int *paramFormats,
400                                         int resultFormat);
401 extern int      PQsetSingleRowMode(PGconn *conn);
402 extern PGresult *PQgetResult(PGconn *conn);
403
404 /* Routines for managing an asynchronous query */
405 extern int      PQisBusy(PGconn *conn);
406 extern int      PQconsumeInput(PGconn *conn);
407
408 /* LISTEN/NOTIFY support */
409 extern PGnotify *PQnotifies(PGconn *conn);
410
411 /* Routines for copy in/out */
412 extern int      PQputCopyData(PGconn *conn, const char *buffer, int nbytes);
413 extern int      PQputCopyEnd(PGconn *conn, const char *errormsg);
414 extern int      PQgetCopyData(PGconn *conn, char **buffer, int async);
415
416 /* Deprecated routines for copy in/out */
417 extern int      PQgetline(PGconn *conn, char *string, int length);
418 extern int      PQputline(PGconn *conn, const char *string);
419 extern int      PQgetlineAsync(PGconn *conn, char *buffer, int bufsize);
420 extern int      PQputnbytes(PGconn *conn, const char *buffer, int nbytes);
421 extern int      PQendcopy(PGconn *conn);
422
423 /* Set blocking/nonblocking connection to the backend */
424 extern int      PQsetnonblocking(PGconn *conn, int arg);
425 extern int      PQisnonblocking(const PGconn *conn);
426 extern int      PQisthreadsafe(void);
427 extern PGPing PQping(const char *conninfo);
428 extern PGPing PQpingParams(const char *const * keywords,
429                          const char *const * values, int expand_dbname);
430
431 /* Force the write buffer to be written (or at least try) */
432 extern int      PQflush(PGconn *conn);
433
434 /*
435  * "Fast path" interface --- not really recommended for application
436  * use
437  */
438 extern PGresult *PQfn(PGconn *conn,
439          int fnid,
440          int *result_buf,
441          int *result_len,
442          int result_is_int,
443          const PQArgBlock *args,
444          int nargs);
445
446 /* Accessor functions for PGresult objects */
447 extern ExecStatusType PQresultStatus(const PGresult *res);
448 extern char *PQresStatus(ExecStatusType status);
449 extern char *PQresultErrorMessage(const PGresult *res);
450 extern char *PQresultErrorField(const PGresult *res, int fieldcode);
451 extern int      PQntuples(const PGresult *res);
452 extern int      PQnfields(const PGresult *res);
453 extern int      PQbinaryTuples(const PGresult *res);
454 extern char *PQfname(const PGresult *res, int field_num);
455 extern int      PQfnumber(const PGresult *res, const char *field_name);
456 extern Oid      PQftable(const PGresult *res, int field_num);
457 extern int      PQftablecol(const PGresult *res, int field_num);
458 extern int      PQfformat(const PGresult *res, int field_num);
459 extern Oid      PQftype(const PGresult *res, int field_num);
460 extern int      PQfsize(const PGresult *res, int field_num);
461 extern int      PQfmod(const PGresult *res, int field_num);
462 extern char *PQcmdStatus(PGresult *res);
463 extern char *PQoidStatus(const PGresult *res);  /* old and ugly */
464 extern Oid      PQoidValue(const PGresult *res);        /* new and improved */
465 extern char *PQcmdTuples(PGresult *res);
466 extern char *PQgetvalue(const PGresult *res, int tup_num, int field_num);
467 extern int      PQgetlength(const PGresult *res, int tup_num, int field_num);
468 extern int      PQgetisnull(const PGresult *res, int tup_num, int field_num);
469 extern int      PQnparams(const PGresult *res);
470 extern Oid      PQparamtype(const PGresult *res, int param_num);
471
472 /* Describe prepared statements and portals */
473 extern PGresult *PQdescribePrepared(PGconn *conn, const char *stmt);
474 extern PGresult *PQdescribePortal(PGconn *conn, const char *portal);
475 extern int      PQsendDescribePrepared(PGconn *conn, const char *stmt);
476 extern int      PQsendDescribePortal(PGconn *conn, const char *portal);
477
478 /* Delete a PGresult */
479 extern void PQclear(PGresult *res);
480
481 /* For freeing other alloc'd results, such as PGnotify structs */
482 extern void PQfreemem(void *ptr);
483
484 /* Exists for backward compatibility.  bjm 2003-03-24 */
485 #define PQfreeNotify(ptr) PQfreemem(ptr)
486
487 /* Error when no password was given. */
488 /* Note: depending on this is deprecated; use PQconnectionNeedsPassword(). */
489 #define PQnoPasswordSupplied    "fe_sendauth: no password supplied\n"
490
491 /* Create and manipulate PGresults */
492 extern PGresult *PQmakeEmptyPGresult(PGconn *conn, ExecStatusType status);
493 extern PGresult *PQcopyResult(const PGresult *src, int flags);
494 extern int      PQsetResultAttrs(PGresult *res, int numAttributes, PGresAttDesc *attDescs);
495 extern void *PQresultAlloc(PGresult *res, size_t nBytes);
496 extern int      PQsetvalue(PGresult *res, int tup_num, int field_num, char *value, int len);
497
498 /* Quoting strings before inclusion in queries. */
499 extern size_t PQescapeStringConn(PGconn *conn,
500                                    char *to, const char *from, size_t length,
501                                    int *error);
502 extern char *PQescapeLiteral(PGconn *conn, const char *str, size_t len);
503 extern char *PQescapeIdentifier(PGconn *conn, const char *str, size_t len);
504 extern unsigned char *PQescapeByteaConn(PGconn *conn,
505                                   const unsigned char *from, size_t from_length,
506                                   size_t *to_length);
507 extern unsigned char *PQunescapeBytea(const unsigned char *strtext,
508                                 size_t *retbuflen);
509
510 /* These forms are deprecated! */
511 extern size_t PQescapeString(char *to, const char *from, size_t length);
512 extern unsigned char *PQescapeBytea(const unsigned char *from, size_t from_length,
513                           size_t *to_length);
514
515
516
517 /* === in fe-print.c === */
518
519 extern void PQprint(FILE *fout,                         /* output stream */
520                 const PGresult *res,
521                 const PQprintOpt *ps);  /* option structure */
522
523 /*
524  * really old printing routines
525  */
526 extern void PQdisplayTuples(const PGresult *res,
527                                 FILE *fp,               /* where to send the output */
528                                 int fillAlign,  /* pad the fields with spaces */
529                                 const char *fieldSep,   /* field separator */
530                                 int printHeader,        /* display headers? */
531                                 int quiet);
532
533 extern void PQprintTuples(const PGresult *res,
534                           FILE *fout,           /* output stream */
535                           int printAttName, /* print attribute names */
536                           int terseOutput,      /* delimiter bars */
537                           int width);           /* width of column, if 0, use variable width */
538
539
540 /* === in fe-lobj.c === */
541
542 /* Large-object access routines */
543 extern int      lo_open(PGconn *conn, Oid lobjId, int mode);
544 extern int      lo_close(PGconn *conn, int fd);
545 extern int      lo_read(PGconn *conn, int fd, char *buf, size_t len);
546 extern int      lo_write(PGconn *conn, int fd, const char *buf, size_t len);
547 extern int      lo_lseek(PGconn *conn, int fd, int offset, int whence);
548 extern pg_int64 lo_lseek64(PGconn *conn, int fd, pg_int64 offset, int whence);
549 extern Oid      lo_creat(PGconn *conn, int mode);
550 extern Oid      lo_create(PGconn *conn, Oid lobjId);
551 extern int      lo_tell(PGconn *conn, int fd);
552 extern pg_int64 lo_tell64(PGconn *conn, int fd);
553 extern int      lo_truncate(PGconn *conn, int fd, size_t len);
554 extern int      lo_truncate64(PGconn *conn, int fd, pg_int64 len);
555 extern int      lo_unlink(PGconn *conn, Oid lobjId);
556 extern Oid      lo_import(PGconn *conn, const char *filename);
557 extern Oid      lo_import_with_oid(PGconn *conn, const char *filename, Oid lobjId);
558 extern int      lo_export(PGconn *conn, Oid lobjId, const char *filename);
559
560 /* === in fe-misc.c === */
561
562 /* Get the version of the libpq library in use */
563 extern int      PQlibVersion(void);
564
565 /* Determine length of multibyte encoded char at *s */
566 extern int      PQmblen(const char *s, int encoding);
567
568 /* Determine display length of multibyte encoded char at *s */
569 extern int      PQdsplen(const char *s, int encoding);
570
571 /* Get encoding id from environment variable PGCLIENTENCODING */
572 extern int      PQenv2encoding(void);
573
574 /* === in fe-auth.c === */
575
576 extern char *PQencryptPassword(const char *passwd, const char *user);
577
578 /* === in encnames.c === */
579
580 extern int      pg_char_to_encoding(const char *name);
581 extern const char *pg_encoding_to_char(int encoding);
582 extern int      pg_valid_server_encoding_id(int encoding);
583
584 #ifdef __cplusplus
585 }
586 #endif
587
588 #endif   /* LIBPQ_FE_H */