mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-28 15:21:48 +02:00
f67b113ac6
Patch adds \if to pgbench as it done for psql. Implementation shares condition stack code with psql, so, this code is moved to fe_utils directory. Author: Fabien COELHO with minor editorization by me Review by: Vik Fearing, Fedor Sigaev Discussion: https://www.postgresql.org/message-id/flat/alpine.DEB.2.20.1711252200190.28523@lancre
47 lines
1.1 KiB
C
47 lines
1.1 KiB
C
/*
|
|
* psql - the PostgreSQL interactive terminal
|
|
*
|
|
* Copyright (c) 2000-2018, PostgreSQL Global Development Group
|
|
*
|
|
* src/bin/psql/command.h
|
|
*/
|
|
#ifndef COMMAND_H
|
|
#define COMMAND_H
|
|
|
|
#include "fe_utils/print.h"
|
|
#include "fe_utils/psqlscan.h"
|
|
#include "fe_utils/conditional.h"
|
|
|
|
|
|
typedef enum _backslashResult
|
|
{
|
|
PSQL_CMD_UNKNOWN = 0, /* not done parsing yet (internal only) */
|
|
PSQL_CMD_SEND, /* query complete; send off */
|
|
PSQL_CMD_SKIP_LINE, /* keep building query */
|
|
PSQL_CMD_TERMINATE, /* quit program */
|
|
PSQL_CMD_NEWEDIT, /* query buffer was changed (e.g., via \e) */
|
|
PSQL_CMD_ERROR /* the execution of the backslash command
|
|
* resulted in an error */
|
|
} backslashResult;
|
|
|
|
|
|
extern backslashResult HandleSlashCmds(PsqlScanState scan_state,
|
|
ConditionalStack cstack,
|
|
PQExpBuffer query_buf,
|
|
PQExpBuffer previous_buf);
|
|
|
|
extern int process_file(char *filename, bool use_relative_path);
|
|
|
|
extern bool do_pset(const char *param,
|
|
const char *value,
|
|
printQueryOpt *popt,
|
|
bool quiet);
|
|
|
|
extern void connection_warnings(bool in_startup);
|
|
|
|
extern void SyncVariables(void);
|
|
|
|
extern void UnsyncVariables(void);
|
|
|
|
#endif /* COMMAND_H */
|