23#define PSQLHISTORY ".psql_history"
25#define PSQLHISTORY "psql_history"
47#define NL_IN_HISTORY 0x01
81#ifdef HAVE_RL_RESET_SCREEN_SIZE
119 if (!s[0] || s[
strlen(s) - 1] !=
'\n')
144 for (
i =
strlen(s) - 1;
i >= 0 && s[
i] ==
'\n';
i--)
230 if (buffer->
len > 0 && buffer->
data[buffer->
len - 1] ==
'\n')
232 buffer->
data[buffer->
len - 1] =
'\0';
277#define BEGIN_ITERATE_HISTORY(VARNAME) \
279 HIST_ENTRY *VARNAME; \
282 history_set_pos(0); \
283 use_prev_ = (previous_history() != NULL); \
284 history_set_pos(0); \
285 for (VARNAME = current_history(); VARNAME != NULL; \
286 VARNAME = use_prev_ ? previous_history() : next_history()) \
290#define END_ITERATE_HISTORY() \
357#ifdef HAVE_RL_VARIABLE_BIND
440#if defined(HAVE_HISTORY_TRUNCATE_FILE) && defined(HAVE_APPEND_HISTORY)
476 pg_log_error(
"could not save history to file \"%s\": %m", fname);
514 pg_log_error(
"could not save history to file \"%s\": %m", fname);
533 pg_log_error(
"history is not supported by this installation");
void expand_tilde(char **filename)
volatile sig_atomic_t sigint_interrupt_enabled
#define fprintf(file, fmt, msg)
char * pg_strdup(const char *in)
FILE * PageOutput(int lines, const printTableOpt *topt)
void ClosePager(FILE *pagerpipe)
#define pg_log_error(...)
static rewind_source * source
bool get_home_path(char *ret_path)
PQExpBuffer createPQExpBuffer(void)
void resetPQExpBuffer(PQExpBuffer str)
void appendPQExpBufferChar(PQExpBuffer str, char ch)
void appendPQExpBufferStr(PQExpBuffer str, const char *data)
#define PQExpBufferBroken(str)
static int fd(const char *x, int i)
char * psprintf(const char *fmt,...)
void initialize_readline(void)
PQExpBuffer tab_completion_query_buf
const char * GetVariable(VariableSpace space, const char *name)