1/*-------------------------------------------------------------------------
3 * Facilities for frontend code to connect to and disconnect from databases.
5 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
6 * Portions Copyright (c) 1994, Regents of the University of California
8 * src/include/fe_utils/connect_utils.h
10 *-------------------------------------------------------------------------
12#ifndef CONNECT_UTILS_H
13#define CONNECT_UTILS_H
24/* Parameters needed by connectDatabase/connectMaintenanceDatabase */
27 /* These fields record the actual command line parameters */
28 const char *
dbname;
/* this may be a connstring! */
33 /* If not NULL, this overrides the dbname obtained from command line */
34 /* (but *only* the DB name, not anything else in the connstring) */
40 bool echo,
bool fail_ok,
41 bool allow_password_reuse);
48#endif /* CONNECT_UTILS_H */
void disconnectDatabase(PGconn *conn)
struct _connParams ConnParams
PGconn * connectMaintenanceDatabase(ConnParams *cparams, const char *progname, bool echo)
PGconn * connectDatabase(const ConnParams *cparams, const char *progname, bool echo, bool fail_ok, bool allow_password_reuse)
const char * override_dbname
enum trivalue prompt_password