2 * psql - the PostgreSQL interactive terminal
4 * Copyright (c) 2000-2025, PostgreSQL Global Development Group
6 * src/bin/psql/command.h
11 #include "fe_utils/conditional.h"
12 #include "fe_utils/print.h"
13 #include "fe_utils/psqlscan.h"
15 typedef enum _backslashResult
17 PSQL_CMD_UNKNOWN
= 0, /* not done parsing yet (internal only) */
18 PSQL_CMD_SEND
, /* query complete; send off */
19 PSQL_CMD_SKIP_LINE
, /* keep building query */
20 PSQL_CMD_TERMINATE
, /* quit program */
21 PSQL_CMD_NEWEDIT
, /* query buffer was changed (e.g., via \e) */
22 PSQL_CMD_ERROR
, /* the execution of the backslash command
23 * resulted in an error */
27 extern backslashResult
HandleSlashCmds(PsqlScanState scan_state
,
28 ConditionalStack cstack
,
29 PQExpBuffer query_buf
,
30 PQExpBuffer previous_buf
);
32 extern int process_file(char *filename
, bool use_relative_path
);
34 extern bool do_pset(const char *param
,
39 extern printQueryOpt
*savePsetInfo(const printQueryOpt
*popt
);
41 extern void restorePsetInfo(printQueryOpt
*popt
, printQueryOpt
*save
);
43 extern void connection_warnings(bool in_startup
);
45 extern void SyncVariables(void);
47 extern void UnsyncVariables(void);
49 #endif /* COMMAND_H */