PostgreSQL Source Code git master
|
#include "postgres_fe.h"
#include <ctype.h>
#include <time.h>
#include <pwd.h>
#include <utime.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "catalog/pg_class_d.h"
#include "command.h"
#include "common.h"
#include "common/logging.h"
#include "common/string.h"
#include "copy.h"
#include "describe.h"
#include "fe_utils/cancel.h"
#include "fe_utils/print.h"
#include "fe_utils/string_utils.h"
#include "help.h"
#include "input.h"
#include "large_obj.h"
#include "libpq/pqcomm.h"
#include "mainloop.h"
#include "pqexpbuffer.h"
#include "psqlscanslash.h"
#include "settings.h"
#include "variables.h"
Go to the source code of this file.
Macros | |
#define | DEFAULT_SHELL "/bin/sh" |
Typedefs | |
typedef enum EditableObjectType | EditableObjectType |
Enumerations | |
enum | EditableObjectType { EditableFunction , EditableView } |
Functions | |
static backslashResult | exec_command (const char *cmd, PsqlScanState scan_state, ConditionalStack cstack, PQExpBuffer query_buf, PQExpBuffer previous_buf) |
static backslashResult | exec_command_a (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_bind (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_bind_named (PsqlScanState scan_state, bool active_branch, const char *cmd) |
static backslashResult | exec_command_C (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_connect (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_cd (PsqlScanState scan_state, bool active_branch, const char *cmd) |
static backslashResult | exec_command_close (PsqlScanState scan_state, bool active_branch, const char *cmd) |
static backslashResult | exec_command_conninfo (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_copy (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_copyright (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_crosstabview (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_d (PsqlScanState scan_state, bool active_branch, const char *cmd) |
static bool | exec_command_dfo (PsqlScanState scan_state, const char *cmd, const char *pattern, bool show_verbose, bool show_system) |
static backslashResult | exec_command_edit (PsqlScanState scan_state, bool active_branch, PQExpBuffer query_buf, PQExpBuffer previous_buf) |
static backslashResult | exec_command_ef_ev (PsqlScanState scan_state, bool active_branch, PQExpBuffer query_buf, bool is_func) |
static backslashResult | exec_command_echo (PsqlScanState scan_state, bool active_branch, const char *cmd) |
static backslashResult | exec_command_elif (PsqlScanState scan_state, ConditionalStack cstack, PQExpBuffer query_buf) |
static backslashResult | exec_command_else (PsqlScanState scan_state, ConditionalStack cstack, PQExpBuffer query_buf) |
static backslashResult | exec_command_endif (PsqlScanState scan_state, ConditionalStack cstack, PQExpBuffer query_buf) |
static backslashResult | exec_command_endpipeline (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_encoding (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_errverbose (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_f (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_flush (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_flushrequest (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_g (PsqlScanState scan_state, bool active_branch, const char *cmd) |
static backslashResult | process_command_g_options (char *first_option, PsqlScanState scan_state, bool active_branch, const char *cmd) |
static backslashResult | exec_command_gdesc (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_getenv (PsqlScanState scan_state, bool active_branch, const char *cmd) |
static backslashResult | exec_command_gexec (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_getresults (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_gset (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_help (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_html (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_include (PsqlScanState scan_state, bool active_branch, const char *cmd) |
static backslashResult | exec_command_if (PsqlScanState scan_state, ConditionalStack cstack, PQExpBuffer query_buf) |
static backslashResult | exec_command_list (PsqlScanState scan_state, bool active_branch, const char *cmd) |
static backslashResult | exec_command_lo (PsqlScanState scan_state, bool active_branch, const char *cmd) |
static backslashResult | exec_command_out (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_print (PsqlScanState scan_state, bool active_branch, PQExpBuffer query_buf, PQExpBuffer previous_buf) |
static backslashResult | exec_command_parse (PsqlScanState scan_state, bool active_branch, const char *cmd) |
static backslashResult | exec_command_password (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_prompt (PsqlScanState scan_state, bool active_branch, const char *cmd) |
static backslashResult | exec_command_pset (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_quit (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_reset (PsqlScanState scan_state, bool active_branch, PQExpBuffer query_buf) |
static backslashResult | exec_command_s (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_sendpipeline (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_set (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_setenv (PsqlScanState scan_state, bool active_branch, const char *cmd) |
static backslashResult | exec_command_sf_sv (PsqlScanState scan_state, bool active_branch, const char *cmd, bool is_func) |
static backslashResult | exec_command_startpipeline (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_syncpipeline (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_t (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_T (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_timing (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_unset (PsqlScanState scan_state, bool active_branch, const char *cmd) |
static backslashResult | exec_command_write (PsqlScanState scan_state, bool active_branch, const char *cmd, PQExpBuffer query_buf, PQExpBuffer previous_buf) |
static backslashResult | exec_command_watch (PsqlScanState scan_state, bool active_branch, PQExpBuffer query_buf, PQExpBuffer previous_buf) |
static backslashResult | exec_command_x (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_z (PsqlScanState scan_state, bool active_branch, const char *cmd) |
static backslashResult | exec_command_shell_escape (PsqlScanState scan_state, bool active_branch) |
static backslashResult | exec_command_slash_command_help (PsqlScanState scan_state, bool active_branch) |
static char * | read_connect_arg (PsqlScanState scan_state) |
static PQExpBuffer | gather_boolean_expression (PsqlScanState scan_state) |
static bool | is_true_boolean_expression (PsqlScanState scan_state, const char *name) |
static void | ignore_boolean_expression (PsqlScanState scan_state) |
static void | ignore_slash_options (PsqlScanState scan_state) |
static void | ignore_slash_filepipe (PsqlScanState scan_state) |
static void | ignore_slash_whole_line (PsqlScanState scan_state) |
static bool | is_branching_command (const char *cmd) |
static void | save_query_text_state (PsqlScanState scan_state, ConditionalStack cstack, PQExpBuffer query_buf) |
static void | discard_query_text (PsqlScanState scan_state, ConditionalStack cstack, PQExpBuffer query_buf) |
static bool | copy_previous_query (PQExpBuffer query_buf, PQExpBuffer previous_buf) |
static bool | do_connect (enum trivalue reuse_previous_specification, char *dbname, char *user, char *host, char *port) |
static void | wait_until_connected (PGconn *conn) |
static bool | do_edit (const char *filename_arg, PQExpBuffer query_buf, int lineno, bool discard_on_quit, bool *edited) |
static bool | do_shell (const char *command) |
static bool | do_watch (PQExpBuffer query_buf, double sleep, int iter, int min_rows) |
static bool | lookup_object_oid (EditableObjectType obj_type, const char *desc, Oid *obj_oid) |
static bool | get_create_object_cmd (EditableObjectType obj_type, Oid oid, PQExpBuffer buf) |
static int | strip_lineno_from_objdesc (char *obj) |
static int | count_lines_in_buf (PQExpBuffer buf) |
static void | print_with_linenumbers (FILE *output, char *lines, bool is_func) |
static void | minimal_error_message (PGresult *res) |
static void | printSSLInfo (void) |
static void | printGSSInfo (void) |
static bool | printPsetInfo (const char *param, printQueryOpt *popt) |
static char * | pset_value_string (const char *param, printQueryOpt *popt) |
backslashResult | HandleSlashCmds (PsqlScanState scan_state, ConditionalStack cstack, PQExpBuffer query_buf, PQExpBuffer previous_buf) |
static char * | prompt_for_password (const char *username, bool *canceled) |
static bool | param_is_newly_set (const char *old_val, const char *new_val) |
void | connection_warnings (bool in_startup) |
void | SyncVariables (void) |
void | UnsyncVariables (void) |
static bool | editFile (const char *fname, int lineno) |
int | process_file (char *filename, bool use_relative_path) |
static const char * | _align2string (enum printFormat in) |
static bool | set_unicode_line_style (const char *value, size_t vallen, unicode_linestyle *linestyle) |
static const char * | _unicode_linestyle2string (int linestyle) |
bool | do_pset (const char *param, const char *value, printQueryOpt *popt, bool quiet) |
printQueryOpt * | savePsetInfo (const printQueryOpt *popt) |
void | restorePsetInfo (printQueryOpt *popt, printQueryOpt *save) |
static const char * | pset_bool_string (bool val) |
static char * | pset_quoted_string (const char *str) |
static bool | echo_hidden_command (const char *query) |
typedef enum EditableObjectType EditableObjectType |
enum EditableObjectType |
Enumerator | |
---|---|
EditableFunction | |
EditableView |
|
static |
Definition at line 4885 of file command.c.
References PRINT_ALIGNED, PRINT_ASCIIDOC, PRINT_CSV, PRINT_HTML, PRINT_LATEX, PRINT_LATEX_LONGTABLE, PRINT_NOTHING, PRINT_TROFF_MS, PRINT_UNALIGNED, and PRINT_WRAPPED.
Referenced by printPsetInfo(), and pset_value_string().
|
static |
Definition at line 4941 of file command.c.
References UNICODE_LINESTYLE_DOUBLE, and UNICODE_LINESTYLE_SINGLE.
Referenced by printPsetInfo(), and pset_value_string().
void connection_warnings | ( | bool | in_startup | ) |
Definition at line 4348 of file command.c.
References _, _psqlSettings::db, formatPGVersionNumber(), _psqlSettings::notty, PQparameterStatus(), printf, printGSSInfo(), printSSLInfo(), _psqlSettings::progname, pset, _psqlSettings::quiet, server_version, and _psqlSettings::sversion.
Referenced by CheckConnection(), do_connect(), and main().
|
static |
Definition at line 3753 of file command.c.
References appendPQExpBufferStr(), PQExpBufferData::data, and PQExpBufferData::len.
Referenced by exec_command(), exec_command_edit(), and exec_command_watch().
|
static |
Definition at line 6322 of file command.c.
References buf.
Referenced by exec_command_sf_sv().
|
static |
Definition at line 3727 of file command.c.
References Assert(), conditional_stack_get_paren_depth(), conditional_stack_get_query_len(), PQExpBufferData::data, PQExpBufferData::len, len, and psql_scan_set_paren_depth().
Referenced by exec_command_elif(), exec_command_else(), and exec_command_endif().
|
static |
Definition at line 3822 of file command.c.
References _, Assert(), CONNECTION_OK, connection_warnings(), _psqlSettings::cur_cmd_interactive, _psqlSettings::db, dbname, _psqlSettings::dead_conn, errmsg(), _psqlSettings::getPassword, is_unixsock_path(), _PQconninfoOption::keyword, keywords, NoticeProcessor(), _psqlSettings::notty, param_is_newly_set(), password, pg_free(), pg_log_error, pg_log_info, pg_malloc(), port, PQconndefaults(), PQconnectionNeedsPassword(), PQconnectStartParams(), PQconninfo(), PQconninfoFree(), PQconninfoParse(), PQdb(), PQerrorMessage(), PQfinish(), PQfreemem(), PQhost(), PQhostaddr(), PQport(), PQsetNoticeProcessor(), PQstatus(), PQuser(), printf, _psqlSettings::progname, prompt_for_password(), pset, _psqlSettings::quiet, recognized_connection_string(), ResetCancelConn(), success, SyncVariables(), TRI_NO, TRI_YES, UnsyncVariables(), user, _PQconninfoOption::val, values, and wait_until_connected().
Referenced by exec_command_connect().
|
static |
Definition at line 4623 of file command.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), before(), PQExpBufferData::data, editFile(), error(), fd(), PQExpBufferData::len, MAXPGPATH, PG_BINARY_R, pg_log_error, resetPQExpBuffer(), snprintf, stat::st_mtime, stat::st_size, stat, and strerror.
Referenced by exec_command_edit(), and exec_command_ef_ev().
bool do_pset | ( | const char * | param, |
const char * | value, | ||
printQueryOpt * | popt, | ||
bool | quiet | ||
) |
Definition at line 4971 of file command.c.
References Assert(), printTableOpt::border, printTableOpt::columns, printTableOpt::csvFieldSep, printTableOpt::default_footer, printTableOpt::expanded, printTableOpt::expanded_header_exact_width, printTableOpt::expanded_header_width_type, printTableOpt::fieldSep, printTableOpt::format, free, i, lengthof, printTableOpt::line_style, name, printQueryOpt::nullPrint, printTableOpt::numericLocale, printTableOpt::pager, printTableOpt::pager_min_lines, ParseVariableBool(), ParseVariableNum(), pg_asciiformat, pg_asciiformat_old, pg_log_error, pg_strcasecmp(), pg_strdup(), pg_strncasecmp(), pg_utf8format, _psqlSettings::popt, PRINT_ALIGNED, PRINT_ASCIIDOC, PRINT_CSV, PRINT_HTML, PRINT_LATEX, PRINT_LATEX_LONGTABLE, PRINT_TROFF_MS, PRINT_UNALIGNED, PRINT_WRAPPED, PRINT_XHEADER_COLUMN, PRINT_XHEADER_EXACT_WIDTH, PRINT_XHEADER_FULL, PRINT_XHEADER_PAGE, printPsetInfo(), pset, PsqlVarEnumError(), printTableOpt::recordSep, refresh_utf8format(), separator::separator, separator::separator_zero, set_unicode_line_style(), printTableOpt::tableAttr, printQueryOpt::title, printQueryOpt::topt, printTableOpt::tuples_only, printTableOpt::unicode_border_linestyle, printTableOpt::unicode_column_linestyle, printTableOpt::unicode_header_linestyle, and value.
Referenced by exec_command_a(), exec_command_C(), exec_command_f(), exec_command_html(), exec_command_pset(), exec_command_t(), exec_command_T(), exec_command_x(), parse_psql_options(), and process_command_g_options().
|
static |
Definition at line 5720 of file command.c.
References DEFAULT_SHELL, free, pg_log_error, psprintf(), and SetShellResultVariables().
Referenced by exec_command_shell_escape().
|
static |
Definition at line 5771 of file command.c.
References _, cancel_pressed, PQExpBufferData::data, disable_sigpipe_trap(), EINTR, fprintf, i, ITIMER_REAL, PQExpBufferData::len, Min, printTableOpt::pager, pg_free(), pg_log_error, pg_malloc(), pg_usleep(), _psqlSettings::popt, pset, PSQLexecWatch(), restore_sigpipe_trap(), setitimer(), SIGALRM, SIGCHLD, sleep_ms, snprintf, generate_unaccent_rules::stdout, printQueryOpt::title, and printQueryOpt::topt.
Referenced by exec_command_watch().
|
static |
Definition at line 6012 of file command.c.
References _, _psqlSettings::echo_hidden, fprintf, _psqlSettings::logfile, printf, pset, PSQL_ECHO_HIDDEN_NOEXEC, PSQL_ECHO_HIDDEN_OFF, and generate_unaccent_rules::stdout.
Referenced by get_create_object_cmd(), and lookup_object_oid().
|
static |
Definition at line 4541 of file command.c.
References Assert(), DEFAULT_EDITOR, DEFAULT_EDITOR_LINENUMBER_ARG, free, pg_log_error, and psprintf().
Referenced by do_edit().
|
static |
Definition at line 298 of file command.c.
References conditional_active(), copy_previous_query(), _psqlSettings::cur_cmd_interactive, exec_command_a(), exec_command_bind(), exec_command_bind_named(), exec_command_C(), exec_command_cd(), exec_command_close(), exec_command_connect(), exec_command_conninfo(), exec_command_copy(), exec_command_copyright(), exec_command_crosstabview(), exec_command_d(), exec_command_echo(), exec_command_edit(), exec_command_ef_ev(), exec_command_elif(), exec_command_else(), exec_command_encoding(), exec_command_endif(), exec_command_endpipeline(), exec_command_errverbose(), exec_command_f(), exec_command_flush(), exec_command_flushrequest(), exec_command_g(), exec_command_gdesc(), exec_command_getenv(), exec_command_getresults(), exec_command_gexec(), exec_command_gset(), exec_command_help(), exec_command_html(), exec_command_if(), exec_command_include(), exec_command_list(), exec_command_lo(), exec_command_out(), exec_command_parse(), exec_command_password(), exec_command_print(), exec_command_prompt(), exec_command_pset(), exec_command_quit(), exec_command_reset(), exec_command_s(), exec_command_sendpipeline(), exec_command_set(), exec_command_setenv(), exec_command_sf_sv(), exec_command_shell_escape(), exec_command_slash_command_help(), exec_command_startpipeline(), exec_command_syncpipeline(), exec_command_t(), exec_command_T(), exec_command_timing(), exec_command_unset(), exec_command_watch(), exec_command_write(), exec_command_x(), exec_command_z(), is_branching_command(), pg_log_warning, pg_strcasecmp(), pset, PSQL_CMD_SEND, and PSQL_CMD_UNKNOWN.
Referenced by HandleSlashCmds().
|
static |
Definition at line 480 of file command.c.
References do_pset(), printTableOpt::format, _psqlSettings::popt, PRINT_ALIGNED, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, _psqlSettings::quiet, success, and printQueryOpt::topt.
Referenced by exec_command().
|
static |
Definition at line 499 of file command.c.
References _psqlSettings::bind_nparams, _psqlSettings::bind_params, clean_extended_state(), ignore_slash_options(), OT_NORMAL, pg_realloc_array, pset, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), PSQL_SEND_EXTENDED_QUERY_PARAMS, and _psqlSettings::send_mode.
Referenced by exec_command().
|
static |
Definition at line 535 of file command.c.
References _psqlSettings::bind_nparams, _psqlSettings::bind_params, clean_extended_state(), ignore_slash_options(), OT_NORMAL, pg_log_error, pg_realloc_array, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), PSQL_SEND_EXTENDED_QUERY_PREPARED, _psqlSettings::send_mode, and _psqlSettings::stmtName.
Referenced by exec_command().
|
static |
Definition at line 584 of file command.c.
References do_pset(), free, ignore_slash_options(), OT_NORMAL, _psqlSettings::popt, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), _psqlSettings::quiet, and success.
Referenced by exec_command().
|
static |
Definition at line 670 of file command.c.
References _, free, ignore_slash_options(), OT_NORMAL, pg_log_error, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), strerror, and success.
Referenced by exec_command().
|
static |
Definition at line 734 of file command.c.
References clean_extended_state(), ignore_slash_options(), OT_NORMAL, pg_log_error, pset, PSQL_CMD_ERROR, PSQL_CMD_SEND, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), PSQL_SEND_EXTENDED_CLOSE, _psqlSettings::send_mode, and _psqlSettings::stmtName.
Referenced by exec_command().
|
static |
Definition at line 617 of file command.c.
References do_connect(), free, ignore_slash_options(), ParseVariableBool(), PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, read_connect_arg(), success, TRI_DEFAULT, TRI_NO, and TRI_YES.
Referenced by exec_command().
|
static |
Definition at line 767 of file command.c.
References _, _psqlSettings::db, is_unixsock_path(), _psqlSettings::logfile, pfree(), _psqlSettings::popt, PQbackendPID(), PQconnectionUsedGSSAPI(), PQconnectionUsedPassword(), PQdb(), PQhost(), PQhostaddr(), PQoptions(), PQparameterStatus(), PQport(), PQprotocolVersion(), PQsslAttribute(), PQsslInUse(), PQuser(), printf, printTable(), printTableAddCell(), printTableAddHeader(), printTableCleanup(), printTableInit(), pset, psprintf(), PSQL_CMD_SKIP_LINE, _psqlSettings::queryFout, and printQueryOpt::topt.
Referenced by exec_command().
|
static |
Definition at line 939 of file command.c.
References do_copy(), free, ignore_slash_whole_line(), OT_WHOLE_LINE, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), and success.
Referenced by exec_command().
|
static |
Definition at line 961 of file command.c.
References print_copyright(), and PSQL_CMD_SKIP_LINE.
Referenced by exec_command().
|
static |
Definition at line 973 of file command.c.
References _psqlSettings::crosstab_flag, _psqlSettings::ctv_args, i, ignore_slash_options(), lengthof, OT_NORMAL, pset, PSQL_CMD_SEND, PSQL_CMD_SKIP_LINE, and psql_scan_slash_option().
Referenced by exec_command().
|
static |
Definition at line 997 of file command.c.
References describeAccessMethods(), describeAggregates(), describeConfigurationParameters(), describePublications(), describeRoleGrants(), describeRoles(), describeSubscriptions(), describeTableDetails(), describeTablespaces(), describeTypes(), exec_command_dfo(), printTableOpt::expanded, free, ignore_slash_options(), listCasts(), listCollations(), listConversions(), listDbRoleSettings(), listDefaultACLs(), listDomains(), listEventTriggers(), listExtendedStats(), listExtensionContents(), listExtensions(), listForeignDataWrappers(), listForeignServers(), listForeignTables(), listLanguages(), listLargeObjects(), listOperatorClasses(), listOperatorFamilies(), listOpFamilyFunctions(), listOpFamilyOperators(), listPartitionedTables(), listPublications(), listSchemas(), listTables(), listTSConfigs(), listTSDictionaries(), listTSParsers(), listTSTemplates(), listUserMappings(), objectDescription(), OT_NORMAL, permissionsList(), _psqlSettings::popt, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, PSQL_CMD_UNKNOWN, psql_scan_slash_option(), success, printQueryOpt::topt, and true.
Referenced by exec_command().
|
static |
Definition at line 1281 of file command.c.
References describeFunctions(), describeOperators(), free, FUNC_MAX_ARGS, OT_NORMAL, psql_scan_slash_option(), and success.
Referenced by exec_command_d().
|
static |
Definition at line 1535 of file command.c.
References free, ignore_slash_options(), OT_NORMAL, pset, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), _psqlSettings::queryFout, generate_unaccent_rules::stdout, and value.
Referenced by exec_command().
|
static |
Definition at line 1323 of file command.c.
References canonicalize_path_enc(), copy_previous_query(), do_edit(), _psqlSettings::encoding, expand_tilde(), free, ignore_slash_options(), OT_NORMAL, pg_log_error, pset, PSQL_CMD_ERROR, PSQL_CMD_NEWEDIT, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), and resetPQExpBuffer().
Referenced by exec_command().
|
static |
Definition at line 1419 of file command.c.
References _, appendPQExpBufferStr(), PQExpBufferData::data, do_edit(), EditableFunction, EditableView, free, get_create_object_cmd(), ignore_slash_whole_line(), InvalidOid, lookup_object_oid(), OT_WHOLE_LINE, pg_log_error, PSQL_CMD_ERROR, PSQL_CMD_NEWEDIT, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), resetPQExpBuffer(), and strip_lineno_from_objdesc().
Referenced by exec_command().
|
static |
Definition at line 2126 of file command.c.
References conditional_stack_peek(), conditional_stack_poke(), discard_query_text(), IFSTATE_ELSE_FALSE, IFSTATE_ELSE_TRUE, IFSTATE_FALSE, IFSTATE_IGNORED, IFSTATE_NONE, IFSTATE_TRUE, ignore_boolean_expression(), is_true_boolean_expression(), pg_log_error, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, save_query_text_state(), and success.
Referenced by exec_command().
|
static |
Definition at line 2202 of file command.c.
References conditional_stack_peek(), conditional_stack_poke(), discard_query_text(), IFSTATE_ELSE_FALSE, IFSTATE_ELSE_TRUE, IFSTATE_FALSE, IFSTATE_IGNORED, IFSTATE_NONE, IFSTATE_TRUE, pg_log_error, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, save_query_text_state(), and success.
Referenced by exec_command().
|
static |
Definition at line 1580 of file command.c.
References _psqlSettings::db, _psqlSettings::encoding, encoding, printTableOpt::encoding, free, ignore_slash_options(), OT_NORMAL, pg_encoding_to_char, pg_log_error, _psqlSettings::popt, PQclientEncoding(), PQsetClientEncoding(), pset, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), setFmtEncoding(), SetVariable(), printQueryOpt::topt, and _psqlSettings::vars.
Referenced by exec_command().
|
static |
Definition at line 2267 of file command.c.
References Assert(), conditional_stack_peek(), conditional_stack_pop(), discard_query_text(), IFSTATE_ELSE_FALSE, IFSTATE_ELSE_TRUE, IFSTATE_FALSE, IFSTATE_IGNORED, IFSTATE_NONE, IFSTATE_TRUE, pg_log_error, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, and success.
Referenced by exec_command().
|
static |
Definition at line 3044 of file command.c.
References ignore_slash_options(), pset, PSQL_CMD_SEND, PSQL_CMD_SKIP_LINE, PSQL_SEND_END_PIPELINE_MODE, and _psqlSettings::send_mode.
Referenced by exec_command().
|
static |
Definition at line 1619 of file command.c.
References _, _psqlSettings::last_error_result, pg_log_error, PQERRORS_VERBOSE, PQfreemem(), PQresultVerboseErrorMessage(), PQSHOW_CONTEXT_ALWAYS, pset, and PSQL_CMD_SKIP_LINE.
Referenced by exec_command().
|
static |
Definition at line 1649 of file command.c.
References do_pset(), free, ignore_slash_options(), OT_NORMAL, _psqlSettings::popt, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), _psqlSettings::quiet, and success.
Referenced by exec_command().
|
static |
Definition at line 1671 of file command.c.
References ignore_slash_options(), pset, PSQL_CMD_SEND, PSQL_CMD_SKIP_LINE, PSQL_SEND_FLUSH, and _psqlSettings::send_mode.
Referenced by exec_command().
|
static |
Definition at line 1690 of file command.c.
References ignore_slash_options(), pset, PSQL_CMD_SEND, PSQL_CMD_SKIP_LINE, PSQL_SEND_FLUSH_REQUEST, and _psqlSettings::send_mode.
Referenced by exec_command().
|
static |
Definition at line 1715 of file command.c.
References clean_extended_state(), _psqlSettings::db, expand_tilde(), printTableOpt::expanded, free, _psqlSettings::gfname, _psqlSettings::gsavepopt, OT_FILEPIPE, pg_log_error, pg_strdup(), _psqlSettings::popt, PQ_PIPELINE_OFF, PQpipelineStatus(), process_command_g_options(), pset, PSQL_CMD_ERROR, PSQL_CMD_SEND, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), savePsetInfo(), and printQueryOpt::topt.
Referenced by exec_command().
|
static |
Definition at line 1851 of file command.c.
References _psqlSettings::gdesc_flag, pset, PSQL_CMD_SEND, and PSQL_CMD_SKIP_LINE.
Referenced by exec_command().
|
static |
Definition at line 1868 of file command.c.
References free, ignore_slash_options(), OT_NORMAL, pg_log_error, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), SetVariable(), success, and _psqlSettings::vars.
Referenced by exec_command().
|
static |
Definition at line 1905 of file command.c.
References ignore_slash_options(), OT_NORMAL, pg_log_error, pset, PSQL_CMD_SEND, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), PSQL_SEND_GET_RESULTS, _psqlSettings::requested_results, and _psqlSettings::send_mode.
Referenced by exec_command().
|
static |
Definition at line 1941 of file command.c.
References clean_extended_state(), _psqlSettings::db, _psqlSettings::gexec_flag, pg_log_error, PQ_PIPELINE_OFF, PQpipelineStatus(), pset, PSQL_CMD_ERROR, PSQL_CMD_SEND, and PSQL_CMD_SKIP_LINE.
Referenced by exec_command().
|
static |
Definition at line 1964 of file command.c.
References clean_extended_state(), _psqlSettings::db, _psqlSettings::gset_prefix, ignore_slash_options(), OT_NORMAL, pg_log_error, pg_strdup(), PQ_PIPELINE_OFF, PQpipelineStatus(), pset, PSQL_CMD_ERROR, PSQL_CMD_SEND, PSQL_CMD_SKIP_LINE, and psql_scan_slash_option().
Referenced by exec_command().
|
static |
Definition at line 2000 of file command.c.
References free, helpSQL(), ignore_slash_whole_line(), OT_WHOLE_LINE, printTableOpt::pager, _psqlSettings::popt, pset, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), and printQueryOpt::topt.
Referenced by exec_command().
|
static |
Definition at line 2020 of file command.c.
References do_pset(), printTableOpt::format, _psqlSettings::popt, PRINT_HTML, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, _psqlSettings::quiet, success, and printQueryOpt::topt.
Referenced by exec_command().
|
static |
Definition at line 2080 of file command.c.
References conditional_active(), conditional_stack_poke(), conditional_stack_push(), IFSTATE_FALSE, IFSTATE_IGNORED, IFSTATE_TRUE, ignore_boolean_expression(), is_true_boolean_expression(), PSQL_CMD_SKIP_LINE, and save_query_text_state().
Referenced by exec_command().
|
static |
Definition at line 2039 of file command.c.
References EXIT_SUCCESS, expand_tilde(), free, ignore_slash_options(), OT_NORMAL, pg_log_error, process_file(), PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), and success.
Referenced by exec_command().
|
static |
Definition at line 2307 of file command.c.
References printTableOpt::expanded, free, ignore_slash_options(), listAllDbs(), OT_NORMAL, _psqlSettings::popt, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), success, printQueryOpt::topt, and true.
Referenced by exec_command().
|
static |
Definition at line 2344 of file command.c.
References do_lo_export(), do_lo_import(), do_lo_unlink(), expand_tilde(), printTableOpt::expanded, free, ignore_slash_options(), listLargeObjects(), OT_NORMAL, pg_log_error, _psqlSettings::popt, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, PSQL_CMD_UNKNOWN, psql_scan_slash_option(), success, printQueryOpt::topt, and true.
Referenced by exec_command().
|
static |
Definition at line 2435 of file command.c.
References expand_tilde(), free, ignore_slash_filepipe(), OT_FILEPIPE, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), setQFout(), and success.
Referenced by exec_command().
|
static |
Definition at line 2484 of file command.c.
References clean_extended_state(), ignore_slash_options(), OT_NORMAL, pg_log_error, pset, PSQL_CMD_ERROR, PSQL_CMD_SEND, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), PSQL_SEND_EXTENDED_PARSE, _psqlSettings::send_mode, and _psqlSettings::stmtName.
Referenced by exec_command().
|
static |
Definition at line 2518 of file command.c.
References _, buf, PromptInterruptContext::canceled, _psqlSettings::db, PromptInterruptContext::enabled, free, ignore_slash_options(), initPQExpBuffer(), PromptInterruptContext::jmpbuf, OT_SQLID, pg_log_error, pg_log_info, pg_strdup(), PGRES_COMMAND_OK, PQchangePassword(), PQclear(), PQerrorMessage(), PQgetvalue(), PQresultStatus(), printfPQExpBuffer(), pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), PSQLexec(), sigint_interrupt_enabled, sigint_interrupt_jmp, simple_prompt_extended(), success, termPQExpBuffer(), and user.
Referenced by exec_command().
|
static |
Definition at line 2458 of file command.c.
References _, PQExpBufferData::data, PQExpBufferData::len, pset, PSQL_CMD_SKIP_LINE, _psqlSettings::quiet, and generate_unaccent_rules::stdout.
Referenced by exec_command().
|
static |
Definition at line 2594 of file command.c.
References PromptInterruptContext::canceled, PromptInterruptContext::enabled, free, gets_fromFile(), ignore_slash_options(), _psqlSettings::inputfile, PromptInterruptContext::jmpbuf, OT_NORMAL, pg_log_error, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), SetVariable(), sigint_interrupt_enabled, sigint_interrupt_jmp, simple_prompt_extended(), generate_unaccent_rules::stdout, success, and _psqlSettings::vars.
Referenced by exec_command().
|
static |
Definition at line 2671 of file command.c.
References do_pset(), free, i, ignore_slash_options(), OT_NORMAL, _psqlSettings::popt, printf, pset, pset_value_string(), PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), _psqlSettings::quiet, success, and val.
Referenced by exec_command().
|
static |
Definition at line 2726 of file command.c.
References PSQL_CMD_SKIP_LINE, and PSQL_CMD_TERMINATE.
Referenced by exec_command().
|
static |
Definition at line 2740 of file command.c.
References _, pset, PSQL_CMD_SKIP_LINE, psql_scan_reset(), _psqlSettings::quiet, and resetPQExpBuffer().
Referenced by exec_command().
|
static |
Definition at line 2758 of file command.c.
References _, expand_tilde(), free, ignore_slash_options(), OT_NORMAL, printTableOpt::pager, _psqlSettings::popt, printf, printHistory(), pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), _psqlSettings::quiet, success, and printQueryOpt::topt.
Referenced by exec_command().
|
static |
Definition at line 2785 of file command.c.
References clean_extended_state(), _psqlSettings::db, ignore_slash_options(), pg_log_error, PQ_PIPELINE_OFF, PQpipelineStatus(), pset, PSQL_CMD_ERROR, PSQL_CMD_SEND, PSQL_CMD_SKIP_LINE, PSQL_SEND_EXTENDED_QUERY_PARAMS, PSQL_SEND_EXTENDED_QUERY_PREPARED, and _psqlSettings::send_mode.
Referenced by exec_command().
|
static |
Definition at line 2822 of file command.c.
References free, ignore_slash_options(), newval, OT_NORMAL, pg_realloc(), pg_strdup(), PrintVariables(), pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), SetVariable(), success, and _psqlSettings::vars.
Referenced by exec_command().
|
static |
Definition at line 2875 of file command.c.
References free, ignore_slash_options(), OT_NORMAL, pg_log_error, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), setenv, success, and unsetenv.
Referenced by exec_command().
|
static |
Definition at line 2923 of file command.c.
References buf, ClosePager(), count_lines_in_buf(), createPQExpBuffer(), destroyPQExpBuffer(), EditableFunction, EditableView, free, get_create_object_cmd(), ignore_slash_whole_line(), InvalidOid, lookup_object_oid(), OT_WHOLE_LINE, output, PageOutput(), pg_log_error, _psqlSettings::popt, print_with_linenumbers(), pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), _psqlSettings::queryFout, generate_unaccent_rules::stdout, and printQueryOpt::topt.
Referenced by exec_command().
|
static |
Definition at line 3486 of file command.c.
References do_shell(), free, ignore_slash_whole_line(), OT_WHOLE_LINE, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), and success.
Referenced by exec_command().
|
static |
Definition at line 3508 of file command.c.
References free, helpVariables(), ignore_slash_options(), OT_NORMAL, printTableOpt::pager, _psqlSettings::popt, pset, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), slashUsage(), printQueryOpt::topt, and usage().
Referenced by exec_command().
|
static |
Definition at line 3006 of file command.c.
References ignore_slash_options(), pset, PSQL_CMD_SEND, PSQL_CMD_SKIP_LINE, PSQL_SEND_START_PIPELINE_MODE, and _psqlSettings::send_mode.
Referenced by exec_command().
|
static |
Definition at line 3025 of file command.c.
References ignore_slash_options(), pset, PSQL_CMD_SEND, PSQL_CMD_SKIP_LINE, PSQL_SEND_PIPELINE_SYNC, and _psqlSettings::send_mode.
Referenced by exec_command().
|
static |
Definition at line 3063 of file command.c.
References do_pset(), free, ignore_slash_options(), OT_NORMAL, _psqlSettings::popt, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), _psqlSettings::quiet, and success.
Referenced by exec_command().
|
static |
Definition at line 3085 of file command.c.
References do_pset(), free, ignore_slash_options(), OT_NORMAL, _psqlSettings::popt, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), _psqlSettings::quiet, success, and value.
Referenced by exec_command().
|
static |
Definition at line 3107 of file command.c.
References _, free, ignore_slash_options(), OT_NORMAL, ParseVariableBool(), pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), _psqlSettings::quiet, success, and _psqlSettings::timing.
Referenced by exec_command().
|
static |
Definition at line 3139 of file command.c.
References free, ignore_slash_options(), OT_NORMAL, pg_log_error, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), SetVariable(), success, and _psqlSettings::vars.
Referenced by exec_command().
|
static |
Definition at line 3271 of file command.c.
References clean_extended_state(), copy_previous_query(), _psqlSettings::db, do_watch(), free, ignore_slash_options(), OT_NORMAL, pg_log_error, PQ_PIPELINE_OFF, PQpipelineStatus(), pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_reset(), psql_scan_slash_option(), resetPQExpBuffer(), strtoint(), success, and _psqlSettings::watch_interval.
Referenced by exec_command().
|
static |
Definition at line 3169 of file command.c.
References canonicalize_path_enc(), PQExpBufferData::data, disable_sigpipe_trap(), _psqlSettings::encoding, expand_tilde(), fd(), fprintf, free, ignore_slash_filepipe(), PQExpBufferData::len, OT_FILEPIPE, pg_log_error, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), restore_sigpipe_trap(), SetShellResultVariables(), and wait_result_to_str().
Referenced by exec_command().
|
static |
Definition at line 3427 of file command.c.
References do_pset(), free, ignore_slash_options(), OT_NORMAL, _psqlSettings::popt, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), _psqlSettings::quiet, and success.
Referenced by exec_command().
|
static |
Definition at line 3449 of file command.c.
References printTableOpt::expanded, free, ignore_slash_options(), OT_NORMAL, permissionsList(), _psqlSettings::popt, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), success, printQueryOpt::topt, and true.
Referenced by exec_command().
|
static |
Definition at line 3579 of file command.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), createPQExpBuffer(), free, OT_NORMAL, psql_scan_slash_option(), and value.
Referenced by ignore_boolean_expression(), and is_true_boolean_expression().
|
static |
Definition at line 6104 of file command.c.
References appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), appendReloptionsArray(), buf, createPQExpBuffer(), PQExpBufferData::data, _psqlSettings::db, destroyPQExpBuffer(), echo_hidden_command(), EditableFunction, EditableView, _psqlSettings::encoding, fmtId(), minimal_error_message(), pg_log_error, PGRES_TUPLES_OK, PQclear(), PQexec(), PQgetvalue(), PQntuples(), PQresultStatus(), printfPQExpBuffer(), pset, relname, resetPQExpBuffer(), standard_strings(), and _psqlSettings::sversion.
Referenced by exec_command_ef_ev(), and exec_command_sf_sv().
backslashResult HandleSlashCmds | ( | PsqlScanState | scan_state, |
ConditionalStack | cstack, | ||
PQExpBuffer | query_buf, | ||
PQExpBuffer | previous_buf | ||
) |
Definition at line 225 of file command.c.
References arg, Assert(), conditional_active(), conditional_stack_pop(), conditional_stack_push(), _psqlSettings::cur_cmd_interactive, exec_command(), free, IFSTATE_IGNORED, OT_NORMAL, OT_WHOLE_LINE, pg_log_error, pg_log_error_hint, pg_log_warning, pset, PSQL_CMD_ERROR, PSQL_CMD_UNKNOWN, psql_scan_slash_command(), psql_scan_slash_command_end(), psql_scan_slash_option(), and _psqlSettings::queryFout.
Referenced by main(), and MainLoop().
|
static |
Definition at line 3626 of file command.c.
References buf, destroyPQExpBuffer(), and gather_boolean_expression().
Referenced by exec_command_elif(), and exec_command_if().
|
static |
Definition at line 3659 of file command.c.
References arg, free, OT_FILEPIPE, and psql_scan_slash_option().
Referenced by exec_command_out(), and exec_command_write().
|
static |
Definition at line 3642 of file command.c.
References arg, free, OT_NORMAL, and psql_scan_slash_option().
Referenced by exec_command_bind(), exec_command_bind_named(), exec_command_C(), exec_command_cd(), exec_command_close(), exec_command_connect(), exec_command_crosstabview(), exec_command_d(), exec_command_echo(), exec_command_edit(), exec_command_encoding(), exec_command_endpipeline(), exec_command_f(), exec_command_flush(), exec_command_flushrequest(), exec_command_getenv(), exec_command_getresults(), exec_command_gset(), exec_command_include(), exec_command_list(), exec_command_lo(), exec_command_parse(), exec_command_password(), exec_command_prompt(), exec_command_pset(), exec_command_s(), exec_command_sendpipeline(), exec_command_set(), exec_command_setenv(), exec_command_slash_command_help(), exec_command_startpipeline(), exec_command_syncpipeline(), exec_command_t(), exec_command_T(), exec_command_timing(), exec_command_unset(), exec_command_watch(), exec_command_x(), and exec_command_z().
|
static |
Definition at line 3679 of file command.c.
References arg, free, OT_WHOLE_LINE, and psql_scan_slash_option().
Referenced by exec_command_copy(), exec_command_ef_ev(), exec_command_help(), exec_command_sf_sv(), and exec_command_shell_escape().
|
static |
Definition at line 3691 of file command.c.
Referenced by exec_command().
|
static |
Definition at line 3609 of file command.c.
References buf, destroyPQExpBuffer(), gather_boolean_expression(), name, ParseVariableBool(), success, and value.
Referenced by exec_command_elif(), and exec_command_if().
|
static |
Definition at line 6044 of file command.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), appendStringLiteralConn(), atooid, createPQExpBuffer(), PQExpBufferData::data, _psqlSettings::db, destroyPQExpBuffer(), echo_hidden_command(), EditableFunction, EditableView, minimal_error_message(), PGRES_TUPLES_OK, PQclear(), PQexec(), PQgetvalue(), PQntuples(), PQresultStatus(), and pset.
Referenced by exec_command_ef_ev(), and exec_command_sf_sv().
|
static |
Definition at line 6394 of file command.c.
References appendPQExpBufferChar(), appendPQExpBufferStr(), createPQExpBuffer(), PQExpBufferData::data, destroyPQExpBuffer(), PG_DIAG_MESSAGE_PRIMARY, PG_DIAG_SEVERITY, pg_log_error, PQresultErrorField(), and printfPQExpBuffer().
Referenced by get_create_object_cmd(), and lookup_object_oid().
|
static |
Definition at line 3799 of file command.c.
Referenced by do_connect().
|
static |
Definition at line 6352 of file command.c.
References fprintf, and output.
Referenced by exec_command_sf_sv().
|
static |
Definition at line 4435 of file command.c.
References _, _psqlSettings::db, PQgssEncInUse(), printf, and pset.
Referenced by connection_warnings().
|
static |
Definition at line 5324 of file command.c.
References _, _align2string(), _unicode_linestyle2string(), Assert(), printTableOpt::border, printTableOpt::columns, printTableOpt::csvFieldSep, printTableOpt::default_footer, printTableOpt::expanded, printTableOpt::expanded_header_exact_width, printTableOpt::expanded_header_width_type, printTableOpt::fieldSep, printTableOpt::format, get_line_style(), printTextFormat::name, ngettext, printQueryOpt::nullPrint, printTableOpt::numericLocale, printTableOpt::pager, printTableOpt::pager_min_lines, pg_log_error, PRINT_XHEADER_COLUMN, PRINT_XHEADER_EXACT_WIDTH, PRINT_XHEADER_FULL, PRINT_XHEADER_PAGE, printf, printTableOpt::recordSep, separator::separator, separator::separator_zero, printTableOpt::tableAttr, printQueryOpt::title, printQueryOpt::topt, printTableOpt::tuples_only, printTableOpt::unicode_border_linestyle, printTableOpt::unicode_column_linestyle, and printTableOpt::unicode_header_linestyle.
Referenced by do_pset().
|
static |
Definition at line 4407 of file command.c.
References _, _psqlSettings::db, PQsslAttribute(), PQsslInUse(), printf, and pset.
Referenced by connection_warnings().
|
static |
Definition at line 1776 of file command.c.
References do_pset(), free, _psqlSettings::gsavepopt, OT_NORMAL, pg_log_error, _psqlSettings::popt, pset, PSQL_CMD_ERROR, PSQL_CMD_SKIP_LINE, psql_scan_slash_option(), restorePsetInfo(), savePsetInfo(), and success.
Referenced by exec_command_g().
int process_file | ( | char * | filename, |
bool | use_relative_path | ||
) |
Definition at line 4818 of file command.c.
References canonicalize_path_enc(), _psqlSettings::encoding, EXIT_FAILURE, fd(), filename, get_parent_directory(), has_drive_prefix(), _psqlSettings::inputfile, is_absolute_path, join_path_components(), MainLoop(), MAXPGPATH, PG_BINARY_R, pg_log_error, PG_LOG_FLAG_TERSE, pg_logging_config(), pset, relpath, and strlcpy().
Referenced by exec_command_include().
|
static |
Definition at line 3771 of file command.c.
References _, PromptInterruptContext::canceled, PromptInterruptContext::enabled, free, PromptInterruptContext::jmpbuf, psprintf(), sigint_interrupt_enabled, sigint_interrupt_jmp, simple_prompt_extended(), and username.
Referenced by do_connect().
|
static |
|
static |
Definition at line 5593 of file command.c.
References pg_malloc(), and str.
Referenced by pset_value_string().
|
static |
Definition at line 5631 of file command.c.
References _align2string(), _unicode_linestyle2string(), Assert(), printTableOpt::border, printTableOpt::columns, printTableOpt::csvFieldSep, printTableOpt::default_footer, printTableOpt::expanded, printTableOpt::expanded_header_exact_width, printTableOpt::expanded_header_width_type, printTableOpt::fieldSep, printTableOpt::format, get_line_style(), printTextFormat::name, printQueryOpt::nullPrint, printTableOpt::numericLocale, printTableOpt::pager, printTableOpt::pager_min_lines, PRINT_XHEADER_COLUMN, PRINT_XHEADER_FULL, PRINT_XHEADER_PAGE, pset_bool_string(), pset_quoted_string(), psprintf(), pstrdup(), printTableOpt::recordSep, separator::separator, separator::separator_zero, snprintf, printTableOpt::tableAttr, printQueryOpt::title, printQueryOpt::topt, printTableOpt::tuples_only, printTableOpt::unicode_border_linestyle, printTableOpt::unicode_column_linestyle, and printTableOpt::unicode_header_linestyle.
Referenced by exec_command_pset().
|
static |
Definition at line 3539 of file command.c.
References free, OT_SQLIDHACK, and psql_scan_slash_option().
Referenced by exec_command_connect().
void restorePsetInfo | ( | printQueryOpt * | popt, |
printQueryOpt * | save | ||
) |
Definition at line 5560 of file command.c.
References Assert(), printTableOpt::fieldSep, printQueryOpt::footers, free, printQueryOpt::nullPrint, printTableOpt::recordSep, separator::separator, printTableOpt::tableAttr, printQueryOpt::title, printQueryOpt::topt, and printQueryOpt::translate_columns.
Referenced by process_command_g_options(), and SendQuery().
|
static |
Definition at line 3707 of file command.c.
References conditional_stack_set_paren_depth(), conditional_stack_set_query_len(), PQExpBufferData::len, and psql_scan_get_paren_depth().
Referenced by exec_command_elif(), exec_command_else(), and exec_command_if().
printQueryOpt * savePsetInfo | ( | const printQueryOpt * | popt | ) |
Definition at line 5524 of file command.c.
References Assert(), printTableOpt::fieldSep, printQueryOpt::footers, printQueryOpt::nullPrint, pg_malloc(), pg_strdup(), printTableOpt::recordSep, separator::separator, printTableOpt::tableAttr, printQueryOpt::title, printQueryOpt::topt, and printQueryOpt::translate_columns.
Referenced by exec_command_g(), and process_command_g_options().
|
static |
Definition at line 4928 of file command.c.
References pg_strncasecmp(), UNICODE_LINESTYLE_DOUBLE, UNICODE_LINESTYLE_SINGLE, and value.
Referenced by do_pset().
|
static |
Definition at line 6264 of file command.c.
References pg_log_error.
Referenced by exec_command_ef_ev().
void SyncVariables | ( | void | ) |
Definition at line 4476 of file command.c.
References _psqlSettings::db, _psqlSettings::encoding, printTableOpt::encoding, formatPGVersionNumber(), pg_encoding_to_char, _psqlSettings::popt, PQclientEncoding(), PQdb(), PQhost(), PQparameterStatus(), PQport(), PQserverVersion(), PQservice(), PQsetErrorContextVisibility(), PQsetErrorVerbosity(), PQuser(), pset, server_version, setFmtEncoding(), SetVariable(), _psqlSettings::show_context, snprintf, _psqlSettings::sversion, printQueryOpt::topt, _psqlSettings::vars, and _psqlSettings::verbosity.
Referenced by CheckConnection(), do_connect(), and main().
void UnsyncVariables | ( | void | ) |
Definition at line 4520 of file command.c.
References pset, SetVariable(), and _psqlSettings::vars.
Referenced by CheckConnection(), and do_connect().
|
static |
Definition at line 4286 of file command.c.
References cancel_pressed, conn, end_time, pg_unreachable, PGRES_POLLING_ACTIVE, PGRES_POLLING_FAILED, PGRES_POLLING_OK, PGRES_POLLING_READING, PGRES_POLLING_WRITING, PQconnectPoll(), PQgetCurrentTimeUSec(), PQsocket(), and PQsocketPoll().
Referenced by do_connect().