PostgreSQL Source Code  git master
elog.c File Reference
#include "postgres.h"
#include <fcntl.h>
#include <time.h>
#include <unistd.h>
#include <signal.h>
#include <ctype.h>
#include "access/transam.h"
#include "access/xact.h"
#include "libpq/libpq.h"
#include "libpq/pqformat.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "postmaster/bgworker.h"
#include "postmaster/postmaster.h"
#include "postmaster/syslogger.h"
#include "storage/ipc.h"
#include "storage/proc.h"
#include "tcop/tcopprot.h"
#include "utils/guc.h"
#include "utils/memutils.h"
#include "utils/ps_status.h"
Include dependency graph for elog.c:

Go to the source code of this file.

Macros

#define _(x)   err_gettext(x)
 
#define ERRORDATA_STACK_SIZE   5
 
#define FORMATTED_TS_LEN   128
 
#define CHECK_STACK_DEPTH()
 
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
 
#define EVALUATE_MESSAGE_PLURAL(domain, targetfield, appendval)
 

Functions

static const char * err_gettext (const char *str) pg_attribute_format_arg(1)
 
static pg_noinline void set_backtrace (ErrorData *edata, int num_skip)
 
static void set_errdata_field (MemoryContextData *cxt, char **ptr, const char *str)
 
static void write_console (const char *line, int len)
 
static void setup_formatted_log_time (void)
 
static void setup_formatted_start_time (void)
 
static const char * process_log_prefix_padding (const char *p, int *padding)
 
static void log_line_prefix (StringInfo buf, ErrorData *edata)
 
static void write_csvlog (ErrorData *edata)
 
static void send_message_to_server_log (ErrorData *edata)
 
static void write_pipe_chunks (char *data, int len, int dest)
 
static void send_message_to_frontend (ErrorData *edata)
 
static const char * error_severity (int elevel)
 
static void append_with_tabs (StringInfo buf, const char *str)
 
static bool is_log_level_output (int elevel, int log_min_level)
 
static bool should_output_to_server (int elevel)
 
static bool should_output_to_client (int elevel)
 
bool message_level_is_interesting (int elevel)
 
bool in_error_recursion_trouble (void)
 
pg_attribute_cold bool errstart_cold (int elevel, const char *domain)
 
bool errstart (int elevel, const char *domain)
 
static bool matches_backtrace_functions (const char *funcname)
 
void errfinish (const char *filename, int lineno, const char *funcname)
 
int errcode (int sqlerrcode)
 
int errcode_for_file_access (void)
 
int errcode_for_socket_access (void)
 
int errmsg (const char *fmt,...)
 
int errbacktrace (void)
 
int errmsg_internal (const char *fmt,...)
 
int errmsg_plural (const char *fmt_singular, const char *fmt_plural, unsigned long n,...)
 
int errdetail (const char *fmt,...)
 
int errdetail_internal (const char *fmt,...)
 
int errdetail_log (const char *fmt,...)
 
int errdetail_log_plural (const char *fmt_singular, const char *fmt_plural, unsigned long n,...)
 
int errdetail_plural (const char *fmt_singular, const char *fmt_plural, unsigned long n,...)
 
int errhint (const char *fmt,...)
 
int errhint_plural (const char *fmt_singular, const char *fmt_plural, unsigned long n,...)
 
int errcontext_msg (const char *fmt,...)
 
int set_errcontext_domain (const char *domain)
 
int errhidestmt (bool hide_stmt)
 
int errhidecontext (bool hide_ctx)
 
int errposition (int cursorpos)
 
int internalerrposition (int cursorpos)
 
int internalerrquery (const char *query)
 
int err_generic_string (int field, const char *str)
 
int geterrcode (void)
 
int geterrposition (void)
 
int getinternalerrposition (void)
 
void pre_format_elog_string (int errnumber, const char *domain)
 
char * format_elog_string (const char *fmt,...)
 
void EmitErrorReport (void)
 
ErrorDataCopyErrorData (void)
 
void FreeErrorData (ErrorData *edata)
 
void FlushErrorState (void)
 
void ThrowErrorData (ErrorData *edata)
 
void ReThrowError (ErrorData *edata)
 
void pg_re_throw (void)
 
char * GetErrorContextStack (void)
 
void DebugFileOpen (void)
 
static void appendCSVLiteral (StringInfo buf, const char *data)
 
char * unpack_sql_state (int sql_state)
 
static void err_sendstring (StringInfo buf, const char *str)
 
void write_stderr (const char *fmt,...)
 
int trace_recovery (int trace_level)
 

Variables

ErrorContextCallbackerror_context_stack = NULL
 
sigjmp_buf * PG_exception_stack = NULL
 
bool redirection_done
 
emit_log_hook_type emit_log_hook = NULL
 
int Log_error_verbosity = PGERROR_VERBOSE
 
char * Log_line_prefix = NULL
 
int Log_destination = LOG_DESTINATION_STDERR
 
char * Log_destination_string = NULL
 
bool syslog_sequence_numbers = true
 
bool syslog_split_messages = true
 
static ErrorData errordata [ERRORDATA_STACK_SIZE]
 
static int errordata_stack_depth = -1
 
static int recursion_depth = 0
 
static struct timeval saved_timeval
 
static bool saved_timeval_set = false
 
static char formatted_start_time [FORMATTED_TS_LEN]
 
static char formatted_log_time [FORMATTED_TS_LEN]
 
static int save_format_errnumber
 
static const char * save_format_domain
 

Macro Definition Documentation

◆ _

#define _ (   x)    err_gettext(x)

Definition at line 89 of file elog.c.

Referenced by abbroffset(), add_tablespace_footer(), addtype(), adjleap(), adjust_data_dir(), advice(), appendPsqlMetaConnect(), appendShellString(), associate(), ATExecSetRelOptions(), ATWrongRelkindError(), auth_failed(), auth_peer(), be_gssapi_read(), be_gssapi_write(), bootstrap_template1(), build_attrmap_by_position(), byword(), change_directory(), check_agglevels_and_constraints(), check_input(), check_loadable_libraries(), check_locale_encoding(), check_ok(), check_srf_call_placement(), check_valid_internal_signature(), check_valid_polymorphic_signature(), CheckConnection(), CheckSCRAMAuth(), CleanupBackend(), CleanupBackgroundWorker(), ClientAuthentication(), close_file(), ClosePager(), cluster_all_databases(), componentcheck(), connection_warnings(), connectToServer(), convert_sourcefiles_in(), create_data_directory(), create_database(), create_role(), create_xlog_or_symlink(), dbState(), DeadLockReport(), DefineView(), describeAccessMethods(), describeAggregates(), describeFunctions(), DescribeLockTag(), describeOneTableDetails(), describeOneTSConfig(), describeOneTSParser(), describeOperators(), describePublications(), DescribeQuery(), describeRoles(), describeSubscriptions(), describeTablespaces(), describeTypes(), do_advice(), do_analyze_rel(), do_connect(), do_help(), do_init(), do_kill(), do_lo_list(), do_logrotate(), do_promote(), do_reload(), do_restart(), do_start(), do_status(), do_stop(), do_watch(), dolink(), drop_database_if_exists(), drop_role_if_exists(), DropErrorMsgWrongType(), echo_hidden_command(), ecpg_start_test(), EnableLockPagesPrivilege(), enlargeStringInfo(), exec_command_cd(), exec_command_conninfo(), exec_command_ef_ev(), exec_command_errverbose(), exec_command_print(), exec_command_reset(), exec_command_s(), exec_command_timing(), exec_execute_message(), executeQueryOrDie(), file_line_count(), file_size(), find_my_exec(), find_other_exec_or_die(), get_configdata(), get_control_dbstate(), get_controlfile(), get_id(), get_opts(), get_pgpid(), get_role_password(), get_su_pwd(), get_user_name(), GetConfigOptionByNum(), getfields(), gethms(), getleapdatetime(), getObjectDescription(), getOpFamilyDescription(), getRelationDescription(), getsave(), growalloc(), handle_args(), handle_sigint(), handleCopyIn(), HandleParallelMessage(), heap_vacuum_rel(), help(), helpSQL(), helpVariables(), incompatible_module_error(), inexpires(), infile(), initialize_data_directory(), initialize_environment(), inleap(), inlink(), inrule(), inzcont(), inzone(), inzsub(), isolation_init(), isolation_start_test(), issue_xlog_fsync(), json_errdetail(), lazy_scan_heap(), leapadd(), libpqrcv_exec(), libpqrcv_get_conninfo(), listAllDbs(), listCasts(), listCollations(), listConversions(), listDbRoleSettings(), listDefaultACLs(), listDomains(), listEventTriggers(), listExtendedStats(), listExtensions(), listForeignDataWrappers(), listForeignServers(), listForeignTables(), listLanguages(), listOneExtensionContents(), listOperatorClasses(), listOperatorFamilies(), listOpFamilyFunctions(), listOpFamilyOperators(), listPartitionedTables(), listPublications(), listSchemas(), listTables(), listTSConfigs(), listTSDictionaries(), listTSParsers(), listTSTemplates(), listUserMappings(), load_resultmap(), log_child_failure(), log_line_prefix(), logicalrep_report_missing_attrs(), LogRecoveryConflict(), main(), MainLoop(), make_absolute_path(), make_directory(), md5_crypt_verify(), memory_exhausted(), mkdirs(), namecheck(), newabbr(), objectDescription(), open_result_files(), output(), outzone(), parse_and_validate_value(), parse_one_reloption(), parse_psql_options(), parseCommandLine(), pclose_check(), PerformAuthentication(), permissionsList(), pg_be_scram_init(), pg_fatal(), pg_get_keywords(), pg_log_generic_v(), pg_log_v(), pg_malloc_internal(), pg_realloc(), pg_rusage_show(), pg_strdup(), pg_strerror_r(), pgwin32_is_admin(), plain_crypt_verify(), plpgsql_exec_error_callback(), plpgsql_stmt_typename(), plpgsql_yyerror(), pnstrdup(), print_elapse(), PrintControlValues(), printGSSInfo(), printMixedStruct(), PrintNewControlValues(), PrintNotifications(), printPsetInfo(), printSSLInfo(), printTable(), printTableAddCell(), printTableAddHeader(), PrintTiming(), progress_report(), prompt_for_password(), psql_command(), psql_start_test(), PSQLexec(), pvsnprintf(), read_post_opts(), reaper(), regression_main(), reindex_all_databases(), report_fork_failure_to_client(), report_invalid_record(), report_unmatched_relation(), reportDependentObjects(), resolve_symlinks(), results_differ(), rewriteTargetView(), rpytime(), rulesub(), run_diff(), run_schedule(), run_single_test(), secure_open_gssapi(), send_message_to_frontend(), send_message_to_server_log(), SendQuery(), set_dump_section(), set_mode(), set_pglocale_pgservice(), set_sig(), setup_cancel_handler(), setup_config(), setup_locale_encoding(), setup_pgdata(), setup_text_search(), SetWALFileNameForCleanup(), simple_prompt(), size_product(), slashUsage(), spawn_process(), SSLerrmessage(), start_postmaster(), stop_postmaster(), storeObjectDescription(), StreamServerPort(), test_config_settings(), test_file_descriptor_sync(), test_non_sync(), test_open_sync(), test_open_syncs(), test_sync(), test_timing(), time_overflow(), transformColumnRef(), transformSubLink(), transformWindowFuncCall(), trap_sigint_during_startup(), usage(), vacuum_one_database(), verror(), wait_for_postmaster(), wait_for_tests(), wait_result_to_str(), wal_level_str(), warn_on_mount_point(), warning(), write_csvlog(), write_stderr(), writezone(), and yesno_prompt().

◆ CHECK_STACK_DEPTH

◆ ERRORDATA_STACK_SIZE

#define ERRORDATA_STACK_SIZE   5

Definition at line 143 of file elog.c.

Referenced by errstart(), GetErrorContextStack(), and ReThrowError().

◆ EVALUATE_MESSAGE

#define EVALUATE_MESSAGE (   domain,
  targetfield,
  appendval,
  translateit 
)
Value:
{ \
StringInfoData buf; \
/* Internationalize the error format string */ \
if ((translateit) && !in_error_recursion_trouble()) \
fmt = dgettext((domain), fmt); \
initStringInfo(&buf); \
if ((appendval) && edata->targetfield) { \
appendStringInfoString(&buf, edata->targetfield); \
appendStringInfoChar(&buf, '\n'); \
} \
/* Generate actual output --- have to use appendStringInfoVA */ \
for (;;) \
{ \
va_list args; \
int needed; \
errno = edata->saved_errno; \
va_start(args, fmt); \
needed = appendStringInfoVA(&buf, fmt, args); \
va_end(args); \
if (needed == 0) \
break; \
enlargeStringInfo(&buf, needed); \
} \
/* Save the completed message into the stack item */ \
if (edata->targetfield) \
pfree(edata->targetfield); \
edata->targetfield = pstrdup(buf.data); \
pfree(buf.data); \
}
char * pstrdup(const char *in)
Definition: mcxt.c:1299
static char * buf
Definition: pg_test_fsync.c:68
#define dgettext(d, x)
Definition: c.h:1181
bool in_error_recursion_trouble(void)
Definition: elog.c:291
int appendStringInfoVA(StringInfo str, const char *fmt, va_list args)
Definition: stringinfo.c:133

Definition at line 828 of file elog.c.

Referenced by errcontext_msg(), errdetail(), errdetail_internal(), errdetail_log(), errhint(), errmsg(), errmsg_internal(), and format_elog_string().

◆ EVALUATE_MESSAGE_PLURAL

#define EVALUATE_MESSAGE_PLURAL (   domain,
  targetfield,
  appendval 
)

Definition at line 864 of file elog.c.

Referenced by errdetail_log_plural(), errdetail_plural(), errhint_plural(), and errmsg_plural().

◆ FORMATTED_TS_LEN

#define FORMATTED_TS_LEN   128

Definition at line 158 of file elog.c.

Referenced by setup_formatted_log_time(), and setup_formatted_start_time().

Function Documentation

◆ append_with_tabs()

static void append_with_tabs ( StringInfo  buf,
const char *  str 
)
static

Definition at line 3537 of file elog.c.

References appendStringInfoCharMacro.

Referenced by send_message_to_server_log().

3538 {
3539  char ch;
3540 
3541  while ((ch = *str++) != '\0')
3542  {
3543  appendStringInfoCharMacro(buf, ch);
3544  if (ch == '\n')
3545  appendStringInfoCharMacro(buf, '\t');
3546  }
3547 }
#define appendStringInfoCharMacro(str, ch)
Definition: stringinfo.h:128

◆ appendCSVLiteral()

static void appendCSVLiteral ( StringInfo  buf,
const char *  data 
)
inlinestatic

Definition at line 2738 of file elog.c.

References appendStringInfoCharMacro.

Referenced by write_csvlog().

2739 {
2740  const char *p = data;
2741  char c;
2742 
2743  /* avoid confusing an empty string with NULL */
2744  if (p == NULL)
2745  return;
2746 
2747  appendStringInfoCharMacro(buf, '"');
2748  while ((c = *p++) != '\0')
2749  {
2750  if (c == '"')
2751  appendStringInfoCharMacro(buf, '"');
2752  appendStringInfoCharMacro(buf, c);
2753  }
2754  appendStringInfoCharMacro(buf, '"');
2755 }
#define appendStringInfoCharMacro(str, ch)
Definition: stringinfo.h:128
char * c

◆ CopyErrorData()

ErrorData* CopyErrorData ( void  )

Definition at line 1560 of file elog.c.

References Assert, ErrorData::assoc_context, ErrorData::backtrace, CHECK_STACK_DEPTH, ErrorData::column_name, ErrorData::constraint_name, ErrorData::context, CurrentMemoryContext, ErrorData::datatype_name, ErrorData::detail, ErrorData::detail_log, ErrorContext, errordata_stack_depth, ErrorData::hint, ErrorData::internalquery, ErrorData::message, palloc(), pstrdup(), ErrorData::schema_name, and ErrorData::table_name.

Referenced by exec_stmt_block(), GetConnection(), initTrie(), plperl_return_next(), plperl_spi_commit(), plperl_spi_exec(), plperl_spi_exec_prepared(), plperl_spi_fetchrow(), plperl_spi_prepare(), plperl_spi_query(), plperl_spi_query_prepared(), plperl_spi_rollback(), plperl_util_elog(), pltcl_commit(), pltcl_elog(), pltcl_rollback(), pltcl_subtrans_abort(), PLy_output(), PLy_spi_subtransaction_abort(), ReorderBufferProcessTXN(), and xml_is_document().

1561 {
1563  ErrorData *newedata;
1564 
1565  /*
1566  * we don't increment recursion_depth because out-of-memory here does not
1567  * indicate a problem within the error subsystem.
1568  */
1570 
1572 
1573  /* Copy the struct itself */
1574  newedata = (ErrorData *) palloc(sizeof(ErrorData));
1575  memcpy(newedata, edata, sizeof(ErrorData));
1576 
1577  /* Make copies of separately-allocated fields */
1578  if (newedata->message)
1579  newedata->message = pstrdup(newedata->message);
1580  if (newedata->detail)
1581  newedata->detail = pstrdup(newedata->detail);
1582  if (newedata->detail_log)
1583  newedata->detail_log = pstrdup(newedata->detail_log);
1584  if (newedata->hint)
1585  newedata->hint = pstrdup(newedata->hint);
1586  if (newedata->context)
1587  newedata->context = pstrdup(newedata->context);
1588  if (newedata->backtrace)
1589  newedata->backtrace = pstrdup(newedata->backtrace);
1590  if (newedata->schema_name)
1591  newedata->schema_name = pstrdup(newedata->schema_name);
1592  if (newedata->table_name)
1593  newedata->table_name = pstrdup(newedata->table_name);
1594  if (newedata->column_name)
1595  newedata->column_name = pstrdup(newedata->column_name);
1596  if (newedata->datatype_name)
1597  newedata->datatype_name = pstrdup(newedata->datatype_name);
1598  if (newedata->constraint_name)
1599  newedata->constraint_name = pstrdup(newedata->constraint_name);
1600  if (newedata->internalquery)
1601  newedata->internalquery = pstrdup(newedata->internalquery);
1602 
1603  /* Use the calling context for string allocation */
1604  newedata->assoc_context = CurrentMemoryContext;
1605 
1606  return newedata;
1607 }
char * schema_name
Definition: elog.h:389
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
MemoryContext ErrorContext
Definition: mcxt.c:49
char * pstrdup(const char *in)
Definition: mcxt.c:1299
char * internalquery
Definition: elog.h:396
static int errordata_stack_depth
Definition: elog.c:147
char * detail_log
Definition: elog.h:384
char * table_name
Definition: elog.h:390
MemoryContext CurrentMemoryContext
Definition: mcxt.c:42
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
char * backtrace
Definition: elog.h:387
char * datatype_name
Definition: elog.h:392
char * detail
Definition: elog.h:383
char * column_name
Definition: elog.h:391
#define Assert(condition)
Definition: c.h:804
char * hint
Definition: elog.h:385
char * context
Definition: elog.h:386
struct MemoryContextData * assoc_context
Definition: elog.h:400
void * palloc(Size size)
Definition: mcxt.c:1062
char * constraint_name
Definition: elog.h:393
char * message
Definition: elog.h:382

◆ DebugFileOpen()

void DebugFileOpen ( void  )

Definition at line 1922 of file elog.c.

References buf, close, CurrentMemoryContext, DEBUG1, DEBUG2, DEBUG3, DEBUG4, DEBUG5, DEFAULT_EVENT_SOURCE, encoding, ereport, errcode_for_file_access(), errmsg(), ERROR, event_source, FATAL, fd(), free, GetMessageEncoding(), i, in_error_recursion_trouble(), INFO, IsUnderPostmaster, LOG, LOG_SERVER_ONLY, Min, NOTICE, OutputFileName, PANIC, pfree(), pg_mbcliplen(), generate_unaccent_rules::stdout, syslog_facility, syslog_sequence_numbers, syslog_split_messages, WARNING, and WARNING_CLIENT_ONLY.

Referenced by BaseInit().

1923 {
1924  int fd,
1925  istty;
1926 
1927  if (OutputFileName[0])
1928  {
1929  /*
1930  * A debug-output file name was given.
1931  *
1932  * Make sure we can write the file, and find out if it's a tty.
1933  */
1934  if ((fd = open(OutputFileName, O_CREAT | O_APPEND | O_WRONLY,
1935  0666)) < 0)
1936  ereport(FATAL,
1938  errmsg("could not open file \"%s\": %m", OutputFileName)));
1939  istty = isatty(fd);
1940  close(fd);
1941 
1942  /*
1943  * Redirect our stderr to the debug output file.
1944  */
1945  if (!freopen(OutputFileName, "a", stderr))
1946  ereport(FATAL,
1948  errmsg("could not reopen file \"%s\" as stderr: %m",
1949  OutputFileName)));
1950 
1951  /*
1952  * If the file is a tty and we're running under the postmaster, try to
1953  * send stdout there as well (if it isn't a tty then stderr will block
1954  * out stdout, so we may as well let stdout go wherever it was going
1955  * before).
1956  */
1957  if (istty && IsUnderPostmaster)
1958  if (!freopen(OutputFileName, "a", stdout))
1959  ereport(FATAL,
1961  errmsg("could not reopen file \"%s\" as stdout: %m",
1962  OutputFileName)));
1963  }
1964 }
static int fd(const char *x, int i)
Definition: preproc-init.c:105
#define FATAL
Definition: elog.h:49
char OutputFileName[MAXPGPATH]
Definition: globals.c:73
bool IsUnderPostmaster
Definition: globals.c:112
int errcode_for_file_access(void)
Definition: elog.c:721
#define ereport(elevel,...)
Definition: elog.h:157
int errmsg(const char *fmt,...)
Definition: elog.c:909
#define close(a)
Definition: win32.h:12

◆ EmitErrorReport()

void EmitErrorReport ( void  )

Definition at line 1509 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, emit_log_hook, errordata_stack_depth, MemoryContextSwitchTo(), ErrorData::output_to_client, ErrorData::output_to_server, recursion_depth, send_message_to_frontend(), and send_message_to_server_log().

Referenced by AutoVacLauncherMain(), AutoVacWorkerMain(), BackgroundWriterMain(), CheckpointerMain(), do_autovacuum(), errfinish(), perform_work_item(), PostgresMain(), StartBackgroundWorker(), and WalWriterMain().

1510 {
1512  MemoryContext oldcontext;
1513 
1514  recursion_depth++;
1516  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1517 
1518  /*
1519  * Call hook before sending message to log. The hook function is allowed
1520  * to turn off edata->output_to_server, so we must recheck that afterward.
1521  * Making any other change in the content of edata is not considered
1522  * supported.
1523  *
1524  * Note: the reason why the hook can only turn off output_to_server, and
1525  * not turn it on, is that it'd be unreliable: we will never get here at
1526  * all if errstart() deems the message uninteresting. A hook that could
1527  * make decisions in that direction would have to hook into errstart(),
1528  * where it would have much less information available. emit_log_hook is
1529  * intended for custom log filtering and custom log message transmission
1530  * mechanisms.
1531  *
1532  * The log hook has access to both the translated and original English
1533  * error message text, which is passed through to allow it to be used as a
1534  * message identifier. Note that the original text is not available for
1535  * detail, detail_log, hint and context text elements.
1536  */
1537  if (edata->output_to_server && emit_log_hook)
1538  (*emit_log_hook) (edata);
1539 
1540  /* Send to server log, if enabled */
1541  if (edata->output_to_server)
1543 
1544  /* Send to client, if enabled */
1545  if (edata->output_to_client)
1546  send_message_to_frontend(edata);
1547 
1548  MemoryContextSwitchTo(oldcontext);
1549  recursion_depth--;
1550 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:149
static void send_message_to_server_log(ErrorData *edata)
Definition: elog.c:3008
static int errordata_stack_depth
Definition: elog.c:147
bool output_to_server
Definition: elog.h:372
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
static void send_message_to_frontend(ErrorData *edata)
Definition: elog.c:3299
struct MemoryContextData * assoc_context
Definition: elog.h:400
emit_log_hook_type emit_log_hook
Definition: elog.c:106
bool output_to_client
Definition: elog.h:373

◆ err_generic_string()

int err_generic_string ( int  field,
const char *  str 
)

Definition at line 1351 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::column_name, ErrorData::constraint_name, ErrorData::datatype_name, elog, ERROR, errordata_stack_depth, PG_DIAG_COLUMN_NAME, PG_DIAG_CONSTRAINT_NAME, PG_DIAG_DATATYPE_NAME, PG_DIAG_SCHEMA_NAME, PG_DIAG_TABLE_NAME, ErrorData::schema_name, set_errdata_field(), and ErrorData::table_name.

Referenced by errdatatype(), errdomainconstraint(), errtable(), errtablecolname(), errtableconstraint(), exec_stmt_raise(), PLy_elog_impl(), and PLy_output().

1352 {
1354 
1355  /* we don't bother incrementing recursion_depth */
1357 
1358  switch (field)
1359  {
1360  case PG_DIAG_SCHEMA_NAME:
1361  set_errdata_field(edata->assoc_context, &edata->schema_name, str);
1362  break;
1363  case PG_DIAG_TABLE_NAME:
1364  set_errdata_field(edata->assoc_context, &edata->table_name, str);
1365  break;
1366  case PG_DIAG_COLUMN_NAME:
1367  set_errdata_field(edata->assoc_context, &edata->column_name, str);
1368  break;
1369  case PG_DIAG_DATATYPE_NAME:
1371  break;
1374  break;
1375  default:
1376  elog(ERROR, "unsupported ErrorData field id: %d", field);
1377  break;
1378  }
1379 
1380  return 0; /* return value does not matter */
1381 }
char * schema_name
Definition: elog.h:389
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
#define PG_DIAG_SCHEMA_NAME
Definition: postgres_ext.h:65
#define PG_DIAG_COLUMN_NAME
Definition: postgres_ext.h:67
#define PG_DIAG_TABLE_NAME
Definition: postgres_ext.h:66
static int errordata_stack_depth
Definition: elog.c:147
#define ERROR
Definition: elog.h:46
char * table_name
Definition: elog.h:390
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
char * datatype_name
Definition: elog.h:392
static void set_errdata_field(MemoryContextData *cxt, char **ptr, const char *str)
Definition: elog.c:1387
#define PG_DIAG_DATATYPE_NAME
Definition: postgres_ext.h:68
#define PG_DIAG_CONSTRAINT_NAME
Definition: postgres_ext.h:69
char * column_name
Definition: elog.h:391
struct MemoryContextData * assoc_context
Definition: elog.h:400
#define elog(elevel,...)
Definition: elog.h:232
char * constraint_name
Definition: elog.h:393

◆ err_gettext()

static const char * err_gettext ( const char *  str)
inlinestatic

Definition at line 303 of file elog.c.

References gettext, in_error_recursion_trouble(), pg_attribute_cold, and generate_unaccent_rules::str.

304 {
305 #ifdef ENABLE_NLS
307  return str;
308  else
309  return gettext(str);
310 #else
311  return str;
312 #endif
313 }
#define gettext(x)
Definition: c.h:1180
bool in_error_recursion_trouble(void)
Definition: elog.c:291

◆ err_sendstring()

static void err_sendstring ( StringInfo  buf,
const char *  str 
)
static

Definition at line 3287 of file elog.c.

References in_error_recursion_trouble(), pq_send_ascii_string(), and pq_sendstring().

Referenced by send_message_to_frontend().

3288 {
3290  pq_send_ascii_string(buf, str);
3291  else
3292  pq_sendstring(buf, str);
3293 }
void pq_sendstring(StringInfo buf, const char *str)
Definition: pqformat.c:197
void pq_send_ascii_string(StringInfo buf, const char *str)
Definition: pqformat.c:229
bool in_error_recursion_trouble(void)
Definition: elog.c:291

◆ errbacktrace()

int errbacktrace ( void  )

Definition at line 931 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, errordata_stack_depth, MemoryContextSwitchTo(), recursion_depth, and set_backtrace().

932 {
934  MemoryContext oldcontext;
935 
936  recursion_depth++;
938  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
939 
940  set_backtrace(edata, 1);
941 
942  MemoryContextSwitchTo(oldcontext);
943  recursion_depth--;
944 
945  return 0;
946 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static pg_noinline void set_backtrace(ErrorData *edata, int num_skip)
Definition: elog.c:955
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:149
static int errordata_stack_depth
Definition: elog.c:147
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
struct MemoryContextData * assoc_context
Definition: elog.h:400

◆ errcode()

int errcode ( int  sqlerrcode)

Definition at line 698 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::sqlerrcode.

Referenced by _arrq_cons(), _bt_check_third_page(), _bt_check_unique(), _bt_checkpage(), _bt_get_endpoint(), _bt_getmeta(), _bt_gettrueroot(), _bt_insert_parent(), _bt_lock_subtree_parent(), _bt_mark_page_halfdead(), _bt_pagedel(), _bt_split(), _bt_unlink_halfdead_page(), _crypt_blowfish_rn(), _hash_addovflpage(), _hash_checkpage(), _hash_doinsert(), _hash_first(), _hash_init(), _hash_ovflblkno_to_bitno(), _intbig_in(), _intbig_out(), _lca(), _lt_q_regex(), _ltree_compress(), _PG_init(), _SPI_commit(), _SPI_execute_plan(), _SPI_rollback(), AbortBufferIO(), accumArrayResultArr(), aclcheck_error(), aclcheck_error_col(), aclinsert(), aclitemin(), aclparse(), aclremove(), add_json(), add_jsonb(), add_parameter_name(), add_reloption_kind(), add_rte_to_flat_rtable(), add_size(), addCompoundAffixFlagValue(), AddEnumLabel(), addFamilyMember(), addFkRecurseReferenced(), addFkRecurseReferencing(), AddQual(), addRangeTableEntryForCTE(), addRangeTableEntryForFunction(), addRangeTableEntryForJoin(), addRangeTableEntryForSubquery(), addRangeTableEntryForValues(), AddRelationNewConstraints(), AddRoleMems(), addTargetToSortList(), AdjustIntervalForTypmod(), AdjustTimestampForTypmodError(), advance_windowaggregate(), afterTriggerMarkEvents(), AfterTriggerSetState(), AggregateCreate(), alen_object_start(), alen_scalar(), AllocateDir(), AllocateFile(), AllocateVfd(), AllocSetContextCreateInternal(), AlterDatabase(), AlterDatabaseOwner(), AlterDomainAddConstraint(), AlterDomainDropConstraint(), AlterDomainNotNull(), AlterDomainValidateConstraint(), AlterEventTrigger(), AlterEventTriggerOwner(), AlterEventTriggerOwner_internal(), AlterEventTriggerOwner_oid(), AlterExtensionNamespace(), AlterForeignDataWrapper(), AlterForeignDataWrapperOwner(), AlterForeignDataWrapperOwner_internal(), AlterForeignDataWrapperOwner_oid(), AlterForeignServer(), AlterForeignServerOwner(), AlterForeignServerOwner_oid(), AlterFunction(), AlterObjectNamespace_internal(), AlterObjectRename_internal(), AlterOperator(), AlterOpFamily(), AlterOpFamilyAdd(), AlterOpFamilyDrop(), AlterPolicy(), AlterPublication(), AlterPublicationOwner(), AlterPublicationOwner_internal(), AlterPublicationOwner_oid(), AlterPublicationTables(), AlterRelationNamespaceInternal(), AlterRole(), AlterRoleSet(), AlterSchemaOwner(), AlterStatistics(), AlterSubscription(), AlterSubscriptionOwner(), AlterSubscriptionOwner_internal(), AlterSubscriptionOwner_oid(), AlterSystemSetConfigFile(), AlterTableMoveAll(), AlterTableNamespace(), AlterTableSpaceOptions(), AlterTSConfiguration(), AlterType(), AlterTypeNamespace(), AlterTypeNamespace_oid(), AlterTypeNamespaceInternal(), AlterTypeOwner(), AlterUserMapping(), analyzeCTE(), analyzeCTETargetList(), anybit_typmodin(), anychar_typmodin(), anymultirange_in(), anytime_typmod_check(), anytime_typmodin(), anytimestamp_typmod_check(), anytimestamp_typmodin(), appendElement(), appendKey(), apply_dispatch(), apply_handle_origin(), apply_typmod(), apply_typmod_special(), apw_start_database_worker(), apw_start_leader_worker(), array_agg_array_transfn(), array_agg_transfn(), array_append(), array_cat(), array_cmp(), array_contain_compare(), array_eq(), array_exec_setup(), array_fill(), array_fill_internal(), array_fill_with_lower_bounds(), array_get_slice(), array_in(), array_iterator(), array_map(), array_position_common(), array_positions(), array_prepend(), array_recv(), array_replace_internal(), array_send(), array_set_element(), array_set_element_expanded(), array_set_slice(), array_subscript_check_subscripts(), array_subscript_transform(), array_to_datum_internal(), array_to_tsvector(), ArrayCount(), ArrayGetIntegerTypmods(), ArrayGetNItems(), arrq_cons(), ascii(), ASN1_STRING_to_text(), assign_backendlist_entry(), assign_client_encoding(), assign_collations_walker(), assign_hypothetical_collations(), assign_record_type_identifier(), assignOperTypes(), assignProcTypes(), AssignTypeArrayOid(), AssignTypeMultirangeArrayOid(), AssignTypeMultirangeOid(), Async_Notify(), ATAddCheckConstraint(), ATAddForeignKeyConstraint(), AtEOSubXact_SPI(), AtEOXact_SPI(), ATExecAddColumn(), ATExecAddConstraint(), ATExecAddIdentity(), ATExecAddIndexConstraint(), ATExecAddInherit(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecAlterColumnType(), ATExecAlterConstraint(), ATExecAttachPartition(), ATExecAttachPartitionIdx(), ATExecChangeOwner(), ATExecCheckNotNull(), ATExecClusterOn(), ATExecColumnDefault(), ATExecDetachPartition(), ATExecDropColumn(), ATExecDropConstraint(), ATExecDropExpression(), ATExecDropIdentity(), ATExecDropInherit(), ATExecDropNotNull(), ATExecDropOf(), ATExecGenericOptions(), ATExecReplicaIdentity(), ATExecSetCompression(), ATExecSetIdentity(), ATExecSetNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetStatistics(), ATExecSetStorage(), ATExecValidateConstraint(), ATPrepAddColumn(), ATPrepAddInherit(), ATPrepAlterColumnType(), AtPrepare_Locks(), AtPrepare_Notify(), AtPrepare_RelationMap(), ATPrepChangePersistence(), ATPrepCmd(), ATPrepDropColumn(), ATPrepDropExpression(), ATPrepDropNotNull(), ATPrepSetNotNull(), ATPrepSetTableSpace(), ATRewriteTable(), ATRewriteTables(), ATSimplePermissions(), AtSubCommit_childXids(), attach_internal(), AttachPartitionEnsureIndexes(), ATWrongRelkindError(), auth_failed(), auth_peer(), autoinc(), autoprewarm_database_main(), autoprewarm_start_worker(), AuxiliaryProcessMain(), BackendRun(), BackendStartup(), BackgroundWorkerInitializeConnection(), BackgroundWorkerInitializeConnectionByOid(), BackgroundWorkerStateChange(), BasicOpenFilePerm(), be_lo_close(), be_lo_get_fragment(), be_lo_lseek(), be_lo_lseek64(), be_lo_put(), be_lo_tell(), be_lo_tell64(), be_lo_unlink(), be_tls_init(), be_tls_open_server(), be_tls_read(), be_tls_write(), before_shmem_exit(), begin_prepare_cb_wrapper(), BeginCopyFrom(), BeginCopyTo(), BeginInternalSubTransaction(), BeginTransactionBlock(), bernoulli_beginsamplescan(), bgworker_die(), binary_decode(), binary_encode(), bit(), bit_and(), bit_catenate(), bit_in(), bit_or(), bit_overlay(), bit_recv(), bitgetbit(), bitsetbit(), bitsubstring(), bittoint4(), bittoint8(), bitxor(), blvalidate(), boolin(), BootstrapToastTable(), bpchar(), bpchar_input(), bqarr_in(), bqarr_out(), brin_bloom_summary_in(), brin_bloom_summary_recv(), brin_desummarize_range(), brin_doinsert(), brin_doupdate(), brin_getinsertbuffer(), brin_metapage_info(), brin_minmax_multi_distance_interval(), brin_minmax_multi_summary_in(), brin_minmax_multi_summary_recv(), brin_page_items(), brin_page_type(), brin_revmap_data(), brin_summarize_range(), brinGetTupleForHeapBlock(), brininsert(), brinRevmapDesummarizeRange(), brinvalidate(), bt_check_every_level(), bt_check_level_from_leftmost(), bt_child_check(), bt_child_highkey_check(), bt_downlink_missing_check(), bt_index_check_internal(), bt_metap(), bt_normalize_tuple(), bt_page_items_bytea(), bt_page_items_internal(), bt_page_stats_internal(), bt_recheck_sibling_links(), bt_right_page_check_scankey(), bt_target_page_check(), bt_tuple_present_callback(), btree_index_checkable(), btree_index_mainfork_expected(), BTreeTupleGetHeapTIDCareful(), btvacuumpage(), btvalidate(), build_attrmap_by_name(), build_attrmap_by_position(), build_column_default(), build_datatype(), build_pertrans_for_aggref(), build_server_first_message(), build_tuplestore_recursively(), BuildDescForRelation(), buildRelationAliases(), BuildRelationExtStatistics(), bytea_overlay(), bytea_substring(), byteaGetBit(), byteaGetByte(), byteain(), byteaout(), byteaSetBit(), byteaSetByte(), calc_rank_cd(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_pltcl_start_proc(), call_real_check_hook(), call_string_check_hook(), cannotCastJsonbValue(), cash_dist(), cash_div_cash(), cash_div_flt4(), cash_div_flt8(), cash_div_int2(), cash_div_int4(), cash_div_int8(), cash_in(), CastCreate(), changeDependenciesOn(), char2wchar(), check_acl(), check_agg_arguments(), check_agg_arguments_walker(), check_agglevels_and_constraints(), check_circularity(), check_collation_set(), check_conn_params(), check_default_partition_contents(), check_default_table_access_method(), check_default_tablespace(), check_duplicates_in_publist(), check_enable_rls(), check_encoding_locale_matches(), check_exclusion_or_unique_constraint(), check_for_column_name_collision(), check_foreign_key(), check_ident_usermap(), check_index_is_clusterable(), check_is_member_of_role(), check_lateral_ref_ok(), check_nested_generated_walker(), check_new_partition_bound(), check_object_ownership(), check_of_type(), check_parameter_resolution_walker(), check_password(), check_permissions(), check_primary_key(), check_publication_add_relation(), check_relation_privileges(), check_relation_relkind(), check_relation_updatable(), check_restricted_library_name(), check_role(), check_rolespec_name(), check_safe_enum_use(), check_session_authorization(), check_sql_fn_retval(), check_sql_fn_statements(), check_srf_call_placement(), check_ssl_key_file_permissions(), check_stack_depth(), check_strxfrm_bug(), check_temp_tablespaces(), check_transform_function(), check_TSCurrentConfig(), check_ungrouped_columns_walker(), check_unicode_value(), check_valid_extension_name(), check_valid_version_name(), CheckAttributeNamesTypes(), CheckAttributeType(), CheckCmdReplicaIdentity(), checkDataDir(), checkDomainOwner(), checkEnumOwner(), checkExprIsVarFree(), CheckForSerializableConflictIn(), CheckForSerializableConflictOut(), CheckForSerializableConflictOutNeeded(), CheckFunctionValidatorAccess(), CheckIndexCompatible(), checkInsertTargets(), CheckLogicalDecodingRequirements(), CheckMD5Auth(), CheckMyDatabase(), checkNameSpaceConflicts(), CheckPredicate(), CheckRecoveryConflictDeadlock(), CheckRelationTableSpaceMove(), CheckRestrictedOperation(), checkRuleResultList(), CheckSCRAMAuth(), CheckSelectLocking(), CheckSetNamespace(), checkSharedDependencies(), CheckSlotRequirements(), checkStringLen(), CheckSubscriptionRelkind(), CheckTableNotInUse(), checkTargetlistEntrySQL92(), checkTimezoneIsUsedForCast(), CheckTransactionBlock(), CheckValidResultRel(), CheckValidRowMarkRel(), CheckVarSlotCompatibility(), checkViewTupleDesc(), checkWellFormedRecursion(), checkWellFormedRecursionWalker(), choose_hashed_setop(), chr(), cidr_abbrev(), cidr_set_masklen(), circle_in(), circle_poly(), circle_recv(), ClientAuthentication(), CloneFkReferencing(), close_lb(), close_sl(), ClosePipeFromProgram(), ClosePipeToProgram(), cluster(), cluster_rel(), coerce_record_to_complex(), coerce_to_boolean(), coerce_to_common_type(), coerce_to_specific_type_typmod(), CollationCreate(), collectMatchBitmap(), colNameToVar(), CommandCounterIncrement(), CommentObject(), commit_prepared_cb_wrapper(), comparetup_index_btree(), compatConnectbyTupleDescs(), compatCrosstabTupleDescs(), compatible_oper(), compile_plperl_function(), compile_pltcl_function(), compileTheLexeme(), compileTheSubstitute(), complex_in(), compute_common_attribute(), compute_function_attributes(), compute_return_type(), ComputeIndexAttrs(), ComputePartitionAttrs(), ConnCreate(), connect_pg_server(), connectby_text(), connectby_text_serial(), construct_md_array(), ConversionCreate(), convert_and_check_filename(), convert_any_priv_string(), convert_column_name(), convert_function_name(), convert_priv_string(), convert_type_name(), convertJsonbArray(), convertJsonbObject(), cookConstraint(), cookDefault(), copy_replication_slot(), CopyFrom(), CopyGetAttnums(), CopyGetData(), CopyReadAttributesCSV(), CopyReadAttributesText(), CopyReadBinaryAttribute(), CopyReadLineText(), create_ctas_nodata(), create_distinct_paths(), create_ordinary_grouping_paths(), create_tablespace_directories(), CreateAccessMethod(), CreateCast(), CreateConversionCommand(), createdb(), CreateDecodingContext(), CreateEventTrigger(), CreateExtension(), CreateExtensionInternal(), CreateForeignDataWrapper(), CreateForeignServer(), CreateFunction(), CreateInheritance(), CreateInitDecodingContext(), CreateLockFile(), createNewConnection(), CreateOpFamily(), CreatePolicy(), CreatePortal(), CreatePredicateLock(), CreateProceduralLanguage(), CreatePublication(), CreateRole(), CreateSchemaCommand(), CreateStatistics(), CreateSubscription(), CreateTableAsRelExists(), CreateTableSpace(), CreateTransform(), CreateTrigger(), CreateUserMapping(), crosstab(), crosstab_hash(), cube_a_f8(), cube_a_f8_f8(), cube_c_f8(), cube_c_f8_f8(), cube_coord(), cube_coord_llur(), cube_recv(), cube_subset(), currval_oid(), cursor_to_xml(), cursor_to_xmlschema(), dacos(), dacosd(), dacosh(), dasin(), dasind(), datanh(), date2timestamp_opt_overflow(), date2timestamptz_opt_overflow(), date_in(), date_mi(), date_mii(), date_pli(), date_recv(), datetime_timestamp(), DateTimeParseError(), datetimetz_timestamptz(), datum_to_json(), datum_to_jsonb(), datumGetSize(), db_encoding_convert(), dblink_build_sql_delete(), dblink_build_sql_insert(), dblink_build_sql_update(), dblink_connect(), dblink_connstr_check(), dblink_exec(), dblink_fdw_validator(), dblink_fetch(), dblink_get_conn(), dblink_res_error(), dblink_security_check(), DCH_datetime_type(), DCH_from_char(), DCH_to_char(), dcos(), dcosd(), dcot(), dcotd(), DeadLockReport(), DecodeDateTime(), DecodeTimeOnly(), deconstruct_array(), DeconstructQualifiedName(), defGetBoolean(), defGetInt32(), defGetInt64(), defGetNumeric(), defGetQualifiedName(), defGetString(), defGetStringList(), defGetTypeLength(), defGetTypeName(), define_custom_variable(), DefineAggregate(), DefineCollation(), DefineCompositeType(), DefineDomain(), DefineEnum(), DefineIndex(), DefineOpClass(), DefineOperator(), DefineOpFamily(), DefineQueryRewrite(), DefineRange(), DefineRelation(), DefineSavepoint(), DefineSequence(), DefineTSConfiguration(), DefineTSDictionary(), DefineTSParser(), DefineTSTemplate(), DefineType(), DefineView(), DefineVirtualRelation(), deflist_to_tuplestore(), deleteConnection(), DeleteInheritsTuple(), DelRoleMems(), deserialize_deflist(), destroy_tablespace_directories(), DetermineTimeZoneAbbrevOffsetTS(), dintdict_init(), dispell_init(), dist_bl(), dist_lb(), div_var(), div_var_fast(), dlog1(), dlog10(), do_analyze_rel(), do_compile(), do_pg_start_backup(), do_pg_stop_backup(), do_setval(), do_to_timestamp(), DoCopy(), domain_check_input(), domain_state_setup(), domainAddConstraint(), dpow(), DropConfigurationMapping(), DropDatabase(), dropdb(), DropErrorMsgNonExistent(), DropErrorMsgWrongType(), dropOperators(), DropOwnedObjects(), dropProcedures(), DropRole(), DropSubscription(), DropTableSpace(), dsa_allocate_extended(), dsa_attach(), dshash_create(), dsimple_init(), dsin(), dsind(), dsm_backend_startup(), dsm_create(), dsm_impl_sysv(), dsnowball_init(), dsqrt(), dsynonym_init(), dtan(), dtand(), dtoi2(), dtoi4(), dtoi8(), dummy_object_relabel(), dumptuples(), dxsyn_init(), EA_get_flat_size(), each_array_start(), each_scalar(), each_worker(), each_worker_jsonb(), ean2isn(), ean2string(), elements_object_start(), elements_scalar(), elements_worker(), elements_worker_jsonb(), EmitWarningsOnPlaceholders(), EnableDisableRule(), EnableDisableTrigger(), EnableLockPagesPrivilege(), EndPrepare(), EndTransactionBlock(), enforce_generic_type_consistency(), enlargeStringInfo(), entry_reset(), enum_cmp_internal(), enum_first(), enum_in(), enum_last(), enum_out(), enum_range_all(), enum_range_bounds(), enum_recv(), enum_send(), EnumValuesCreate(), errcode_for_dynamic_shared_memory(), error_commit_ts_disabled(), error_duplicate_filter_variable(), errorMissingColumn(), errorMissingRTE(), esc_dec_len(), esc_decode(), EvalPlanQualFetchRowMark(), EvaluateParams(), exec_assign_value(), exec_bind_message(), exec_describe_portal_message(), exec_describe_statement_message(), exec_dynquery_with_params(), exec_eval_datum(), exec_eval_expr(), exec_execute_message(), exec_init_tuple_store(), exec_move_row_from_fields(), exec_object_restorecon(), exec_parse_message(), exec_replication_command(), exec_run_select(), exec_simple_query(), exec_stmt_assert(), exec_stmt_case(), exec_stmt_close(), exec_stmt_dynexecute(), exec_stmt_execsql(), exec_stmt_fetch(), exec_stmt_forc(), exec_stmt_foreach_a(), exec_stmt_fori(), exec_stmt_getdiag(), exec_stmt_open(), exec_stmt_raise(), exec_stmt_return(), exec_stmt_return_next(), exec_stmt_return_query(), ExecAlterDefaultPrivilegesStmt(), ExecAlterExtensionContentsStmt(), ExecAlterExtensionStmt(), ExecBRInsertTriggers(), ExecBSDeleteTriggers(), ExecBSInsertTriggers(), ExecBSTruncateTriggers(), ExecBSUpdateTriggers(), ExecBuildUpdateProjection(), ExecCallTriggerFunc(), ExecCheckIndexConstraints(), ExecCheckPlanOutput(), ExecCheckTupleVisible(), ExecConstraints(), ExecCrossPartitionUpdate(), execCurrentOf(), ExecCustomMarkPos(), ExecCustomRestrPos(), ExecDelete(), ExecEvalArrayExpr(), ExecEvalConstraintCheck(), ExecEvalConstraintNotNull(), ExecEvalCurrentOfExpr(), ExecEvalFieldSelect(), ExecEvalParamExtern(), ExecEvalWholeRowVar(), ExecFindPartition(), ExecGrant_Language(), ExecGrant_Relation(), ExecGrant_Type(), ExecInitAgg(), ExecInitExprRec(), ExecInitFunc(), ExecInitMergeJoin(), ExecInitSubscriptingRef(), ExecLockRows(), ExecMakeFunctionResultSet(), ExecMakeTableFunctionResult(), ExecOnConflictUpdate(), ExecOpenScanRelation(), ExecPartitionCheckEmitError(), ExecPrepareTuplestoreResult(), ExecRefreshMatView(), ExecReindex(), ExecScanSubPlan(), ExecSecLabelStmt(), ExecSetParamPlan(), ExecSetVariableStmt(), ExecUpdate(), execute_extension_script(), execute_sql_string(), executeBinaryArithmExpr(), ExecuteCallStmt(), executeDateTimeMethod(), ExecuteDoStmt(), ExecuteGrantStmt(), executeItemOptUnwrapTarget(), executeJsonPath(), executeKeyValueMethod(), executeNumericItemMethod(), ExecuteQuery(), ExecuteTruncate(), executeUnaryArithmExpr(), ExecVacuum(), ExecWindowAgg(), ExecWithCheckOptions(), ExitPostmaster(), exp_var(), expand_col_privileges(), expand_vacuum_rel(), ExpandAllTables(), ExpandColumnRefStar(), expandTableLikeClause(), ExplainQuery(), ExportSnapshot(), exprType(), extract_date(), extract_variadic_args(), ExtractExtensionList(), extractModify(), FastPathGetRelationLockEntry(), fatal_llvm_error_handler(), fatal_system_new_handler(), fetch_array_arg_replace_nulls(), fetch_cursor_param_value(), fetch_finfo_record(), fetch_fp_info(), FetchDynamicTimeZone(), FetchPreparedStatement(), file_fdw_validator(), FileWrite(), finalize_grouping_exprs_walker(), find_composite_type_dependencies(), find_expr_references_walker(), find_in_dynamic_libpath(), find_my_exec(), find_option(), find_provider(), find_typed_table_dependencies(), findDependentObjects(), findRangeCanonicalFunction(), findRangeSubOpclass(), findRangeSubtypeDiffFunction(), findTargetlistEntrySQL92(), findTypeAnalyzeFunction(), findTypeInputFunction(), findTypeOutputFunction(), findTypeReceiveFunction(), findTypeSendFunction(), findTypeSubscriptingFunction(), findTypeTypmodinFunction(), findTypeTypmodoutFunction(), finish_nodeitem(), fireRIRrules(), fixed_paramref_hook(), flatten_set_variable_args(), flattenJsonPathParseItem(), float4in(), float8_timestamptz(), float8in_internal_opt_error(), float_overflow_error(), float_underflow_error(), float_zero_divide_error(), FloatExceptionHandler(), fmgr_info_cxt_security(), fmgr_internal_validator(), fmgr_sql(), fmgr_sql_validator(), forbidden_in_wal_sender(), forkname_to_number(), free_parsestate(), FreezeMultiXactId(), from_char_parse_int_len(), from_char_seq_search(), from_char_set_int(), from_char_set_mode(), fsm_page_contents(), ftoi2(), ftoi4(), ftoi8(), func_select_candidate(), g_cube_distance(), gbtreekey_in(), gbtreekey_out(), gen_random_uuid(), generate_recursion_path(), generate_series_step_int4(), generate_series_step_int8(), generate_series_step_numeric(), generate_series_timestamp(), generate_series_timestamptz(), generateClonedIndexStmt(), generateSerialExtraStmts(), GenerationContextCreate(), Generic_Text_IC_like(), GenericMatchText(), get_am_type_oid(), get_cached_rowtype(), get_cast_oid(), get_collation_oid(), get_collation_version_for_oid(), get_connect_string(), get_controlfile(), get_conversion_oid(), get_crosstab_tuplestore(), get_database_oid(), get_domain_constraint_oid(), get_event_trigger_oid(), get_expr_result_tupdesc(), get_extension_oid(), get_fn_opclass_options(), get_foreign_data_wrapper_oid(), get_foreign_server_oid(), get_func_expr(), get_hex(), get_language_oid(), get_multirange_io_data(), get_namespace_oid(), get_object_address(), get_object_address_attrdef(), get_object_address_attribute(), get_object_address_defacl(), get_object_address_opf_member(), get_object_address_publication_rel(), get_object_address_relobject(), get_object_address_type(), get_object_address_usermapping(), get_other_operator(), get_page_from_raw(), get_publication_oid(), get_range_io_data(), get_raw_page_1_9(), get_raw_page_fork_1_9(), get_raw_page_internal(), get_record_type_from_argument(), get_record_type_from_query(), get_relation_by_qualified_name(), get_relation_constraint_attnos(), get_relation_constraint_oid(), get_relation_info(), get_relation_policy_oid(), get_required_extension(), get_rewrite_oid(), get_role_oid(), get_rolespec_oid(), get_rolespec_tuple(), get_rte_attribute_is_dropped(), get_sort_group_operators(), get_sql_insert(), get_sql_update(), get_statistics_object_oid(), get_subscription_oid(), get_tablespace_oid(), get_th(), get_transform_oid(), get_trigger_oid(), get_ts_config_oid(), get_ts_dict_oid(), get_ts_parser_func(), get_ts_parser_oid(), get_ts_template_func(), get_ts_template_oid(), get_tsearch_config_filename(), get_tuple_of_interest(), get_windowfunc_expr(), getAffixFlagSet(), getArrayIndex(), GetAttributeCompression(), GetColumnDefCollation(), GetConfigOption(), GetConfigOptionByName(), GetConfigOptionResetString(), GetConflictingVirtualXIDs(), GetCurrentTimeUsec(), getdatafield(), GetDefaultOpClass(), GetDefaultTablespace(), GetExtensibleNodeEntry(), GetFdwRoutineByServerId(), getid(), GetIndexAmRoutineByAmId(), getJsonPathVariable(), GetMultiXactIdMembers(), GetNewMultiXactId(), GetNewTransactionId(), getNextFlagFromString(), GetRunningTransactionData(), GetSafeSnapshot(), GetSerializableTransactionSnapshot(), GetSerializableTransactionSnapshotInt(), GetSnapshotData(), gettoken_query(), gettoken_query_standard(), gettoken_tsvector(), getTokenTypes(), GetTupleForTrigger(), getTypeBinaryInputInfo(), getTypeBinaryOutputInfo(), getTypeInputInfo(), getTypeOutputInfo(), GetUserMapping(), GetUserNameFromId(), getWeights(), gin_clean_pending_list(), gin_leafpage_items(), gin_metapage_info(), gin_page_opaque_info(), ginadjustmembers(), ginCombineData(), GinFormTuple(), ginvalidate(), gist_page_items(), gist_page_items_bytea(), gist_page_opaque_info(), gistadjustmembers(), gistcheckpage(), gistSplit(), gistUserPicksplit(), gistvalidate(), GrantRole(), grouping_planner(), gtsvectorin(), guc_malloc(), guc_realloc(), guc_strdup(), HandleConcurrentAbort(), HandleFunctionRequest(), HandleParallelMessages(), has_sequence_privilege_id(), has_sequence_privilege_id_id(), has_sequence_privilege_id_name(), has_sequence_privilege_name(), has_sequence_privilege_name_id(), has_sequence_privilege_name_name(), hash_array(), hash_array_extended(), hash_array_start(), hash_bitmap_info(), hash_create(), hash_metapage_info(), hash_multirange(), hash_multirange_extended(), hash_page_items(), hash_page_stats(), hash_page_type(), hash_range(), hash_range_extended(), hash_record(), hash_record_extended(), hash_scalar(), hash_search_with_hash_value(), hashbpchar(), hashbpcharextended(), hashtext(), hashtextextended(), hashvalidate(), heap_acquire_tuplock(), heap_create(), heap_create_with_catalog(), heap_delete(), heap_fetch_toast_slice(), heap_force_common(), heap_form_minimal_tuple(), heap_form_tuple(), heap_getnext(), heap_inplace_update(), heap_lock_tuple(), heap_page_items(), heap_prepare_freeze_tuple(), heap_prepare_insert(), heap_truncate_check_FKs(), heap_tuple_infomask_flags(), heap_update(), heapam_index_build_range_scan(), heapam_index_validate_scan(), heapam_tuple_lock(), hex2_to_uchar(), hlparsetext(), HoldPinnedPortals(), hstore_from_array(), hstore_from_arrays(), hstore_populate_record(), hstore_recv(), hstore_subscript_assign(), hstore_subscript_transform(), hstore_to_plpython(), hstoreArrayToPairs(), hstoreCheckKeyLen(), hstoreCheckValLen(), i4tochar(), i4toi2(), i8tooid(), identify_update_path(), ImportForeignSchema(), ImportSnapshot(), in_range_float4_float8(), in_range_float8_float8(), in_range_int2_int4(), in_range_int4_int4(), in_range_int4_int8(), in_range_int8_int8(), in_range_interval_interval(), in_range_numeric_numeric(), in_range_time_interval(), in_range_timestamp_interval(), in_range_timestamptz_interval(), in_range_timetz_interval(), index_check_primary_key(), index_concurrently_create_copy(), index_constraint_create(), index_create(), index_drop(), index_form_tuple(), index_opclass_options(), index_open(), IndexOnlyNext(), inet_abbrev(), inet_merge(), inet_set_masklen(), inetand(), inetmi(), inetor(), infer_arbiter_indexes(), init_execution_state(), init_MultiFuncCall(), init_params(), init_sequence(), init_sexpr(), initArrayResultArr(), InitControlFile(), InitFileAccess(), initGinState(), initialize_dh(), initialize_ecdh(), initialize_peragg(), InitializeClientEncoding(), InitializeSessionUserId(), InitLocalBuffers(), InitPgFdwOptions(), InitPostgres(), InitProcess(), InitTempTableNamespace(), initTrie(), inner_subltree(), insert_username(), InsertRule(), instantiate_empty_record_variable(), int24div(), int24mi(), int24mul(), int24pl(), int28div(), int28mi(), int28mul(), int28pl(), int2_dist(), int2abs(), int2div(), int2mi(), int2mod(), int2mul(), int2pl(), int2um(), int2vectorin(), int2vectorrecv(), int42div(), int42mi(), int42mul(), int42pl(), int48div(), int48mi(), int48mul(), int48pl(), int4_dist(), int4abs(), int4div(), int4gcd_internal(), int4inc(), int4lcm(), int4mi(), int4mod(), int4mul(), int4pl(), int4um(), int82(), int82div(), int82mi(), int82mul(), int82pl(), int84(), int84div(), int84mi(), int84mul(), int84pl(), int8_dist(), int8abs(), int8dec(), int8div(), int8gcd_internal(), int8inc(), int8lcm(), int8mi(), int8mod(), int8mul(), int8pl(), int8um(), internal_get_result_type(), internal_inetpl(), internal_load_library(), interpret_AS_clause(), interpret_func_parallel(), interpret_func_support(), interpret_function_parameter_list(), interval2tm(), interval_div(), interval_in(), interval_mi(), interval_mul(), interval_part_common(), interval_pl(), interval_trunc(), interval_um(), intervaltypmodin(), intorel_startup(), inv_open(), inv_read(), inv_seek(), inv_truncate(), inv_write(), iso8859_to_utf8(), IsThereCollationInNamespace(), IsThereFunctionInNamespace(), IsThereOpClassInNamespace(), IsThereOpFamilyInNamespace(), json_agg_transfn(), json_build_object(), json_ereport_error(), json_object(), json_object_agg_transfn(), json_object_two_arg(), jsonb_agg_transfn(), jsonb_array_length(), jsonb_build_object(), jsonb_delete(), jsonb_delete_array(), jsonb_delete_idx(), jsonb_delete_path(), jsonb_insert(), jsonb_object(), jsonb_object_agg_transfn(), jsonb_object_keys(), jsonb_object_two_arg(), jsonb_path_match_internal(), jsonb_set(), jsonb_set_lax(), jsonb_subscript_check_subscripts(), jsonb_subscript_transform(), JsonEncodeDateTime(), jsonPathFromCstring(), JsValueToJsObject(), LargeObjectDrop(), lastval(), lc_ctype_is_c(), length_in_encoding(), libpqrcv_check_conninfo(), libpqrcv_exec(), like_fixed_prefix(), line_construct_pp(), line_in(), line_recv(), ln_var(), lo_get_fragment_internal(), lo_read(), lo_truncate_internal(), lo_write(), load_categories_hash(), load_dh_file(), load_enum_cache_data(), load_external_function(), load_hba(), load_libraries(), load_relmap_file(), LocalBufferAlloc(), LocalToUtf(), locate_stem_module(), lock_twophase_recover(), LockAcquireExtended(), LockGXact(), LockTableRecurse(), LockViewRecurse_walker(), logicalrep_rel_open(), logicalrep_report_missing_attrs(), logicalrep_worker_attach(), logicalrep_worker_launch(), LogicalRepSyncTableStart(), lookup_agg_function(), lookup_am_handler_func(), lookup_fdw_handler_func(), lookup_rowtype_tupdesc_domain(), lookup_rowtype_tupdesc_internal(), lookup_type_cache(), LookupFuncName(), LookupFuncWithArgs(), LookupOperName(), LookupTypeNameExtended(), LookupTypeNameOid(), lowerstr_with_len(), lpad(), lt_q_regex(), ltree_concat(), ltree_gist_in(), ltree_gist_out(), ltree_to_plpython(), ltxtq_out(), ltxtq_send(), lz4_decompress_datum(), lz4_decompress_datum_slice(), macaddr8_in(), macaddr8tomacaddr(), macaddr_in(), make_absolute_path(), make_callstmt_target(), make_date(), make_distinct_op(), make_expanded_record_from_tupdesc(), make_expanded_record_from_typeid(), make_interval(), make_op(), make_outerjoininfo(), make_pathkeys_for_window(), make_result_opt_error(), make_row_comparison_op(), make_row_distinct_op(), make_ruledef(), make_scalar_array_op(), make_time(), make_timestamp_internal(), make_timestamptz_at_timezone(), make_tsvector(), makeArrayTypeName(), makeMultirangeTypeName(), makepol(), makeRangeVarFromNameList(), makeWholeRowVar(), map_sql_value_to_xml_value(), mark_index_clustered(), MarkAsPreparing(), MarkInheritDetached(), MarkPortalActive(), MatchText(), materializeResult(), md5_bytea(), md5_text(), mdextend(), mdread(), mdwrite(), MemoryContextAlloc(), MemoryContextAllocExtended(), MemoryContextAllocHuge(), MemoryContextAllocZero(), MemoryContextAllocZeroAligned(), merge_acl_with_grant(), merge_collation_state(), merge_publications(), MergeAttributes(), MergeAttributesIntoExisting(), MergeCheckConstraint(), MergeConstraintsIntoExisting(), MergeWithExistingConstraint(), metaphone(), moddatetime(), movedb(), mul_size(), multirange_constructor1(), multirange_constructor2(), multirange_in(), multirange_intersect_agg_transfn(), namerecv(), NamespaceCreate(), network_host(), network_in(), network_out(), network_recv(), network_show(), next_token(), NextCopyFrom(), nextval_internal(), NIAddAffix(), NIImportAffixes(), NIImportDictionary(), NIImportOOAffixes(), NISortDictionary(), NonFiniteTimestampTzPart(), normal_rand(), NUM_processor(), NUMDesc_prepare(), numeric_div_opt_error(), numeric_div_trunc(), numeric_fac(), numeric_in(), numeric_int2(), numeric_int4_opt_error(), numeric_int8(), numeric_ln(), numeric_log(), numeric_mod_opt_error(), numeric_pg_lsn(), numeric_power(), numeric_recv(), numeric_sqrt(), numerictypmodin(), numericvar_to_double_no_overflow(), objectNamesToOids(), oidin_subr(), oidvectorin(), oidvectorrecv(), okeys_array_start(), okeys_scalar(), on_proc_exit(), on_shmem_exit(), OnConflict_CheckForSerializationFailure(), op_error(), OpClassCacheLookup(), OpenPipeStream(), OpenTransientFilePerm(), OperatorCreate(), OperatorShellMake(), OpFamilyCacheLookup(), page_checksum_internal(), page_header(), PageAddItemExtended(), PageGetItemIdCareful(), PageIndexMultiDelete(), PageIndexTupleDelete(), PageIndexTupleDeleteNoCompact(), PageIndexTupleOverwrite(), PageIsVerifiedExtended(), PageRepairFragmentation(), pair_decode(), palloc(), palloc0(), palloc_btree_page(), palloc_extended(), ParallelWorkerMain(), parse_affentry(), parse_and_validate_value(), parse_basebackup_options(), parse_datetime(), parse_extension_control_file(), parse_fcall_arguments(), parse_format(), parse_func_options(), parse_hba_auth_opt(), parse_hba_line(), parse_ident(), parse_ident_line(), parse_jsonb_index_flags(), parse_key_value_arrays(), parse_lquery(), parse_ltree(), parse_one_reloption(), parse_output_parameters(), parse_phrase_operator(), parse_publication_options(), parse_re_flags(), parse_sane_timezone(), parse_snapshot(), parse_subscription_options(), parse_test_flags(), parse_tsquery(), parseCheckAggregates(), parseCreateReplSlotOptions(), ParseFuncOrColumn(), parseIntFromText(), parseNameAndArgTypes(), parseRelOptionsInternal(), parserOpenTable(), parsetext(), parseTypeString(), parseVxidFromText(), parseXidFromText(), path_add(), path_center(), path_decode(), path_in(), path_poly(), path_recv(), PathNameOpenFilePerm(), pclose_check(), percentile_cont_final_common(), percentile_disc_final(), perform_base_backup(), perform_default_encoding_conversion(), PerformCursorOpen(), PerformPortalClose(), PerformPortalFetch(), pg_any_to_server(), pg_atoi(), pg_attribute_aclmask_ext(), pg_attribute_noreturn(), pg_available_extension_versions(), pg_available_extensions(), pg_backup_start_time(), pg_base64_decode(), pg_be_scram_build_secret(), pg_be_scram_exchange(), pg_be_scram_init(), pg_cancel_backend(), pg_class_aclmask_ext(), pg_class_ownercheck(), pg_collation_for(), pg_collation_ownercheck(), pg_config(), pg_conversion_ownercheck(), pg_convert(), pg_create_restore_point(), pg_crypt(), pg_cryptohash_create(), pg_current_logfile(), pg_current_wal_flush_lsn(), pg_current_wal_insert_lsn(), pg_current_wal_lsn(), pg_cursor(), pg_database_aclmask(), pg_database_ownercheck(), pg_decode_startup(), pg_decrypt(), pg_decrypt_iv(), pg_dependencies_in(), pg_dependencies_recv(), pg_do_encoding_conversion(), pg_encrypt(), pg_encrypt_iv(), pg_event_trigger_ddl_commands(), pg_event_trigger_dropped_objects(), pg_event_trigger_ownercheck(), pg_event_trigger_table_rewrite_oid(), pg_event_trigger_table_rewrite_reason(), pg_extension_config_dump(), pg_extension_ownercheck(), pg_extension_update_paths(), pg_file_rename_internal(), pg_file_write_internal(), pg_foreign_data_wrapper_aclmask(), pg_foreign_data_wrapper_ownercheck(), pg_foreign_server_aclmask(), pg_foreign_server_ownercheck(), pg_freespace(), pg_gen_salt(), pg_gen_salt_rounds(), pg_get_backend_memory_contexts(), pg_get_functiondef(), pg_get_multixact_members(), pg_get_object_address(), pg_get_replication_slots(), pg_get_serial_sequence(), pg_get_shmem_allocations(), pg_get_wal_replay_pause_state(), pg_hba_file_rules(), pg_hex_decode(), pg_hmac_create(), pg_import_system_collations(), pg_is_wal_replay_paused(), pg_language_aclmask(), pg_language_ownercheck(), pg_largeobject_aclmask_snapshot(), pg_largeobject_ownercheck(), pg_log_backend_memory_contexts(), pg_logdir_ls(), pg_logdir_ls_internal(), pg_logical_slot_get_changes_guts(), pg_ls_dir(), pg_ls_dir_files(), pg_ls_tmpdir(), pg_lsn_in(), pg_lsn_mii(), pg_lsn_pli(), pg_mcv_list_in(), pg_mcv_list_recv(), pg_namespace_aclmask(), pg_namespace_ownercheck(), pg_ndistinct_in(), pg_ndistinct_recv(), pg_newlocale_from_collation(), pg_nextoid(), pg_opclass_ownercheck(), pg_oper_ownercheck(), pg_opfamily_ownercheck(), pg_prepared_statement(), pg_prewarm(), pg_proc_aclmask(), pg_proc_ownercheck(), pg_promote(), pg_publication_ownercheck(), pg_random_bytes(), pg_read_binary_file(), pg_read_file(), pg_read_file_v2(), pg_relpages(), pg_relpagesbyid(), pg_replication_origin_create(), pg_replication_origin_session_progress(), pg_replication_origin_xact_setup(), pg_replication_slot_advance(), pg_rotate_logfile(), pg_sequence_last_value(), pg_sequence_parameters(), pg_set_regex_collation(), pg_show_replication_origin_status(), pg_size_bytes(), pg_snapshot_recv(), pg_start_backup(), pg_stat_get_activity(), pg_stat_get_prefetch_recovery(), pg_stat_get_progress_info(), pg_stat_get_replication_slots(), pg_stat_get_slru(), pg_stat_get_subscription(), pg_stat_get_wal_senders(), pg_stat_statements_info(), pg_stat_statements_internal(), pg_statistics_object_ownercheck(), pg_stats_ext_mcvlist_items(), pg_stop_backup(), pg_stop_backup_v2(), pg_strtoint16(), pg_strtoint32(), pg_subscription_ownercheck(), pg_switch_wal(), pg_tablespace_aclmask(), pg_tablespace_databases(), pg_tablespace_location(), pg_tablespace_ownercheck(), pg_terminate_backend(), pg_timezone_names(), pg_to_ascii(), pg_ts_config_ownercheck(), pg_ts_dict_ownercheck(), pg_type_aclmask(), pg_type_ownercheck(), pg_unicode_to_server(), pg_visibility(), pg_visibility_map(), pg_wait_for_backend_termination(), pg_wait_until_termination(), pg_wal_replay_pause(), pg_wal_replay_resume(), pg_walfile_name(), pg_walfile_name_offset(), pgfdw_cancel_query(), pgfdw_reject_incomplete_xact_state_change(), pgfdw_report_error(), pgfdw_xact_callback(), PGLC_localeconv(), pglz_decompress_datum(), pglz_decompress_datum_slice(), pgoutput_startup(), pgrowlocks(), PGSharedMemoryCreate(), pgss_shmem_startup(), pgstat_heap(), pgstat_init(), pgstat_relation(), pgstat_reset_replslot_counter(), pgstat_reset_shared_counters(), pgstatginindex(), pgstatginindex_internal(), pgstathashindex(), pgstatindex(), pgstatindex_impl(), pgstatindexbyid(), pgstattuple(), pgstattuple_approx(), pgstattuple_approx_internal(), pgstattuplebyid(), placeChar(), plperl_array_to_datum(), plperl_build_tuple_result(), plperl_call_perl_event_trigger_func(), plperl_call_perl_func(), plperl_call_perl_trigger_func(), plperl_create_sub(), plperl_func_handler(), plperl_init_interp(), plperl_modify_tuple(), plperl_return_next_internal(), plperl_spi_execute_fetch_result(), plperl_sv_to_datum(), plperl_sv_to_literal(), plperl_to_hstore(), plperl_trigger_handler(), plperl_trusted_init(), plperl_untrusted_init(), plperl_validator(), plpgsql_build_variable(), plpgsql_exec_event_trigger(), plpgsql_exec_function(), plpgsql_exec_get_datum_type(), plpgsql_exec_get_datum_type_info(), plpgsql_exec_trigger(), plpgsql_param_eval_generic(), plpgsql_param_eval_generic_ro(), plpgsql_param_eval_recfield(), plpgsql_parse_cwordrowtype(), plpgsql_parse_err_condition(), plpgsql_parse_wordrowtype(), plpgsql_post_column_ref(), plpgsql_recognize_err_condition(), plpgsql_resolve_polymorphic_argtypes(), plpgsql_validator(), plpgsql_yyerror(), plpython_to_hstore(), pltcl_build_tuple_result(), pltcl_elog(), pltcl_func_handler(), pltcl_trigger_handler(), PLy_cursor_fetch(), PLy_elog_impl(), PLy_exec_function(), PLy_exec_trigger(), PLy_function_build_args(), PLy_modify_tuple(), PLy_output(), PLy_procedure_create(), PLy_spi_execute_fetch_result(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLyNumber_ToJsonbValue(), PLyObject_AsString(), PLyObject_ToJsonbValue(), PLySequence_ToArray(), PLySequence_ToArray_recurse(), PLySequence_ToComposite(), PLyString_ToComposite(), policy_role_list_to_array(), poly_distance(), poly_in(), poly_recv(), populate_array_check_dimension(), populate_array_report_expected_array(), populate_joinrel_with_paths(), populate_recordset_array_element_start(), populate_recordset_object_start(), populate_recordset_scalar(), populate_recordset_worker(), PortalDrop(), PortalRunSelect(), PortalSetResultFormat(), postgres_fdw_get_connections(), postgres_fdw_validator(), postgresBeginForeignInsert(), postgresExecForeignTruncate(), postgresImportForeignSchema(), PostgresMain(), postgresql_fdw_validator(), PostmasterMain(), PostPrepare_Locks(), power_var(), power_var_int(), pq_copymsgbytes(), pq_getmessage(), pq_getmsgbyte(), pq_getmsgbytes(), pq_getmsgend(), pq_getmsgrawstring(), pq_getmsgstring(), pq_getmsgtext(), pq_startmsgread(), PreCommit_CheckForSerializationFailure(), PreCommit_Notify(), PreCommit_Portals(), predicatelock_twophase_recover(), PrefetchBuffer(), prepare_cb_wrapper(), prepare_sql_fn_parse_info(), PrepareQuery(), PrepareRedoAdd(), PrepareTransaction(), preprocess_grouping_sets(), prepTuplestoreResult(), PreventCommandDuringRecovery(), PreventCommandIfParallelMode(), PreventCommandIfReadOnly(), PreventInTransactionBlock(), printtup_prepare_info(), ProcArrayAdd(), ProcedureCreate(), process_matched_tle(), process_owned_by(), process_postgres_switches(), ProcessCopyOptions(), ProcessGUCArray(), ProcessInterrupts(), ProcessRepliesIfAny(), ProcessStandbyMessage(), ProcessStartupPacket(), ProcessTwoPhaseBuffer(), processTypesSpec(), ProcessUtilitySlow(), ProcessWalRcvInterrupts(), protect_out_of_mem(), prsd_headline(), prssyntaxerror(), publication_add_relation(), PublicationDropTables(), pushquery(), PushTransaction(), pushval_asis(), pushValue(), pushValue_internal(), pvsnprintf(), px_crypt_des(), px_THROW_ERROR(), qtext_load_file(), QTN2QT(), QualifiedNameGetCreationNamespace(), query_to_xml_internal(), queryin(), quickdie(), range_agg_transfn(), range_constructor3(), range_minus_internal(), range_parse(), range_parse_bound(), range_parse_flags(), range_serialize(), range_union_internal(), RangeVarAdjustRelationPersistence(), RangeVarCallbackForAlterRelation(), RangeVarCallbackForAttachIndex(), RangeVarCallbackForDropRelation(), RangeVarCallbackForLockTable(), RangeVarCallbackForPolicy(), RangeVarCallbackForReindexIndex(), RangeVarCallbackForRenameRule(), RangeVarCallbackForRenameTrigger(), RangeVarCallbackOwnsRelation(), RangeVarCallbackOwnsTable(), RangeVarGetAndCheckCreationNamespace(), RangeVarGetCreationNamespace(), RangeVarGetRelidExtended(), raw_heap_insert(), RE_compile(), RE_compile_and_cache(), RE_wchar_execute(), read_any_attr(), read_attr_value(), read_backup_label(), read_binary_file(), read_client_final_message(), read_client_first_message(), read_dictionary(), read_objtype_from_string(), read_tablespace_map(), read_whole_file(), ReadArrayBinary(), ReadArrayStr(), ReadBuffer_common(), ReadBufferExtended(), ReadControlFile(), readRecoverySignalFile(), readstoplist(), ReadTwoPhaseFile(), ReassignOwnedObjects(), ReceiveCopyBinaryHeader(), recompute_limits(), record_cmp(), record_eq(), record_image_cmp(), record_image_eq(), record_in(), record_recv(), recordDependencyOnCurrentExtension(), RecoveryRequiresIntParameter(), recursive_revoke(), recv_password_packet(), refresh_by_match_merge(), refuseDupeIndexAttach(), regex_fixed_prefix(), regexp_fixed_prefix(), regexp_match(), regexp_split_to_array(), regexp_split_to_table(), RegisterBackgroundWorker(), RegisterExtensibleNodeEntry(), RegisterTimeout(), regnamespacein(), regoperatorin(), regoperin(), regprocedurein(), regprocin(), regrolein(), reindex_index(), reindex_relation(), ReindexMultipleTables(), ReindexRelationConcurrently(), RelationBuildPartitionKey(), RelationCopyStorage(), RelationFindReplTupleByIndex(), RelationFindReplTupleSeq(), RelationGetBufferForTuple(), ReleaseCurrentSubTransaction(), ReleaseOneSerializableXact(), ReleaseSavepoint(), remove_tablespace_symlink(), RemoveExtensionById(), RemoveInheritance(), RemoveObjects(), RemovePolicyById(), RemoveRelations(), RemoveRewriteRuleById(), RemoveRoleFromObjectPolicy(), RemoveSubscriptionRel(), RemoveTriggerById(), RemoveUserMapping(), rename_constraint_internal(), rename_policy(), renameatt_check(), renameatt_internal(), RenameConstraintById(), RenameDatabase(), RenameEnumLabel(), RenameRelationInternal(), RenameRewriteRule(), RenameRole(), RenameSchema(), RenameTableSpace(), renametrig(), RenameType(), RenameTypeInternal(), repalloc(), repalloc_huge(), repeat(), replace_rte_variables_mutator(), replace_text_regexp(), ReplaceVarsFromTargetList_callback(), ReplicationSlotAcquireInternal(), ReplicationSlotCreate(), ReplicationSlotsDropDBSlots(), ReplicationSlotValidateName(), replorigin_advance(), replorigin_by_name(), replorigin_by_oid(), replorigin_check_prerequisites(), replorigin_create(), replorigin_drop_guts(), replorigin_session_reset(), replorigin_session_setup(), report_invalid_encoding(), report_name_conflict(), report_namespace_conflict(), report_untranslatable_char(), reportDependentObjects(), requireSuperuser(), reserveAllocatedDesc(), resolve_anyarray_from_others(), resolve_anyelement_from_others(), resolve_anymultirange_from_others(), resolve_anyrange_from_others(), resolve_column_ref(), resolve_unique_index_expr(), ResolveOpClass(), RestoreGUCState(), RestoreSlotFromDisk(), restrict_and_check_grant(), revalidate_rectypeid(), RevalidateCachedQuery(), revmap_physical_extend(), RewriteQuery(), rewriteRuleAction(), rewriteTargetListIU(), rewriteTargetView(), ri_CheckTrigger(), ri_FetchConstraintInfo(), RI_FKey_check(), RI_Initial_Check(), ri_PerformCheck(), ri_ReportViolation(), rollback_prepared_cb_wrapper(), RollbackToSavepoint(), rpad(), sanity_check_relation(), sanity_check_tid_array(), SanityCheckBackgroundWorker(), satisfies_hash_partition(), scanint8(), scanNameSpaceForRefname(), scanNameSpaceForRelid(), scanNSItemForColumn(), scanRTEForColumn(), secure_open_gssapi(), secure_read(), secure_write(), select_common_collation(), select_common_type(), select_common_type_from_oids(), select_perl_context(), sendDir(), SendFunctionResult(), SendTimeLineHistory(), sepgsql_attribute_relabel(), sepgsql_avc_check_perms_label(), sepgsql_avc_init(), sepgsql_avc_unlabeled(), sepgsql_check_perms(), sepgsql_client_auth(), sepgsql_compute_avd(), sepgsql_compute_create(), sepgsql_get_label(), sepgsql_init_client_label(), sepgsql_mcstrans_in(), sepgsql_mcstrans_out(), sepgsql_object_relabel(), sepgsql_relation_relabel(), sepgsql_restorecon(), sepgsql_set_client_label(), sepgsql_utility_command(), serialize_expr_stats(), set_config_by_name(), set_config_option(), set_max_safe_fds(), set_pglocale_pgservice(), set_var_from_str(), setCompoundAffixFlagValue(), SetDefaultACL(), setPath(), setPathArray(), setPathObject(), SetPossibleUnsafeConflict(), SetRWConflict(), setSchemaName(), setseed(), SetSerializableTransactionSnapshot(), SetSessionAuthorization(), setTargetTable(), SetTransactionSnapshot(), setup_background_workers(), setup_dynamic_shared_memory(), setup_pct_info(), setup_regexp_matches(), setup_test_matches(), SetUserIdAndContext(), SharedFileSetAttach(), SharedInvalBackendInit(), shdepDropOwned(), shdepLockAndCheckObject(), shdepReassignOwned(), shell_in(), shell_out(), shm_mq_receive(), shm_mq_sendv(), shm_toc_allocate(), shm_toc_insert(), ShmemAlloc(), ShmemAllocUnlocked(), ShmemInitStruct(), show_all_file_settings(), similar_escape_internal(), SlabContextCreate(), slot_modify_data(), slot_store_data(), SnapBuildInitialSnapshot(), SnapBuildRestore(), socket_set_nonblocking(), SocketBackend(), sort(), spgadjustmembers(), spgdoinsert(), spgFormInnerTuple(), spgFormNodeTuple(), spgGetCache(), spgvalidate(), SPI_cursor_open_internal(), SPI_sql_row_to_xmlelement(), split_part(), sqrt_var(), ssl_extension_info(), standard_ProcessUtility(), StartAutovacuumWorker(), StartLogicalReplication(), StartReplication(), StartupDecodingContext(), StartupReplicationOrigin(), StartupXLOG(), storeOperators(), StorePreparedStatement(), storeProcedures(), StoreRelCheck(), storeRow(), str_initcap(), str_tolower(), str_toupper(), str_udeescape(), stream_abort_cb_wrapper(), stream_change_cb_wrapper(), stream_commit_cb_wrapper(), stream_prepare_cb_wrapper(), stream_start_cb_wrapper(), stream_stop_cb_wrapper(), string2ean(), string_to_privilege(), string_to_uuid(), stringToQualifiedNameList(), substitute_libpath_macro(), suppress_redundant_updates_trigger(), SV_to_JsonbValue(), SyncRepWaitForLSN(), system_beginsamplescan(), system_rows_beginsamplescan(), system_time_beginsamplescan(), table_open(), table_openrv(), table_openrv_extended(), table_tuple_get_latest_tid(), tablesample_init(), TablespaceCreateDbspace(), tblspc_redo(), TerminateOtherDBBackends(), test_enc_conversion(), test_re_compile(), test_re_execute(), test_shm_mq(), test_shm_mq_main(), test_shm_mq_pipelined(), TestForOldSnapshot_impl(), text_format(), text_format_append_string(), text_format_parse_digits(), text_format_parse_format(), text_format_string_conversion(), text_overlay(), text_position_setup(), text_starts_with(), text_substring(), text_to_bits(), text_to_table(), textarray_to_strvaluelist(), textToQualifiedNameList(), tfuncInitialize(), tfuncLoadRows(), thesaurus_init(), thesaurusRead(), throw_tcl_error(), tidin(), time_part_common(), time_recv(), timestamp2timestamptz_opt_overflow(), timestamp_age(), timestamp_bin(), timestamp_date(), timestamp_in(), timestamp_izone(), timestamp_mi(), timestamp_out(), timestamp_part_common(), timestamp_pl_interval(), timestamp_recv(), timestamp_time(), timestamp_to_char(), timestamp_trunc(), timestamp_zone(), timestamptz2timestamp(), timestamptz_age(), timestamptz_bin(), timestamptz_date(), timestamptz_in(), timestamptz_izone(), timestamptz_out(), timestamptz_part_common(), timestamptz_pl_interval(), timestamptz_recv(), timestamptz_time(), timestamptz_timetz(), timestamptz_to_char(), timestamptz_trunc_internal(), timestamptz_trunc_zone(), timestamptz_zone(), timetz_izone(), timetz_part_common(), timetz_recv(), timetz_zone(), to_ascii_enc(), to_ascii_encname(), to_date(), to_json(), to_jsonb(), to_regnamespace(), to_regoperator(), to_regrole(), to_timestamp(), TopologicalSort(), tqueueReceiveSlot(), TransactionIdGetCommitTsData(), TransactionIdInRecentPast(), TransactionIdIsInProgress(), transformAExprNullIf(), transformAggregateCall(), transformAlterTableStmt(), transformArrayExpr(), transformAssignedExpr(), transformAssignmentIndirection(), transformAssignmentSubscripts(), transformCaseExpr(), transformCoalesceExpr(), transformCollateClause(), transformColumnDefinition(), transformColumnNameList(), transformColumnRef(), transformColumnType(), transformConstraintAttrs(), transformContainerSubscripts(), transformCreateStmt(), transformCreateTableAsStmt(), transformDeclareCursorStmt(), transformDistinctClause(), transformDistinctOnClause(), transformExprRecurse(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformFrameOffset(), transformFromClauseItem(), transformGenericOptions(), transformGroupingFunc(), transformGroupingSet(), transformIndexConstraint(), transformIndexStmt(), transformIndirection(), transformInsertRow(), transformInsertStmt(), transformLimitClause(), transformLockingClause(), transformMultiAssignRef(), transformOnConflictArbiter(), transformParamRef(), transformPartitionBound(), transformPartitionBoundValue(), transformPartitionCmd(), transformPartitionRangeBounds(), transformPartitionSpec(), transformPLAssignStmt(), transformRangeFunction(), transformRangeTableFunc(), transformRangeTableSample(), transformRelOptions(), transformReturningList(), transformRuleStmt(), transformSelectStmt(), transformSetOperationStmt(), transformSetOperationTree(), transformStatsStmt(), transformSubLink(), transformTableConstraint(), transformTableLikeClause(), transformTypeCast(), transformUpdateTargetList(), transformValuesClause(), transformWindowDefinitions(), transformWindowFuncCall(), transformWithClause(), transformXmlExpr(), transformXmlSerialize(), translate(), triggered_change_notification(), trim_array(), truncate_check_activity(), truncate_check_rel(), truncate_identifier(), try_table_open(), ts_headline_byid_opt(), ts_headline_json_byid_opt(), ts_headline_jsonb_byid_opt(), ts_stat_sql(), tsquery_phrase_distance(), tsquery_rewrite_query(), tsvector_concat(), tsvector_delete_arr(), tsvector_filter(), tsvector_setweight_by_filter(), tsvector_update_trigger(), tsvectorin(), ttdummy(), tuple_data_split(), tuple_data_split_internal(), tupledesc_match(), tuples_equal(), TypeCreate(), TypeGetTupleDesc(), typenameType(), typenameTypeMod(), TypeShellMake(), typeStringToTypeName(), unaccent_dict(), unaccent_init(), unicode_norm_form_from_string(), unique_key_recheck(), unistr(), unknown_attribute(), UserAbortTransactionBlock(), utf8_to_iso8859(), utf8_to_win(), UtfToLocal(), uuid_generate_internal(), vacuum(), vacuum_open_relation(), validate_ddl_tags(), validate_option_array_item(), validate_pkattnums(), validate_table_rewrite_tags(), validateConnectbyTupleDesc(), validateDomainConstraint(), validateInfiniteBounds(), ValidateJoinEstimator(), ValidatePgVersion(), validateRecoveryParameters(), ValidateRestrictionEstimator(), varbit(), varbit_in(), varbit_recv(), varchar(), varchar_input(), variable_coerce_param_hook(), variable_paramref_hook(), varstr_levenshtein(), verify_brin_page(), verify_dictoptions(), verify_hash_page(), verify_heapam(), verify_option_list_length(), VirtualXactLock(), wait_for_workers_to_become_ready(), WaitForParallelWorkersToAttach(), WaitForParallelWorkersToExit(), WaitForParallelWorkersToFinish(), WalRcvFetchTimeLineHistoryFiles(), WALReadRaiseError(), widget_in(), width_bucket_array(), width_bucket_float8(), width_bucket_numeric(), win_to_utf8(), window_nth_value(), window_ntile(), worker_spi_launch(), write_auto_conf_file(), X509_NAME_field_to_text(), X509_NAME_to_cstring(), XLogFileCopy(), XLogPageRead(), XlogReadTwoPhaseData(), XLogWalRcvProcessMsg(), xml_is_document(), xmlcomment(), xmlpi(), XmlTableGetValue(), XmlTableSetColumnFilter(), XmlTableSetNamespace(), XmlTableSetRowFilter(), xmltotext_with_xmloption(), xmlvalidate(), xpath_table(), and xslt_process().

699 {
701 
702  /* we don't bother incrementing recursion_depth */
704 
705  edata->sqlerrcode = sqlerrcode;
706 
707  return 0; /* return value does not matter */
708 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
int sqlerrcode
Definition: elog.h:381
static int errordata_stack_depth
Definition: elog.c:147
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145

◆ errcode_for_file_access()

int errcode_for_file_access ( void  )

Definition at line 721 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, ErrorData::saved_errno, and ErrorData::sqlerrcode.

Referenced by _mdfd_getseg(), _mdnblocks(), _ShowOption(), AddToDataDirLockFile(), AlterSystemSetConfigFile(), apply_handle_stream_commit(), ApplyLogicalMappingFile(), apw_dump_now(), apw_load_buffers(), assign_xlog_sync_method(), BackendRun(), basebackup_read_file(), be_lo_export(), BeginCopyFrom(), BeginCopyTo(), BootStrapXLOG(), BufFileDumpBuffer(), BufFileLoadBuffer(), BufFileOpenShared(), BufFileSeek(), BufFileSize(), BufFileTruncateShared(), calculate_relation_size(), calculate_tablespace_size(), CancelBackup(), ChangeToDataDir(), check_ssl_key_file_permissions(), checkDataDir(), CheckForStandbyTrigger(), CheckPointLogicalRewriteHeap(), CheckPointReplicationOrigin(), CheckPointSnapBuild(), CheckXLogRemoved(), ClosePipeFromProgram(), ClosePipeToProgram(), ClosePostmasterPorts(), copy_file(), copydir(), CopyGetData(), CopySendEndOfRow(), create_tablespace_directories(), CreateLockFile(), CreateOptsFile(), CreateSlotOnDisk(), db_dir_size(), DebugFileOpen(), DeleteAllExportedSnapshotFiles(), destroy_tablespace_directories(), do_pg_start_backup(), do_pg_stop_backup(), do_truncate(), dsm_cleanup_for_mmap(), dsm_impl_mmap(), durable_rename(), durable_rename_excl(), durable_unlink(), EndCopy(), EndCopyFrom(), entry_reset(), errcode_for_dynamic_shared_memory(), ExecHashJoinGetSavedTuple(), ExecHashJoinNewBatch(), existsTimeLineHistory(), exitArchiveRecovery(), ExportSnapshot(), file_exists(), fileAnalyzeForeignTable(), FileClose(), fill_hba_view(), find_my_exec(), fsync_fname_ext(), gc_qtexts(), get_controlfile(), get_dirent_type(), getInstallationPaths(), getlen(), hashagg_batch_read(), heap_xlog_logical_rewrite(), InitPostgres(), InitPostmasterDeathWatchHandle(), internal_load_library(), internal_unload_library(), issue_xlog_fsync(), KeepFileRestoredFromArchive(), lo_import_internal(), load_dh_file(), load_hba(), load_ident(), load_relmap_file(), logfile_open(), logical_end_heap_rewrite(), logical_heap_rewrite_flush_mappings(), logical_rewrite_log_mapping(), looks_like_temp_rel_name(), ltsReadBlock(), ltsWriteBlock(), mdcreate(), mdextend(), mdimmedsync(), mdopenfork(), mdread(), mdtruncate(), mdunlinkfork(), mdwrite(), parse_extension_control_file(), PathNameCreateTemporaryDir(), PathNameCreateTemporaryFile(), PathNameDeleteTemporaryFile(), PathNameOpenTemporaryFile(), perform_base_backup(), pg_backup_start_time(), pg_current_logfile(), pg_file_rename_internal(), pg_file_sync(), pg_file_unlink(), pg_file_unlink_v1_1(), pg_file_write_internal(), pg_flush_data(), pg_import_system_collations(), pg_ls_dir_files(), pg_promote(), pg_stat_file(), pg_tablespace_databases(), pg_tablespace_location(), pg_tzenumerate_next(), pg_tzenumerate_start(), PGReserveSemaphores(), PGSharedMemoryCreate(), pgss_shmem_shutdown(), pgss_shmem_startup(), pgstat_read_db_statsfile(), pgstat_read_db_statsfile_timestamp(), pgstat_read_statsfiles(), pgstat_write_db_statsfile(), pgstat_write_statsfiles(), PostmasterMain(), ProcessSyncRequests(), qtext_load_file(), qtext_store(), read_backup_label(), read_binary_file(), read_tablespace_map(), read_whole_file(), ReadControlFile(), ReadDirExtended(), readRecoverySignalFile(), readTimeLineHistory(), readtup_heap(), ReadTwoPhaseFile(), RecheckDataDirLockFile(), RecreateTwoPhaseFile(), register_dirty_segment(), remove_tablespace_symlink(), RemovePgTempFilesInDir(), RemovePgTempRelationFilesInDbspace(), RemoveTwoPhaseFile(), RemoveXlogFile(), ReorderBufferCleanupSerializedTXNs(), ReorderBufferRestoreChanges(), ReorderBufferRestoreCleanup(), ReorderBufferSerializeChange(), ReorderBufferSerializeTXN(), ReplicationSlotDropPtr(), ResetUnloggedRelationsInDbspaceDir(), ResetUnloggedRelationsInTablespaceDir(), resolve_symlinks(), RestoreArchivedFile(), RestoreSlotFromDisk(), run_ssl_passphrase_command(), SaveSlotToPath(), SendBackupManifest(), sendDir(), sendFile(), sendTablespace(), SendTimeLineHistory(), SlruReportIOError(), SnapBuildRestore(), SnapBuildSerialize(), StartupReplicationOrigin(), StartupXLOG(), StreamServerPort(), sts_parallel_scan_next(), sts_read_tuple(), subxact_info_read(), SyncDataDirectory(), SyncPostCheckpoint(), SysLogger_Start(), TablespaceCreateDbspace(), tokenize_file(), tokenize_inc_file(), tuplestore_copy_read_pointer(), tuplestore_gettuple(), tuplestore_puttuple_common(), tuplestore_rescan(), tuplestore_select_read_pointer(), unlink_if_exists_fname(), unlink_initfile(), update_controlfile(), update_metainfo_datafile(), ValidatePgVersion(), wal_segment_open(), walkdir(), WALReadRaiseError(), WalReceiverMain(), WalSndSegmentOpen(), write_auto_conf_file(), write_relcache_init_file(), write_relmap_file(), write_syslogger_file(), WriteControlFile(), writeTimeLineHistory(), writeTimeLineHistoryFile(), XLogArchiveForceDone(), XLogArchiveNotify(), XLogFileClose(), XLogFileCopy(), XLogFileInit(), XLogFileOpen(), XLogFileRead(), XLogFileReadAnyTLI(), XLogPageRead(), XlogReadTwoPhaseData(), XLogWalRcvWrite(), and XLogWrite().

722 {
724 
725  /* we don't bother incrementing recursion_depth */
727 
728  switch (edata->saved_errno)
729  {
730  /* Permission-denied failures */
731  case EPERM: /* Not super-user */
732  case EACCES: /* Permission denied */
733 #ifdef EROFS
734  case EROFS: /* Read only file system */
735 #endif
736  edata->sqlerrcode = ERRCODE_INSUFFICIENT_PRIVILEGE;
737  break;
738 
739  /* File not found */
740  case ENOENT: /* No such file or directory */
741  edata->sqlerrcode = ERRCODE_UNDEFINED_FILE;
742  break;
743 
744  /* Duplicate file */
745  case EEXIST: /* File exists */
746  edata->sqlerrcode = ERRCODE_DUPLICATE_FILE;
747  break;
748 
749  /* Wrong object type or state */
750  case ENOTDIR: /* Not a directory */
751  case EISDIR: /* Is a directory */
752 #if defined(ENOTEMPTY) && (ENOTEMPTY != EEXIST) /* same code on AIX */
753  case ENOTEMPTY: /* Directory not empty */
754 #endif
755  edata->sqlerrcode = ERRCODE_WRONG_OBJECT_TYPE;
756  break;
757 
758  /* Insufficient resources */
759  case ENOSPC: /* No space left on device */
760  edata->sqlerrcode = ERRCODE_DISK_FULL;
761  break;
762 
763  case ENFILE: /* File table overflow */
764  case EMFILE: /* Too many open files */
765  edata->sqlerrcode = ERRCODE_INSUFFICIENT_RESOURCES;
766  break;
767 
768  /* Hardware failure */
769  case EIO: /* I/O error */
770  edata->sqlerrcode = ERRCODE_IO_ERROR;
771  break;
772 
773  /* All else is classified as internal errors */
774  default:
775  edata->sqlerrcode = ERRCODE_INTERNAL_ERROR;
776  break;
777  }
778 
779  return 0; /* return value does not matter */
780 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
int sqlerrcode
Definition: elog.h:381
static int errordata_stack_depth
Definition: elog.c:147
int saved_errno
Definition: elog.h:397
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145

◆ errcode_for_socket_access()

int errcode_for_socket_access ( void  )

Definition at line 792 of file elog.c.

References ALL_CONNECTION_FAILURE_ERRNOS, CHECK_STACK_DEPTH, errordata_stack_depth, ErrorData::saved_errno, and ErrorData::sqlerrcode.

Referenced by auth_peer(), be_tls_open_server(), ident_inet(), InitPostmasterDeathWatchHandle(), internal_flush(), ModifyWaitEvent(), pgstat_init(), PgstatCollectorMain(), pq_check_connection(), pq_getbyte_if_available(), pq_recvbuf(), ProcessStartupPacket(), ServerLoop(), StreamConnection(), StreamServerPort(), SysLogger_Start(), SysLoggerMain(), and WaitEventSetWait().

793 {
795 
796  /* we don't bother incrementing recursion_depth */
798 
799  switch (edata->saved_errno)
800  {
801  /* Loss of connection */
803  edata->sqlerrcode = ERRCODE_CONNECTION_FAILURE;
804  break;
805 
806  /* All else is classified as internal errors */
807  default:
808  edata->sqlerrcode = ERRCODE_INTERNAL_ERROR;
809  break;
810  }
811 
812  return 0; /* return value does not matter */
813 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
int sqlerrcode
Definition: elog.h:381
static int errordata_stack_depth
Definition: elog.c:147
int saved_errno
Definition: elog.h:397
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
#define ALL_CONNECTION_FAILURE_ERRNOS
Definition: port.h:114

◆ errcontext_msg()

int errcontext_msg ( const char *  fmt,
  ... 
)

Definition at line 1204 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::context_domain, errordata_stack_depth, EVALUATE_MESSAGE, MemoryContextSwitchTo(), and recursion_depth.

1205 {
1207  MemoryContext oldcontext;
1208 
1209  recursion_depth++;
1211  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1212 
1213  EVALUATE_MESSAGE(edata->context_domain, context, true, true);
1214 
1215  MemoryContextSwitchTo(oldcontext);
1216  recursion_depth--;
1217  return 0; /* return value does not matter */
1218 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:149
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:828
const char * context_domain
Definition: elog.h:380
static int errordata_stack_depth
Definition: elog.c:147
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
struct MemoryContextData * assoc_context
Definition: elog.h:400

◆ errdetail()

int errdetail ( const char *  fmt,
  ... 
)

Definition at line 1042 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE, MemoryContextSwitchTo(), and recursion_depth.

Referenced by _bt_check_third_page(), _bt_check_unique(), AbortBufferIO(), AddEnumLabel(), AggregateCreate(), AllocSetContextCreateInternal(), AlterExtensionNamespace(), AlterPublicationTables(), AlterTableNamespace(), apply_typmod(), apply_typmod_special(), array_cat(), array_fill_internal(), array_in(), array_set_slice(), ArrayCount(), asyncQueueFillWarning(), ATAddForeignKeyConstraint(), ATExecAddColumn(), ATExecAddInherit(), ATExecAlterColumnType(), ATExecAttachPartition(), ATExecAttachPartitionIdx(), ATExecChangeOwner(), ATExecCheckNotNull(), ATPrepAlterColumnType(), ATPrepChangePersistence(), AttachPartitionEnsureIndexes(), auth_peer(), be_tls_init(), brin_page_type(), btree_index_checkable(), build_attrmap_by_name(), build_attrmap_by_position(), CancelBackup(), check_conn_params(), check_encoding_locale_matches(), check_exclusion_or_unique_constraint(), check_lateral_ref_ok(), check_nested_generated_walker(), check_new_partition_bound(), check_primary_key(), check_publication_add_relation(), check_rolespec_name(), check_sql_fn_retval(), check_ssl_key_file_permissions(), check_ungrouped_columns_walker(), check_valid_extension_name(), check_valid_version_name(), checkDataDir(), CheckMyDatabase(), CheckRecoveryConflictDeadlock(), CheckRequiredParameterValues(), checkRuleResultList(), checkStringLen(), CheckSubscriptionRelkind(), CheckVarSlotCompatibility(), choose_hashed_setop(), coerce_record_to_complex(), comparetup_index_btree(), compatConnectbyTupleDescs(), compatCrosstabTupleDescs(), compute_return_type(), ComputeIndexAttrs(), ComputePartitionAttrs(), connect_pg_server(), copy_replication_slot(), copy_table_data(), CopyGetAttnums(), create_distinct_paths(), create_ordinary_grouping_paths(), createdb(), CreateDecodingContext(), CreateRestartPoint(), CreateRole(), CreateSchemaCommand(), CreateTableSpace(), CreateTrigger(), crosstab(), cube_a_f8(), cube_a_f8_f8(), cube_c_f8(), cube_c_f8_f8(), cube_recv(), cube_subset(), dblink_connect(), dblink_connstr_check(), dblink_fdw_validator(), dblink_get_conn(), dblink_security_check(), DefineIndex(), DefineOpClass(), DefineOperator(), DefineRelation(), DeleteInheritsTuple(), do_collation_version_check(), dsa_allocate_extended(), dshash_create(), EnableLockPagesPrivilege(), enforce_generic_type_consistency(), enlargeStringInfo(), EnumValuesCreate(), errdetail_abort(), errdetail_busy_db(), errdetail_execute(), errdetail_params(), errdetail_recovery_conflict(), EvaluateParams(), exec_move_row_from_fields(), exec_stmt_dynexecute(), exec_stmt_execsql(), ExecBRInsertTriggers(), ExecBuildUpdateProjection(), ExecCheckPlanOutput(), ExecConstraints(), ExecCrossPartitionUpdate(), ExecEvalArrayExpr(), ExecEvalFieldSelect(), ExecEvalWholeRowVar(), ExecFindPartition(), ExecGrant_Language(), ExecPartitionCheckEmitError(), executeJsonPath(), ExecWithCheckOptions(), ExitPostmaster(), expandTableLikeClause(), fatal_system_new_handler(), FetchDynamicTimeZone(), find_option(), finish_nodeitem(), FloatExceptionHandler(), from_char_parse_int_len(), from_char_seq_search(), from_char_set_int(), generate_recursion_path(), generateClonedIndexStmt(), GenerationContextCreate(), get_connect_string(), get_crosstab_tuplestore(), get_page_from_raw(), getid(), GetNewOidWithIndex(), GetSerializableTransactionSnapshot(), GetSerializableTransactionSnapshotInt(), gin_leafpage_items(), gin_metapage_info(), gistdoinsert(), gistvacuumpage(), heap_create(), heap_truncate_check_FKs(), hlparsetext(), incompatible_module_error(), InitPgFdwOptions(), InitPostgres(), instantiate_empty_record_variable(), InternalIpcMemoryCreate(), InternalIpcSemaphoreCreate(), json_ereport_error(), jsonb_set_lax(), lazy_check_wraparound_failsafe(), lazy_cleanup_one_index(), lc_ctype_is_c(), libpqrcv_identify_system(), libpqrcv_processTuples(), libpqrcv_readtimelinehistoryfile(), LogChildExit(), ltxtq_out(), ltxtq_send(), make_pathkeys_for_window(), make_row_comparison_op(), makeMultirangeTypeName(), map_sql_value_to_xml_value(), MemoryContextAlloc(), MemoryContextAllocExtended(), MemoryContextAllocHuge(), MemoryContextAllocZero(), MemoryContextAllocZeroAligned(), MergeAttributes(), multirange_in(), namerecv(), network_in(), network_recv(), NUMDesc_prepare(), palloc(), palloc0(), palloc_extended(), parse_ident(), parse_lquery(), parse_ltree(), parse_one_reloption(), parserOpenTable(), parsetext(), perform_default_encoding_conversion(), pg_attribute_noreturn(), pg_be_scram_exchange(), pg_do_encoding_conversion(), pg_logical_slot_get_changes_guts(), pg_replication_origin_create(), pg_replication_slot_advance(), pg_size_bytes(), pgarch_archiveXlog(), pgrowlocks(), PGSharedMemoryCreate(), plpgsql_post_column_ref(), PLy_exec_function(), PLy_exec_trigger(), PLy_initialize(), PLySequence_ToArray_recurse(), PLyString_ToComposite(), populate_array_check_dimension(), preprocess_grouping_sets(), ProcedureCreate(), process_owned_by(), ProcessStartupPacket(), ProcessUtilitySlow(), qtext_load_file(), queryin(), quickdie(), range_parse(), range_parse_bound(), read_any_attr(), read_attr_value(), read_backup_label(), read_client_final_message(), read_client_first_message(), ReadControlFile(), record_in(), RecoveryRequiresIntParameter(), refresh_by_match_merge(), refuseDupeIndexAttach(), ReindexRelationConcurrently(), RemoveSubscriptionRel(), RenameEnumLabel(), RenameRole(), RenameSchema(), RenameTableSpace(), repalloc(), repalloc_huge(), reportDependentObjects(), RestoreArchivedFile(), RewriteQuery(), rewriteTargetListIU(), RI_FKey_check(), RI_Initial_Check(), ri_ReportViolation(), set_max_safe_fds(), setPath(), SetTransactionSnapshot(), SlabContextCreate(), SlruReportIOError(), SnapBuildFindSnapshot(), SnapBuildRestore(), SPI_cursor_open_internal(), SPI_sql_row_to_xmlelement(), StartLogicalReplication(), StartReplication(), StartupXLOG(), SyncRepWaitForLSN(), test_enc_conversion(), tfuncInitialize(), transformAggregateCall(), transformDeclareCursorStmt(), transformIndexConstraint(), transformSetOperationStmt(), tupledesc_match(), vac_truncate_clog(), validateConnectbyTupleDesc(), ValidatePgVersion(), variable_coerce_param_hook(), verify_brin_page(), verify_hash_page(), verify_message(), WalReceiverMain(), write_relcache_init_file(), XlogReadTwoPhaseData(), xml_is_document(), xmlpi(), and xpath_table().

1043 {
1045  MemoryContext oldcontext;
1046 
1047  recursion_depth++;
1049  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1050 
1051  EVALUATE_MESSAGE(edata->domain, detail, false, true);
1052 
1053  MemoryContextSwitchTo(oldcontext);
1054  recursion_depth--;
1055  return 0; /* return value does not matter */
1056 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:149
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:828
static int errordata_stack_depth
Definition: elog.c:147
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
struct MemoryContextData * assoc_context
Definition: elog.h:400
const char * domain
Definition: elog.h:379

◆ errdetail_internal()

int errdetail_internal ( const char *  fmt,
  ... 
)

Definition at line 1069 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE, MemoryContextSwitchTo(), and recursion_depth.

Referenced by AggregateCreate(), bt_check_every_level(), bt_check_level_from_leftmost(), bt_child_check(), bt_child_highkey_check(), bt_downlink_missing_check(), bt_recheck_sibling_links(), bt_right_page_check_scankey(), bt_target_page_check(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), CheckForSerializableConflictIn(), CheckForSerializableConflictOut(), CheckForSerializableConflictOutNeeded(), CheckSCRAMAuth(), ClosePipeFromProgram(), ClosePipeToProgram(), connect_pg_server(), dblink_connect(), dblink_get_conn(), dblink_res_error(), DeadLockReport(), DropRole(), DropTableSpace(), elog_node_display(), exec_stmt_dynexecute(), exec_stmt_execsql(), exec_stmt_raise(), GetConnection(), incompatible_module_error(), lazy_scan_heap(), lazy_truncate_heap(), lazy_vacuum_heap_rel(), lazy_vacuum_one_index(), OnConflict_CheckForSerializationFailure(), PageGetItemIdCareful(), parse_one_reloption(), pg_GSS_error(), pgfdw_report_error(), PLy_elog_impl(), PLy_output(), PreCommit_CheckForSerializationFailure(), ProcedureCreate(), reindex_index(), rewriteTargetView(), run_ssl_passphrase_command(), ShowUsage(), SnapBuildFindSnapshot(), sts_read_tuple(), and xml_is_document().

1070 {
1072  MemoryContext oldcontext;
1073 
1074  recursion_depth++;
1076  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1077 
1078  EVALUATE_MESSAGE(edata->domain, detail, false, false);
1079 
1080  MemoryContextSwitchTo(oldcontext);
1081  recursion_depth--;
1082  return 0; /* return value does not matter */
1083 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:149
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:828
static int errordata_stack_depth
Definition: elog.c:147
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
struct MemoryContextData * assoc_context
Definition: elog.h:400
const char * domain
Definition: elog.h:379

◆ errdetail_log()

int errdetail_log ( const char *  fmt,
  ... 
)

Definition at line 1090 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE, MemoryContextSwitchTo(), and recursion_depth.

Referenced by auth_failed(), check_password(), DeadLockReport(), DropRole(), DropTableSpace(), ProcSleep(), reportDependentObjects(), and set_authn_id().

1091 {
1093  MemoryContext oldcontext;
1094 
1095  recursion_depth++;
1097  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1098 
1099  EVALUATE_MESSAGE(edata->domain, detail_log, false, true);
1100 
1101  MemoryContextSwitchTo(oldcontext);
1102  recursion_depth--;
1103  return 0; /* return value does not matter */
1104 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:149
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:828
static int errordata_stack_depth
Definition: elog.c:147
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
struct MemoryContextData * assoc_context
Definition: elog.h:400
const char * domain
Definition: elog.h:379

◆ errdetail_log_plural()

int errdetail_log_plural ( const char *  fmt_singular,
const char *  fmt_plural,
unsigned long  n,
  ... 
)

Definition at line 1111 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE_PLURAL, MemoryContextSwitchTo(), and recursion_depth.

Referenced by LogRecoveryConflict(), and ProcSleep().

1113 {
1115  MemoryContext oldcontext;
1116 
1117  recursion_depth++;
1119  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1120 
1121  EVALUATE_MESSAGE_PLURAL(edata->domain, detail_log, false);
1122 
1123  MemoryContextSwitchTo(oldcontext);
1124  recursion_depth--;
1125  return 0; /* return value does not matter */
1126 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:149
static int errordata_stack_depth
Definition: elog.c:147
#define EVALUATE_MESSAGE_PLURAL(domain, targetfield, appendval)
Definition: elog.c:864
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
struct MemoryContextData * assoc_context
Definition: elog.h:400
const char * domain
Definition: elog.h:379

◆ errdetail_plural()

int errdetail_plural ( const char *  fmt_singular,
const char *  fmt_plural,
unsigned long  n,
  ... 
)

Definition at line 1134 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE_PLURAL, MemoryContextSwitchTo(), and recursion_depth.

Referenced by auth_peer(), dropdb(), errdetail_busy_db(), ExecEvalWholeRowVar(), GetNewMultiXactId(), RegisterBackgroundWorker(), TerminateOtherDBBackends(), and tupledesc_match().

1136 {
1138  MemoryContext oldcontext;
1139 
1140  recursion_depth++;
1142  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1143 
1144  EVALUATE_MESSAGE_PLURAL(edata->domain, detail, false);
1145 
1146  MemoryContextSwitchTo(oldcontext);
1147  recursion_depth--;
1148  return 0; /* return value does not matter */
1149 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:149
static int errordata_stack_depth
Definition: elog.c:147
#define EVALUATE_MESSAGE_PLURAL(domain, targetfield, appendval)
Definition: elog.c:864
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
struct MemoryContextData * assoc_context
Definition: elog.h:400
const char * domain
Definition: elog.h:379

◆ errfinish()

void errfinish ( const char *  filename,
int  lineno,
const char *  funcname 
)

Definition at line 513 of file elog.c.

References ErrorContextCallback::arg, ErrorData::backtrace, backtrace_functions, ErrorContextCallback::callback, CHECK_FOR_INTERRUPTS, CHECK_STACK_DEPTH, ErrorData::column_name, ErrorData::constraint_name, ErrorData::context, CritSectionCount, ErrorData::datatype_name, DestNone, DestRemote, ErrorData::detail, ErrorData::detail_log, DISCONNECT_FATAL, DISCONNECT_NORMAL, ErrorData::elevel, elevel, EmitErrorReport(), ERROR, ErrorContext, errordata_stack_depth, FATAL, filename, ErrorData::filename, ErrorData::funcname, ErrorData::hint, ErrorData::internalquery, InterruptHoldoffCount, ErrorData::lineno, matches_backtrace_functions(), MemoryContextSwitchTo(), ErrorData::message, PANIC, pfree(), PG_exception_stack, PG_RE_THROW, pgStatSessionEndCause, ErrorContextCallback::previous, proc_exit(), QueryCancelHoldoffCount, recursion_depth, ErrorData::schema_name, set_backtrace(), generate_unaccent_rules::stdout, ErrorData::table_name, and whereToSendOutput.

Referenced by pg_re_throw(), and ThrowErrorData().

514 {
516  int elevel;
517  MemoryContext oldcontext;
518  ErrorContextCallback *econtext;
519 
520  recursion_depth++;
522 
523  /* Save the last few bits of error state into the stack entry */
524  if (filename)
525  {
526  const char *slash;
527 
528  /* keep only base name, useful especially for vpath builds */
529  slash = strrchr(filename, '/');
530  if (slash)
531  filename = slash + 1;
532  /* Some Windows compilers use backslashes in __FILE__ strings */
533  slash = strrchr(filename, '\\');
534  if (slash)
535  filename = slash + 1;
536  }
537 
538  edata->filename = filename;
539  edata->lineno = lineno;
540  edata->funcname = funcname;
541 
542  elevel = edata->elevel;
543 
544  /*
545  * Do processing in ErrorContext, which we hope has enough reserved space
546  * to report an error.
547  */
548  oldcontext = MemoryContextSwitchTo(ErrorContext);
549 
550  if (!edata->backtrace &&
551  edata->funcname &&
554  set_backtrace(edata, 2);
555 
556  /*
557  * Call any context callback functions. Errors occurring in callback
558  * functions will be treated as recursive errors --- this ensures we will
559  * avoid infinite recursion (see errstart).
560  */
561  for (econtext = error_context_stack;
562  econtext != NULL;
563  econtext = econtext->previous)
564  econtext->callback(econtext->arg);
565 
566  /*
567  * If ERROR (not more nor less) we pass it off to the current handler.
568  * Printing it and popping the stack is the responsibility of the handler.
569  */
570  if (elevel == ERROR)
571  {
572  /*
573  * We do some minimal cleanup before longjmp'ing so that handlers can
574  * execute in a reasonably sane state.
575  *
576  * Reset InterruptHoldoffCount in case we ereport'd from inside an
577  * interrupt holdoff section. (We assume here that no handler will
578  * itself be inside a holdoff section. If necessary, such a handler
579  * could save and restore InterruptHoldoffCount for itself, but this
580  * should make life easier for most.)
581  */
584 
585  CritSectionCount = 0; /* should be unnecessary, but... */
586 
587  /*
588  * Note that we leave CurrentMemoryContext set to ErrorContext. The
589  * handler should reset it to something else soon.
590  */
591 
592  recursion_depth--;
593  PG_RE_THROW();
594  }
595 
596  /* Emit the message to the right places */
597  EmitErrorReport();
598 
599  /* Now free up subsidiary data attached to stack entry, and release it */
600  if (edata->message)
601  pfree(edata->message);
602  if (edata->detail)
603  pfree(edata->detail);
604  if (edata->detail_log)
605  pfree(edata->detail_log);
606  if (edata->hint)
607  pfree(edata->hint);
608  if (edata->context)
609  pfree(edata->context);
610  if (edata->backtrace)
611  pfree(edata->backtrace);
612  if (edata->schema_name)
613  pfree(edata->schema_name);
614  if (edata->table_name)
615  pfree(edata->table_name);
616  if (edata->column_name)
617  pfree(edata->column_name);
618  if (edata->datatype_name)
619  pfree(edata->datatype_name);
620  if (edata->constraint_name)
621  pfree(edata->constraint_name);
622  if (edata->internalquery)
623  pfree(edata->internalquery);
624 
626 
627  /* Exit error-handling context */
628  MemoryContextSwitchTo(oldcontext);
629  recursion_depth--;
630 
631  /*
632  * Perform error recovery action as specified by elevel.
633  */
634  if (elevel == FATAL)
635  {
636  /*
637  * For a FATAL error, we let proc_exit clean up and exit.
638  *
639  * If we just reported a startup failure, the client will disconnect
640  * on receiving it, so don't send any more to the client.
641  */
644 
645  /*
646  * fflush here is just to improve the odds that we get to see the
647  * error message, in case things are so hosed that proc_exit crashes.
648  * Any other code you might be tempted to add here should probably be
649  * in an on_proc_exit or on_shmem_exit callback instead.
650  */
651  fflush(stdout);
652  fflush(stderr);
653 
654  /*
655  * Let the statistics collector know. Only mark the session as
656  * terminated by fatal error if there is no other known cause.
657  */
660 
661  /*
662  * Do normal process-exit cleanup, then return exit code 1 to indicate
663  * FATAL termination. The postmaster may or may not consider this
664  * worthy of panic, depending on which subprocess returns it.
665  */
666  proc_exit(1);
667  }
668 
669  if (elevel >= PANIC)
670  {
671  /*
672  * Serious crash time. Postmaster will observe SIGABRT process exit
673  * status and kill the other backends too.
674  *
675  * XXX: what if we are *in* the postmaster? abort() won't kill our
676  * children...
677  */
678  fflush(stdout);
679  fflush(stderr);
680  abort();
681  }
682 
683  /*
684  * Check for cancel/die interrupt first --- this is so that the user can
685  * stop a query emitting tons of notice or warning messages, even if it's
686  * in a loop that otherwise fails to check for interrupts.
687  */
689 }
char * schema_name
Definition: elog.h:389
volatile uint32 InterruptHoldoffCount
Definition: globals.c:39
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
MemoryContext ErrorContext
Definition: mcxt.c:49
static pg_noinline void set_backtrace(ErrorData *edata, int num_skip)
Definition: elog.c:955
const char * funcname
Definition: elog.h:378
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
int lineno
Definition: elog.h:377
volatile uint32 QueryCancelHoldoffCount
Definition: globals.c:40
void proc_exit(int code)
Definition: ipc.c:104
static int recursion_depth
Definition: elog.c:149
char * internalquery
Definition: elog.h:396
SessionEndType pgStatSessionEndCause
Definition: pgstat.c:250
void(* callback)(void *arg)
Definition: elog.h:247
struct ErrorContextCallback * previous
Definition: elog.h:246
#define PANIC
Definition: elog.h:50
ErrorContextCallback * error_context_stack
Definition: elog.c:93
void pfree(void *pointer)
Definition: mcxt.c:1169
static int errordata_stack_depth
Definition: elog.c:147
#define ERROR
Definition: elog.h:46
const char * filename
Definition: elog.h:376
char * detail_log
Definition: elog.h:384
#define FATAL
Definition: elog.h:49
Definition: dest.h:89
char * table_name
Definition: elog.h:390
static bool matches_backtrace_functions(const char *funcname)
Definition: elog.c:483
volatile uint32 CritSectionCount
Definition: globals.c:41
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
char * backtrace
Definition: elog.h:387
char * datatype_name
Definition: elog.h:392
int elevel
Definition: elog.h:371
static int elevel
Definition: vacuumlazy.c:400
char * detail
Definition: elog.h:383
void EmitErrorReport(void)
Definition: elog.c:1509
char * column_name
Definition: elog.h:391
char * backtrace_functions
Definition: guc.c:575
char * hint
Definition: elog.h:385
#define PG_RE_THROW()
Definition: elog.h:354
char * context
Definition: elog.h:386
sigjmp_buf * PG_exception_stack
Definition: elog.c:95
static char * filename
Definition: pg_dumpall.c:91
#define CHECK_FOR_INTERRUPTS()
Definition: miscadmin.h:102
CommandDest whereToSendOutput
Definition: postgres.c:92
char * constraint_name
Definition: elog.h:393
char * message
Definition: elog.h:382

◆ errhidecontext()

int errhidecontext ( bool  hide_ctx)

Definition at line 1269 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::hide_ctx.

Referenced by llvm_compile_module(), MemoryContextStatsDetail(), MemoryContextStatsInternal(), and MemoryContextStatsPrint().

1270 {
1272 
1273  /* we don't bother incrementing recursion_depth */
1275 
1276  edata->hide_ctx = hide_ctx;
1277 
1278  return 0; /* return value does not matter */
1279 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static int errordata_stack_depth
Definition: elog.c:147
bool hide_ctx
Definition: elog.h:375
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145

◆ errhidestmt()

int errhidestmt ( bool  hide_stmt)

Definition at line 1250 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::hide_stmt.

Referenced by exec_bind_message(), exec_execute_message(), exec_parse_message(), exec_simple_query(), explain_ExecutorEnd(), llvm_compile_module(), MemoryContextStatsDetail(), MemoryContextStatsInternal(), and MemoryContextStatsPrint().

1251 {
1253 
1254  /* we don't bother incrementing recursion_depth */
1256 
1257  edata->hide_stmt = hide_stmt;
1258 
1259  return 0; /* return value does not matter */
1260 }
bool hide_stmt
Definition: elog.h:374
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static int errordata_stack_depth
Definition: elog.c:147
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145

◆ errhint()

int errhint ( const char *  fmt,
  ... 
)

Definition at line 1156 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE, MemoryContextSwitchTo(), and recursion_depth.

Referenced by _bt_check_third_page(), _bt_check_unique(), _bt_checkpage(), _bt_pagedel(), _hash_checkpage(), _hash_doinsert(), aclparse(), addTargetToSortList(), AlterEventTriggerOwner_internal(), AlterForeignDataWrapper(), AlterForeignDataWrapperOwner_internal(), AlterPublicationOwner_internal(), AlterSubscription(), AlterSubscriptionOwner_internal(), AlterTypeNamespace_oid(), AlterTypeNamespaceInternal(), AlterTypeOwner(), analyzeCTE(), apw_start_database_worker(), apw_start_leader_worker(), assign_collations_walker(), assign_hypothetical_collations(), assignProcTypes(), asyncQueueFillWarning(), AtEOSubXact_SPI(), AtEOXact_SPI(), ATExecChangeOwner(), ATExecCheckNotNull(), ATExecColumnDefault(), ATExecDropColumn(), ATExecDropConstraint(), ATExecSetRelOptions(), ATExecSetStatistics(), ATPrepAlterColumnType(), ATPrepCmd(), ATPrepDropNotNull(), auth_peer(), autovac_init(), BackendRun(), be_tls_open_server(), BeginCopyFrom(), BeginCopyTo(), brin_desummarize_range(), brin_summarize_range(), bt_check_every_level(), bt_metap(), bt_target_page_check(), bt_tuple_present_callback(), build_column_default(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), char2wchar(), check_agg_arguments_walker(), check_collation_set(), check_enable_rls(), check_lateral_ref_ok(), check_safe_enum_use(), check_stack_depth(), check_strxfrm_bug(), CheckAttributeType(), CheckCmdReplicaIdentity(), checkDataDir(), CheckForSerializableConflictIn(), CheckForSerializableConflictOut(), CheckForSerializableConflictOutNeeded(), CheckMyDatabase(), CheckpointerMain(), CheckRequiredParameterValues(), checkTimezoneIsUsedForCast(), CheckValidResultRel(), checkViewTupleDesc(), compileTheLexeme(), ComputeIndexAttrs(), ComputePartitionAttrs(), connect_pg_server(), cookDefault(), copy_replication_slot(), CopyFrom(), CopyReadLineText(), create_ctas_nodata(), create_tablespace_directories(), CreateAccessMethod(), CreateAnonymousSegment(), createdb(), CreateEventTrigger(), CreateForeignDataWrapper(), CreateFunction(), CreateLockFile(), CreatePredicateLock(), CreatePublication(), CreateTableSpace(), CreateTrigger(), DateTimeParseError(), dblink_connect(), dblink_fdw_validator(), dblink_get_conn(), dblink_res_error(), dblink_security_check(), DeadLockReport(), DefineQueryRewrite(), DefineRange(), DefineType(), DefineView(), DefineVirtualRelation(), DeleteInheritsTuple(), do_collation_version_check(), do_compile(), do_pg_start_backup(), do_pg_stop_backup(), do_to_timestamp(), DoCopy(), DropErrorMsgWrongType(), EnableLockPagesPrivilege(), error_commit_ts_disabled(), errorMissingColumn(), errorMissingRTE(), EvaluateParams(), exec_move_row_from_fields(), exec_stmt_case(), exec_stmt_dynexecute(), exec_stmt_execsql(), exec_stmt_raise(), ExecDelete(), ExecGrant_Type(), ExecOnConflictUpdate(), ExecOpenScanRelation(), ExecRefreshMatView(), ExecUpdate(), execute_extension_script(), executeDateTimeMethod(), ExecuteDoStmt(), ExecuteTruncate(), FastPathGetRelationLockEntry(), fetch_finfo_record(), file_fdw_validator(), find_typed_table_dependencies(), findDependentObjects(), findRangeSubOpclass(), forkname_to_number(), from_char_parse_int_len(), from_char_set_mode(), Generic_Text_IC_like(), get_object_address_defacl(), get_raw_page(), get_record_type_from_query(), get_required_extension(), get_sort_group_operators(), getInstallationPaths(), GetNewMultiXactId(), GetNewTransactionId(), GetSerializableTransactionSnapshot(), GetTupleForTrigger(), gin_clean_pending_list(), ginCombineData(), gistcheckpage(), gistdoinsert(), gistUserPicksplit(), gistvacuumpage(), hashbpchar(), hashbpcharextended(), hashtext(), hashtextextended(), heap_create_with_catalog(), heap_force_common(), heap_truncate_check_FKs(), InitPostgres(), internal_load_library(), InternalIpcMemoryCreate(), InternalIpcSemaphoreCreate(), intorel_startup(), IpcSemaphoreInitialize(), json_build_object(), jsonb_build_object(), jsonb_set_lax(), jsonb_subscript_transform(), lazy_check_wraparound_failsafe(), like_fixed_prefix(), lock_twophase_recover(), LockAcquireExtended(), LockGXact(), LogChildExit(), logicalrep_worker_launch(), LookupFuncName(), LookupFuncWithArgs(), macaddr8tomacaddr(), make_row_comparison_op(), makeMultirangeTypeName(), MarkAsPreparing(), MatchText(), mdextend(), mdwrite(), MergeAttributes(), movedb(), OnConflict_CheckForSerializationFailure(), op_error(), palloc_btree_page(), parse_and_validate_value(), parse_hba_line(), parse_jsonb_index_flags(), parse_sane_timezone(), ParseFuncOrColumn(), parserOpenTable(), pg_base64_decode(), pg_create_restore_point(), pg_current_logfile(), pg_current_wal_flush_lsn(), pg_current_wal_insert_lsn(), pg_current_wal_lsn(), pg_get_wal_replay_pause_state(), pg_is_wal_replay_paused(), pg_newlocale_from_collation(), pg_prewarm(), pg_promote(), pg_read_file(), pg_rotate_logfile(), pg_set_regex_collation(), pg_size_bytes(), pg_stop_backup(), pg_stop_backup_v2(), pg_switch_wal(), pg_wal_replay_pause(), pg_wal_replay_resume(), pg_walfile_name(), pg_walfile_name_offset(), pgarch_archiveXlog(), pgfdw_report_error(), PGSharedMemoryCreate(), pgstat_reset_shared_counters(), PLy_elog_impl(), PLy_output(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLyString_ToComposite(), policy_role_list_to_array(), populate_array_report_expected_array(), PortalRunSelect(), postgres_fdw_validator(), postgresql_fdw_validator(), PostmasterMain(), PreCommit_CheckForSerializationFailure(), PrepareRedoAdd(), ProcedureCreate(), process_owned_by(), process_postgres_switches(), ProcessInterrupts(), ProcessStartupPacket(), quickdie(), range_parse_flags(), RangeVarCallbackForAlterRelation(), ReadBuffer_common(), ReadControlFile(), readTimeLineHistory(), recoveryPausesHere(), RecoveryRequiresIntParameter(), recursive_revoke(), regexp_match(), RegisterBackgroundWorker(), regoperatorin(), ReleaseOneSerializableXact(), RemoveObjects(), RemoveSubscriptionRel(), RenameType(), ReplicationSlotCreate(), ReplicationSlotValidateName(), replorigin_advance(), replorigin_session_setup(), reportDependentObjects(), ReportSlotConnectionError(), RequestCheckpoint(), ResolveOpClass(), RestoreSlotFromDisk(), RewriteQuery(), rewriteTargetListIU(), rewriteTargetView(), ri_FetchConstraintInfo(), ri_PerformCheck(), select_common_collation(), sendDir(), SetMultiXactIdLimit(), setPathObject(), SetPossibleUnsafeConflict(), SetRWConflict(), SetTransactionIdLimit(), setup_background_workers(), similar_escape_internal(), spgdoinsert(), spgFormInnerTuple(), StartupXLOG(), str_initcap(), str_tolower(), str_toupper(), str_udeescape(), StreamServerPort(), SysLogger_Start(), tblspc_redo(), text_format(), to_regoperator(), transformArrayExpr(), transformAssignedExpr(), transformAssignmentIndirection(), transformCaseExpr(), transformCoalesceExpr(), transformFrameOffset(), transformInsertRow(), transformOnConflictArbiter(), transformPLAssignStmt(), transformRangeFunction(), transformSetOperationStmt(), transformWindowDefinitions(), unistr(), vacuum_set_xid_limits(), ValidatePgVersion(), validateRecoveryParameters(), verify_heapam(), VirtualXactLock(), WaitForParallelWorkersToAttach(), WaitForParallelWorkersToFinish(), worker_spi_launch(), and xml_is_document().

1157 {
1159  MemoryContext oldcontext;
1160 
1161  recursion_depth++;
1163  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1164 
1165  EVALUATE_MESSAGE(edata->domain, hint, false, true);
1166 
1167  MemoryContextSwitchTo(oldcontext);
1168  recursion_depth--;
1169  return 0; /* return value does not matter */
1170 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:149
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:828
static int errordata_stack_depth
Definition: elog.c:147
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
struct MemoryContextData * assoc_context
Definition: elog.h:400
const char * domain
Definition: elog.h:379

◆ errhint_plural()

int errhint_plural ( const char *  fmt_singular,
const char *  fmt_plural,
unsigned long  n,
  ... 
)

Definition at line 1178 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE_PLURAL, MemoryContextSwitchTo(), and recursion_depth.

Referenced by ParseFuncOrColumn().

1180 {
1182  MemoryContext oldcontext;
1183 
1184  recursion_depth++;
1186  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1187 
1188  EVALUATE_MESSAGE_PLURAL(edata->domain, hint, false);
1189 
1190  MemoryContextSwitchTo(oldcontext);
1191  recursion_depth--;
1192  return 0; /* return value does not matter */
1193 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:149
static int errordata_stack_depth
Definition: elog.c:147
#define EVALUATE_MESSAGE_PLURAL(domain, targetfield, appendval)
Definition: elog.c:864
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
struct MemoryContextData * assoc_context
Definition: elog.h:400
const char * domain
Definition: elog.h:379

◆ errmsg()

int errmsg ( const char *  fmt,
  ... 
)

Definition at line 909 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE, MemoryContextSwitchTo(), ErrorData::message_id, and recursion_depth.

Referenced by _arrq_cons(), _bt_check_third_page(), _bt_check_unique(), _bt_checkpage(), _bt_getmeta(), _bt_gettrueroot(), _bt_pagedel(), _crypt_blowfish_rn(), _hash_addovflpage(), _hash_checkpage(), _hash_doinsert(), _hash_first(), _hash_init(), _hash_ovflblkno_to_bitno(), _intbig_in(), _intbig_out(), _lca(), _lt_q_regex(), _ltree_compress(), _mdfd_getseg(), _mdnblocks(), _PG_init(), _ShowOption(), _SPI_commit(), _SPI_execute_plan(), _SPI_rollback(), _tarReadRaw(), _tarWriteHeader(), AbortBufferIO(), accumArrayResultArr(), aclcheck_error(), aclcheck_error_col(), aclinsert(), aclitemin(), aclparse(), aclremove(), acquire_inherited_sample_rows(), acquire_sample_rows(), add_json(), add_jsonb(), add_parameter_name(), add_reloption_kind(), add_rte_to_flat_rtable(), add_size(), addCompoundAffixFlagValue(), AddEnumLabel(), addFamilyMember(), addFkRecurseReferenced(), addFkRecurseReferencing(), AddQual(), addRangeTableEntryForCTE(), addRangeTableEntryForFunction(), addRangeTableEntryForJoin(), addRangeTableEntryForSubquery(), addRangeTableEntryForValues(), AddRelationNewConstraints(), AddRoleMems(), addTargetToSortList(), AddToDataDirLockFile(), AddWALInfoToBackupManifest(), AdjustIntervalForTypmod(), AdjustTimestampForTypmodError(), advance_windowaggregate(), afterTriggerMarkEvents(), AfterTriggerSetState(), AggregateCreate(), alen_object_start(), alen_scalar(), AllocateDir(), AllocateFile(), AllocateVfd(), AllocSetContextCreateInternal(), AlterDatabase(), AlterDatabaseOwner(), AlterDomainAddConstraint(), AlterDomainDropConstraint(), AlterDomainNotNull(), AlterDomainValidateConstraint(), AlterEventTrigger(), AlterEventTriggerOwner(), AlterEventTriggerOwner_internal(), AlterEventTriggerOwner_oid(), AlterExtensionNamespace(), AlterForeignDataWrapper(), AlterForeignDataWrapperOwner(), AlterForeignDataWrapperOwner_internal(), AlterForeignDataWrapperOwner_oid(), AlterForeignServer(), AlterForeignServerOwner(), AlterForeignServerOwner_oid(), AlterFunction(), AlterObjectNamespace_internal(), AlterObjectRename_internal(), AlterOperator(), AlterOpFamily(), AlterOpFamilyAdd(), AlterOpFamilyDrop(), AlterPolicy(), AlterPublication(), AlterPublicationOwner(), AlterPublicationOwner_internal(), AlterPublicationOwner_oid(), AlterPublicationTables(), AlterRelationNamespaceInternal(), AlterRole(), AlterRoleSet(), AlterSchemaOwner(), AlterSequence(), AlterStatistics(), AlterSubscription(), AlterSubscription_refresh(), AlterSubscriptionOwner(), AlterSubscriptionOwner_internal(), AlterSubscriptionOwner_oid(), AlterSystemSetConfigFile(), AlterTableMoveAll(), AlterTableNamespace(), AlterTableSpaceOptions(), AlterTSConfiguration(), AlterType(), AlterTypeNamespace(), AlterTypeNamespace_oid(), AlterTypeNamespaceInternal(), AlterTypeOwner(), AlterUserMapping(), analyze_rel(), analyzeCTE(), analyzeCTETargetList(), anybit_typmodin(), anychar_typmodin(), anymultirange_in(), anytime_typmod_check(), anytime_typmodin(), anytimestamp_typmod_check(), anytimestamp_typmodin(), appendElement(), appendKey(), apply_dispatch(), apply_handle_origin(), apply_handle_stream_commit(), apply_typmod(), apply_typmod_special(), ApplyLogicalMappingFile(), ApplyWorkerMain(), apw_dump_now(), apw_load_buffers(), apw_start_database_worker(), apw_start_leader_worker(), array_agg_array_transfn(), array_agg_transfn(), array_append(), array_cat(), array_cmp(), array_contain_compare(), array_eq(), array_exec_setup(), array_fill(), array_fill_internal(), array_fill_with_lower_bounds(), array_get_slice(), array_in(), array_iterator(), array_map(), array_position_common(), array_positions(), array_prepend(), array_recv(), array_replace_internal(), array_send(), array_set_element(), array_set_element_expanded(), array_set_slice(), array_subscript_check_subscripts(), array_subscript_transform(), array_to_datum_internal(), array_to_tsvector(), ArrayCount(), ArrayGetIntegerTypmods(), ArrayGetNItems(), arrq_cons(), ascii(), ASN1_STRING_to_text(), assign_backendlist_entry(), assign_client_encoding(), assign_collations_walker(), assign_hypothetical_collations(), assign_record_type_identifier(), assign_xlog_sync_method(), assignOperTypes(), assignProcTypes(), AssignTypeArrayOid(), AssignTypeMultirangeArrayOid(), AssignTypeMultirangeOid(), Async_Notify(), asyncQueueFillWarning(), ATAddCheckConstraint(), ATAddForeignKeyConstraint(), AtEOSubXact_SPI(), AtEOXact_SPI(), ATExecAddColumn(), ATExecAddConstraint(), ATExecAddIdentity(), ATExecAddIndexConstraint(), ATExecAddInherit(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecAlterColumnType(), ATExecAlterConstraint(), ATExecAttachPartition(), ATExecAttachPartitionIdx(), ATExecChangeOwner(), ATExecCheckNotNull(), ATExecClusterOn(), ATExecColumnDefault(), ATExecDetachPartition(), ATExecDropColumn(), ATExecDropConstraint(), ATExecDropExpression(), ATExecDropIdentity(), ATExecDropInherit(), ATExecDropNotNull(), ATExecDropOf(), ATExecGenericOptions(), ATExecReplicaIdentity(), ATExecSetCompression(), ATExecSetIdentity(), ATExecSetNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetStatistics(), ATExecSetStorage(), ATExecValidateConstraint(), ATPrepAddColumn(), ATPrepAddInherit(), ATPrepAlterColumnType(), AtPrepare_Locks(), AtPrepare_Notify(), AtPrepare_RelationMap(), ATPrepChangePersistence(), ATPrepCmd(), ATPrepDropColumn(), ATPrepDropExpression(), ATPrepDropNotNull(), ATPrepSetNotNull(), ATPrepSetTableSpace(), ATRewriteTable(), ATRewriteTables(), ATSimplePermissions(), AtSubCommit_childXids(), attach_internal(), AttachPartitionEnsureIndexes(), ATWrongRelkindError(), auth_failed(), auth_peer(), autoinc(), autoprewarm_database_main(), autoprewarm_main(), autoprewarm_start_worker(), autovac_init(), AuxiliaryProcessMain(), backend_read_statsfile(), BackendInitialize(), BackendRun(), BackendStartup(), BackgroundWorkerInitializeConnection(), BackgroundWorkerInitializeConnectionByOid(), BackgroundWorkerStateChange(), basebackup_read_file(), BasicOpenFilePerm(), be_gssapi_read(), be_gssapi_write(), be_lo_close(), be_lo_export(), be_lo_get_fragment(), be_lo_lseek(), be_lo_lseek64(), be_lo_put(), be_lo_tell(), be_lo_tell64(), be_lo_unlink(), be_tls_init(), be_tls_open_server(), be_tls_read(), be_tls_write(), begin_prepare_cb_wrapper(), BeginCopyFrom(), BeginCopyTo(), BeginInternalSubTransaction(), BeginTransactionBlock(), bernoulli_beginsamplescan(), bgworker_die(), binary_decode(), binary_encode(), bit(), bit_and(), bit_catenate(), bit_in(), bit_or(), bit_overlay(), bit_recv(), bitgetbit(), bitsetbit(), bitsubstring(), bittoint4(), bittoint8(), bitxor(), blvalidate(), boolin(), BootstrapToastTable(), BootStrapXLOG(), bpchar(), bpchar_input(), bqarr_in(), bqarr_out(), brin_bloom_summary_in(), brin_bloom_summary_recv(), brin_desummarize_range(), brin_doinsert(), brin_doupdate(), brin_getinsertbuffer(), brin_metapage_info(), brin_minmax_multi_distance_interval(), brin_minmax_multi_summary_in(), brin_minmax_multi_summary_recv(), brin_page_items(), brin_page_type(), brin_revmap_data(), brin_summarize_range(), brininsert(), brinRevmapDesummarizeRange(), brinvalidate(), bt_check_every_level(), bt_check_level_from_leftmost(), bt_child_check(), bt_child_highkey_check(), bt_downlink_missing_check(), bt_index_check_internal(), bt_metap(), bt_normalize_tuple(), bt_page_items_bytea(), bt_page_items_internal(), bt_page_stats_internal(), bt_recheck_sibling_links(), bt_target_page_check(), bt_tuple_present_callback(), btree_index_checkable(), btree_index_mainfork_expected(), BTreeTupleGetHeapTIDCareful(), btvalidate(), BufFileDumpBuffer(), BufFileLoadBuffer(), BufFileOpenShared(), BufFileSeek(), BufFileSize(), BufFileTruncateShared(), build_attrmap_by_name(), build_column_default(), build_datatype(), build_pertrans_for_aggref(), build_server_first_message(), build_tuplestore_recursively(), BuildDescForRelation(), buildRelationAliases(), BuildRelationExtStatistics(), bytea_overlay(), bytea_substring(), byteaGetBit(), byteaGetByte(), byteain(), byteaSetBit(), byteaSetByte(), calc_rank_cd(), calculate_relation_size(), calculate_tablespace_size(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_pltcl_start_proc(), call_real_check_hook(), call_string_check_hook(), CancelBackup(), cannotCastJsonbValue(), cash_dist(), cash_div_cash(), cash_div_flt4(), cash_div_flt8(), cash_div_int2(), cash_div_int4(), cash_div_int8(), cash_in(), CastCreate(), cfread(), changeDependenciesOn(), ChangeToDataDir(), char2wchar(), check_acl(), check_agg_arguments(), check_agg_arguments_walker(), check_circularity(), check_collation_set(), check_conn_params(), check_default_partition_contents(), check_default_table_access_method(), check_default_tablespace(), check_duplicates_in_publist(), check_enable_rls(), check_encoding_locale_matches(), check_exclusion_or_unique_constraint(), check_for_column_name_collision(), check_foreign_key(), check_ident_usermap(), check_index_is_clusterable(), check_is_member_of_role(), check_lateral_ref_ok(), check_nested_generated_walker(), check_new_partition_bound(), check_object_ownership(), check_of_type(), check_parameter_resolution_walker(), check_password(), check_permissions(), check_primary_key(), check_publication_add_relation(), check_relation_privileges(), check_relation_relkind(), check_relation_updatable(), check_restricted_library_name(), check_role(), check_rolespec_name(), check_safe_enum_use(), check_same_host_or_net(), check_session_authorization(), check_sql_fn_retval(), check_sql_fn_statements(), check_srf_call_placement(), check_ssl_key_file_permissions(), check_stack_depth(), check_temp_tablespaces(), check_transform_function(), check_TSCurrentConfig(), check_ungrouped_columns_walker(), check_unicode_value(), check_usermap(), check_valid_extension_name(), check_valid_version_name(), CheckAttributeNamesTypes(), CheckAttributeType(), CheckCmdReplicaIdentity(), checkDataDir(), checkDomainOwner(), checkEnumOwner(), checkExprIsVarFree(), CheckForSerializableConflictIn(), CheckForSerializableConflictOut(), CheckForSerializableConflictOutNeeded(), CheckForStandbyTrigger(), CheckFunctionValidatorAccess(), CheckIndexCompatible(), checkInsertTargets(), CheckLogicalDecodingRequirements(), CheckMD5Auth(), CheckMyDatabase(), checkNameSpaceConflicts(), CheckPointLogicalRewriteHeap(), CheckPointReplicationOrigin(), CheckPointSnapBuild(), CheckPredicate(), CheckRADIUSAuth(), CheckRecoveryConflictDeadlock(), CheckRecoveryConsistency(), CheckRelationTableSpaceMove(), CheckRequiredParameterValues(), CheckRestrictedOperation(), checkRuleResultList(), CheckSCRAMAuth(), CheckSelectLocking(), CheckSetNamespace(), checkSharedDependencies(), CheckSlotRequirements(), checkStringLen(), CheckSubscriptionRelkind(), CheckTableNotInUse(), checkTargetlistEntrySQL92(), checkTimeLineSwitch(), checkTimezoneIsUsedForCast(), CheckTransactionBlock(), CheckValidResultRel(), CheckValidRowMarkRel(), CheckVarSlotCompatibility(), checkViewTupleDesc(), checkWellFormedRecursion(), checkWellFormedRecursionWalker(), CheckXLogRemoved(), choose_hashed_setop(), chr(), cidr_abbrev(), cidr_set_masklen(), circle_in(), circle_poly(), circle_recv(), cleanup_tsquery_stopwords(), ClientAuthentication(), CloneFkReferencing(), close_lb(), close_sl(), ClosePipeFromProgram(), ClosePipeToProgram(), cluster(), cluster_rel(), coerce_record_to_complex(), coerce_to_boolean(), coerce_to_common_type(), coerce_to_specific_type_typmod(), CollationCreate(), collectMatchBitmap(), colNameToVar(), CommandCounterIncrement(), CommentObject(), commit_prepared_cb_wrapper(), comparetup_index_btree(), compatConnectbyTupleDescs(), compatCrosstabTupleDescs(), compatible_oper(), compile_plperl_function(), compile_pltcl_function(), compileTheLexeme(), compileTheSubstitute(), complex_in(), compute_common_attribute(), compute_function_attributes(), compute_return_type(), ComputeIndexAttrs(), ComputePartitionAttrs(), ConnCreate(), connect_pg_server(), connectby_text(), connectby_text_serial(), construct_md_array(), ConversionCreate(), convert_and_check_filename(), convert_any_priv_string(), convert_column_name(), convert_function_name(), convert_priv_string(), convert_type_name(), convertJsonbArray(), convertJsonbObject(), cookConstraint(), cookDefault(), copy_file(), copy_replication_slot(), copy_table(), copy_table_data(), copydir(), CopyFrom(), CopyGetAttnums(), CopyGetData(), CopyReadAttributesCSV(), CopyReadAttributesText(), CopyReadBinaryAttribute(), CopyReadLineText(), CopySendEndOfRow(), count_nondeletable_pages(), count_usable_fds(), create_ctas_nodata(), create_distinct_paths(), create_ordinary_grouping_paths(), create_tablespace_directories(), CreateAccessMethod(), CreateAnonymousSegment(), CreateCast(), CreateCheckPoint(), CreateConversionCommand(), createdb(), CreateDecodingContext(), CreateEventTrigger(), CreateExtension(), CreateExtensionInternal(), CreateForeignDataWrapper(), CreateForeignServer(), CreateFunction(), CreateInheritance(), CreateInitDecodingContext(), CreateLockFile(), createNewConnection(), CreateOpFamily(), CreateOptsFile(), CreatePolicy(), CreatePortal(), CreatePredicateLock(), CreateProceduralLanguage(), CreatePublication(), CreateReplicationSlot(), CreateRestartPoint(), CreateRole(), CreateSchemaCommand(), CreateSlotOnDisk(), CreateStatistics(), CreateSubscription(), CreateTableAsRelExists(), CreateTableSpace(), CreateTransform(), CreateTrigger(), CreateUserMapping(), crosstab(), crosstab_hash(), cube_a_f8(), cube_a_f8_f8(), cube_c_f8(), cube_c_f8_f8(), cube_coord(), cube_coord_llur(), cube_recv(), cube_subset(), currval_oid(), cursor_to_xml(), cursor_to_xmlschema(), dacos(), dacosd(), dacosh(), dasin(), dasind(), datanh(), date2timestamp_opt_overflow(), date2timestamptz_opt_overflow(), date_in(), date_mi(), date_mii(), date_pli(), date_recv(), datetime_timestamp(), DateTimeParseError(), datetimetz_timestamptz(), datum_to_json(), datum_to_jsonb(), datumGetSize(), db_dir_size(), db_encoding_convert(), dbase_redo(), dblink_build_sql_delete(), dblink_build_sql_insert(), dblink_build_sql_update(), dblink_connect(), dblink_connstr_check(), dblink_exec(), dblink_fdw_validator(), dblink_fetch(), dblink_get_conn(), dblink_res_error(), dblink_security_check(), DCH_datetime_type(), DCH_from_char(), DCH_to_char(), dcos(), dcosd(), dcot(), dcotd(), DeadLockReport(), DebugFileOpen(), DecodeDateTime(), DecodeTimeOnly(), deconstruct_array(), DeconstructQualifiedName(), defGetBoolean(), defGetInt32(), defGetInt64(), defGetNumeric(), defGetQualifiedName(), defGetString(), defGetStringList(), defGetTypeLength(), defGetTypeName(), define_custom_variable(), DefineAggregate(), DefineCollation(), DefineCompositeType(), DefineDomain(), DefineEnum(), DefineIndex(), DefineOpClass(), DefineOperator(), DefineOpFamily(), DefineQueryRewrite(), DefineRange(), DefineRelation(), DefineSavepoint(), DefineSequence(), DefineTSConfiguration(), DefineTSDictionary(), DefineTSParser(), DefineTSTemplate(), DefineType(), DefineView(), DefineVirtualRelation(), deflist_to_tuplestore(), DeleteAllExportedSnapshotFiles(), deleteConnection(), DeleteInheritsTuple(), DelRoleMems(), deserialize_deflist(), destroy_tablespace_directories(), DetermineTimeZoneAbbrevOffsetTS(), dintdict_init(), disconnect_cached_connections(), dispell_init(), dist_bl(), dist_lb(), div_var(), div_var_fast(), dlog1(), dlog10(), do_analyze_rel(), do_autovacuum(), do_collation_version_check(), do_compile(), do_connect(), do_parallel_vacuum_or_cleanup(), do_pg_abort_backup(), do_pg_start_backup(), do_pg_stop_backup(), do_setval(), do_start_bgworker(), do_to_timestamp(), do_truncate(), DoCopy(), does_not_exist_skipping(), domain_check_input(), domain_state_setup(), domainAddConstraint(), dpow(), DropConfigurationMapping(), DropDatabase(), dropdb(), DropErrorMsgNonExistent(), DropErrorMsgWrongType(), dropOperators(), DropOwnedObjects(), dropProcedures(), DropRole(), DropSubscription(), DropTableSpace(), dsa_allocate_extended(), dsa_attach(), dshash_create(), dsimple_init(), dsin(), dsind(), dsm_backend_startup(), dsm_cleanup_for_mmap(), dsm_create(), dsm_impl_mmap(), dsm_impl_op(), dsm_impl_pin_segment(), dsm_impl_sysv(), dsm_impl_unpin_segment(), dsm_postmaster_shutdown(), dsnowball_init(), dsqrt(), dsynonym_init(), dtan(), dtand(), dtoi2(), dtoi4(), dtoi8(), dummy_object_relabel(), dumptuples(), durable_rename(), durable_rename_excl(), durable_unlink(), dxsyn_init(), EA_get_flat_size(), each_array_start(), each_scalar(), each_worker(), each_worker_jsonb(), ean2isn(), ean2string(), ECPGconnect(), elements_object_start(), elements_scalar(), elements_worker(), elements_worker_jsonb(), EmitWarningsOnPlaceholders(), EnableDisableRule(), EnableDisableTrigger(), EnableLockPagesPrivilege(), EndCopy(), EndCopyFrom(), EndPrepare(), EndTransactionBlock(), enforce_generic_type_consistency(), enlargeStringInfo(), entry_reset(), enum_cmp_internal(), enum_first(), enum_in(), enum_last(), enum_out(), enum_range_all(), enum_range_bounds(), enum_recv(), enum_send(), EnumValuesCreate(), error_commit_ts_disabled(), error_duplicate_filter_variable(), errorMissingColumn(), errorMissingRTE(), esc_dec_len(), esc_decode(), EvalPlanQualFetchRowMark(), EvaluateParams(), exec_assign_value(), exec_bind_message(), exec_describe_portal_message(), exec_describe_statement_message(), exec_dynquery_with_params(), exec_eval_datum(), exec_eval_expr(), exec_execute_message(), exec_init_tuple_store(), exec_move_row_from_fields(), exec_object_restorecon(), exec_parse_message(), exec_replication_command(), exec_run_select(), exec_simple_query(), exec_stmt_assert(), exec_stmt_case(), exec_stmt_close(), exec_stmt_dynexecute(), exec_stmt_execsql(), exec_stmt_fetch(), exec_stmt_forc(), exec_stmt_foreach_a(), exec_stmt_fori(), exec_stmt_getdiag(), exec_stmt_open(), exec_stmt_raise(), exec_stmt_return(), exec_stmt_return_next(), exec_stmt_return_query(), ExecAlterDefaultPrivilegesStmt(), ExecAlterExtensionContentsStmt(), ExecAlterExtensionStmt(), ExecBRInsertTriggers(), ExecBSDeleteTriggers(), ExecBSInsertTriggers(), ExecBSTruncateTriggers(), ExecBSUpdateTriggers(), ExecBuildUpdateProjection(), ExecCallTriggerFunc(), ExecCheckIndexConstraints(), ExecCheckPlanOutput(), ExecCheckTupleVisible(), ExecConstraints(), ExecCrossPartitionUpdate(), execCurrentOf(), ExecCustomMarkPos(), ExecCustomRestrPos(), ExecDelete(), ExecEvalArrayExpr(), ExecEvalConstraintCheck(), ExecEvalConstraintNotNull(), ExecEvalCurrentOfExpr(), ExecEvalFieldSelect(), ExecEvalParamExtern(), ExecEvalWholeRowVar(), ExecFindPartition(), ExecGrant_Language(), ExecGrant_Relation(), ExecGrant_Type(), ExecHashJoinGetSavedTuple(), ExecHashJoinNewBatch(), ExecInitAgg(), ExecInitExprRec(), ExecInitFunc(), ExecInitMergeJoin(), ExecInitSubscriptingRef(), ExecLockRows(), ExecMakeFunctionResultSet(), ExecMakeTableFunctionResult(), ExecOnConflictUpdate(), ExecOpenScanRelation(), ExecPartitionCheckEmitError(), ExecPrepareTuplestoreResult(), ExecRefreshMatView(), ExecReindex(), ExecScanSubPlan(), ExecSecLabelStmt(), ExecSetParamPlan(), ExecSetVariableStmt(), ExecUpdate(), execute_extension_script(), execute_sql_string(), executeBinaryArithmExpr(), executeDateTimeMethod(), ExecuteDoStmt(), ExecuteGrantStmt(), executeItemOptUnwrapTarget(), executeJsonPath(), executeKeyValueMethod(), executeNumericItemMethod(), ExecuteQuery(), ExecuteRecoveryCommand(), ExecuteTruncate(), ExecuteTruncateGuts(), executeUnaryArithmExpr(), ExecVacuum(), ExecWindowAgg(), ExecWithCheckOptions(), existsTimeLineHistory(), exitArchiveRecovery(), exp_var(), expand_col_privileges(), expand_vacuum_rel(), ExpandAllTables(), ExpandColumnRefStar(), expandTableLikeClause(), explain_ExecutorEnd(), ExplainQuery(), ExportSnapshot(), exprType(), extract_date(), extract_variadic_args(), ExtractExtensionList(), extractModify(), FastPathGetRelationLockEntry(), fatal_llvm_error_handler(), fatal_system_new_handler(), fetch_array_arg_replace_nulls(), fetch_cursor_param_value(), fetch_finfo_record(), fetch_fp_info(), fetch_remote_table_info(), fetch_table_list(), FetchDynamicTimeZone(), FetchPreparedStatement(), file_acquire_sample_rows(), file_exists(), file_fdw_validator(), fileAnalyzeForeignTable(), FileClose(), FileWrite(), fill_hba_view(), finalize_grouping_exprs_walker(), find_composite_type_dependencies(), find_expr_references_walker(), find_in_dynamic_libpath(), find_option(), find_provider(), find_typed_table_dependencies(), findDependentObjects(), findRangeCanonicalFunction(), findRangeSubOpclass(), findRangeSubtypeDiffFunction(), findTargetlistEntrySQL92(), findTypeAnalyzeFunction(), findTypeInputFunction(), findTypeOutputFunction(), findTypeReceiveFunction(), findTypeSendFunction(), findTypeSubscriptingFunction(), findTypeTypmodinFunction(), findTypeTypmodoutFunction(), finish_nodeitem(), fireRIRrules(), fixed_paramref_hook(), flatten_set_variable_args(), flattenJsonPathParseItem(), float4in(), float8_timestamptz(), float8in_internal_opt_error(), float_overflow_error(), float_underflow_error(), float_zero_divide_error(), FloatExceptionHandler(), fmgr_info_cxt_security(), fmgr_internal_validator(), fmgr_sql(), fmgr_sql_validator(), forbidden_in_wal_sender(), forkname_to_number(), free_parsestate(), from_char_parse_int_len(), from_char_seq_search(), from_char_set_int(), from_char_set_mode(), fsm_page_contents(), fsync_fname_ext(), ftoi2(), ftoi4(), ftoi8(), g_cube_distance(), g_int_compress(), g_int_decompress(), gbtreekey_in(), gbtreekey_out(), gc_qtexts(), gen_random_uuid(), generate_recursion_path(), generate_series_step_int4(), generate_series_step_int8(), generate_series_step_numeric(), generate_series_timestamp(), generate_series_timestamptz(), generateClonedIndexStmt(), generateSerialExtraStmts(), GenerationContextCreate(), Generic_Text_IC_like(), GenericMatchText(), get_am_type_oid(), get_cached_rowtype(), get_cast_oid(), get_cfp_error(), get_collation_actual_version(), get_collation_oid(), get_collation_version_for_oid(), get_connect_string(), get_controlfile(), get_conversion_oid(), get_crosstab_tuplestore(), get_database_oid(), get_dirent_type(), get_domain_constraint_oid(), get_event_trigger_oid(), get_expr_result_tupdesc(), get_extension_oid(), get_fn_opclass_options(), get_foreign_data_wrapper_oid(), get_foreign_server_oid(), get_func_expr(), get_hex(), get_language_oid(), get_multirange_io_data(), get_namespace_oid(), get_object_address(), get_object_address_attrdef(), get_object_address_attribute(), get_object_address_defacl(), get_object_address_opf_member(), get_object_address_publication_rel(), get_object_address_relobject(), get_object_address_type(), get_object_address_usermapping(), get_other_operator(), get_page_from_raw(), get_publication_oid(), get_range_io_data(), get_raw_page(), get_raw_page_1_9(), get_raw_page_fork_1_9(), get_raw_page_internal(), get_record_type_from_argument(), get_record_type_from_query(), get_relation_by_qualified_name(), get_relation_constraint_attnos(), get_relation_constraint_oid(), get_relation_info(), get_relation_policy_oid(), get_required_extension(), get_rewrite_oid(), get_role_oid(), get_rolespec_oid(), get_rolespec_tuple(), get_rte_attribute_is_dropped(), get_sort_group_operators(), get_sql_insert(), get_sql_update(), get_statistics_object_oid(), get_subscription_oid(), get_tablespace_oid(), get_th(), get_transform_oid(), get_trigger_oid(), get_ts_config_oid(), get_ts_dict_oid(), get_ts_parser_func(), get_ts_parser_oid(), get_ts_template_func(), get_ts_template_oid(), get_tsearch_config_filename(), get_tuple_of_interest(), get_windowfunc_expr(), getAffixFlagSet(), getAnotherTuple(), getArrayIndex(), GetAttributeCompression(), GetColumnDefCollation(), GetConfigOption(), GetConfigOptionByName(), GetConfigOptionResetString(), GetConflictingVirtualXIDs(), GetCurrentTimeUsec(), getdatafield(), GetDefaultOpClass(), GetDefaultTablespace(), GetExtensibleNodeEntry(), GetFdwRoutineByServerId(), getid(), GetIndexAmRoutineByAmId(), getInstallationPaths(), getJsonPathVariable(), getlen(), GetMultiXactIdMembers(), GetNewMultiXactId(), GetNewOidWithIndex(), GetNewTransactionId(), getNextFlagFromString(), getParamDescriptions(), getRowDescriptions(), GetRunningTransactionData(), GetSerializableTransactionSnapshot(), GetSerializableTransactionSnapshotInt(), GetSnapshotData(), gettoken_query(), gettoken_query_standard(), gettoken_tsvector(), getTokenTypes(), GetTupleForTrigger(), getTypeBinaryInputInfo(), getTypeBinaryOutputInfo(), getTypeInputInfo(), getTypeOutputInfo(), GetUserMapping(), GetUserNameFromId(), getWeights(), gin_clean_pending_list(), gin_leafpage_items(), gin_metapage_info(), gin_page_opaque_info(), ginadjustmembers(), ginCombineData(), GinFormTuple(), ginvalidate(), gist_page_items(), gist_page_items_bytea(), gist_page_opaque_info(), gistadjustmembers(), gistcheckpage(), gistdoinsert(), gistfixsplit(), gistSplit(), gistUserPicksplit(), gistvacuumpage(), gistvalidate(), GrantRole(), grouping_planner(), gtsvectorin(), guc_malloc(), guc_realloc(), guc_strdup(), HandleChildCrash(), HandleConcurrentAbort(), HandleFunctionRequest(), HandleParallelMessages(), has_sequence_privilege_id(), has_sequence_privilege_id_id(), has_sequence_privilege_id_name(), has_sequence_privilege_name(), has_sequence_privilege_name_id(), has_sequence_privilege_name_name(), hash_array(), hash_array_extended(), hash_array_start(), hash_bitmap_info(), hash_create(), hash_metapage_info(), hash_multirange(), hash_multirange_extended(), hash_page_items(), hash_page_stats(), hash_page_type(), hash_range(), hash_range_extended(), hash_record(), hash_record_extended(), hash_scalar(), hash_search_with_hash_value(), hashagg_batch_read(), hashbpchar(), hashbpcharextended(), hashtext(), hashtextextended(), hashvalidate(), heap_acquire_tuplock(), heap_create(), heap_create_with_catalog(), heap_delete(), heap_force_common(), heap_form_minimal_tuple(), heap_form_tuple(), heap_inplace_update(), heap_lock_tuple(), heap_page_items(), heap_prepare_insert(), heap_truncate_check_FKs(), heap_tuple_infomask_flags(), heap_update(), heap_xlog_logical_rewrite(), heapam_tuple_lock(), hex2_to_uchar(), hlparsetext(), HoldPinnedPortals(), hstore_from_array(), hstore_from_arrays(), hstore_populate_record(), hstore_recv(), hstore_subscript_assign(), hstore_subscript_transform(), hstore_to_plpython(), hstoreArrayToPairs(), hstoreCheckKeyLen(), hstoreCheckValLen(), i4tochar(), i4toi2(), i8tooid(), ident_inet(), identify_update_path(), ImportForeignSchema(), ImportSnapshot(), in_range_float4_float8(), in_range_float8_float8(), in_range_int2_int4(), in_range_int4_int4(), in_range_int4_int8(), in_range_int8_int8(), in_range_interval_interval(), in_range_numeric_numeric(), in_range_time_interval(), in_range_timestamp_interval(), in_range_timestamptz_interval(), in_range_timetz_interval(), incompatible_module_error(), index_check_primary_key(), index_concurrently_create_copy(), index_constraint_create(), index_create(), index_drop(), index_form_tuple(), index_opclass_options(), index_open(), IndexOnlyNext(), inet_abbrev(), inet_merge(), inet_set_masklen(), inetand(), inetmi(), inetor(), infer_arbiter_indexes(), init_execution_state(), init_MultiFuncCall(), init_params(), init_sequence(), init_sexpr(), initArrayResultArr(), InitControlFile(), InitFileAccess(), initGinState(), initialize_dh(), initialize_ecdh(), initialize_peragg(), InitializeClientEncoding(), InitializeSessionUserId(), InitLocalBuffers(), InitPgFdwOptions(), InitPostgres(), InitProcess(), InitTempTableNamespace(), initTrie(), inner_subltree(), insert_username(), InsertRule(), instantiate_empty_record_variable(), int24div(), int24mi(), int24mul(), int24pl(), int28div(), int28mi(), int28mul(), int28pl(), int2_dist(), int2abs(), int2div(), int2mi(), int2mod(), int2mul(), int2pl(), int2um(), int2vectorin(), int2vectorrecv(), int42div(), int42mi(), int42mul(), int42pl(), int48div(), int48mi(), int48mul(), int48pl(), int4_dist(), int4abs(), int4div(), int4gcd_internal(), int4inc(), int4lcm(), int4mi(), int4mod(), int4mul(), int4pl(), int4um(), int82(), int82div(), int82mi(), int82mul(), int82pl(), int84(), int84div(), int84mi(), int84mul(), int84pl(), int8_dist(), int8abs(), int8dec(), int8div(), int8gcd_internal(), int8inc(), int8lcm(), int8mi(), int8mod(), int8mul(), int8pl(), int8um(), internal_flush(), internal_get_result_type(), internal_inetpl(), internal_load_library(), internal_unload_library(), InternalIpcMemoryCreate(), InternalIpcSemaphoreCreate(), interpret_AS_clause(), interpret_func_parallel(), interpret_func_support(), interpret_function_parameter_list(), interval2tm(), interval_div(), interval_in(), interval_mi(), interval_mul(), interval_part_common(), interval_pl(), interval_trunc(), interval_um(), intervaltypmodin(), intorel_startup(), inv_open(), inv_read(), inv_seek(), inv_truncate(), inv_write(), InvalidateObsoleteReplicationSlots(), iso8859_to_utf8(), issue_xlog_fsync(), IsThereCollationInNamespace(), IsThereFunctionInNamespace(), IsThereOpClassInNamespace(), IsThereOpFamilyInNamespace(), json_agg_transfn(), json_build_object(), json_ereport_error(), json_object(), json_object_agg_transfn(), json_object_two_arg(), jsonb_agg_transfn(), jsonb_array_length(), jsonb_build_object(), jsonb_delete(), jsonb_delete_array(), jsonb_delete_idx(), jsonb_delete_path(), jsonb_insert(), jsonb_object(), jsonb_object_agg_transfn(), jsonb_object_keys(), jsonb_object_two_arg(), jsonb_path_match_internal(), jsonb_set(), jsonb_set_lax(), jsonb_subscript_check_subscripts(), jsonb_subscript_transform(), JsonEncodeDateTime(), jsonPathFromCstring(), JsValueToJsObject(), KeepFileRestoredFromArchive(), LargeObjectDrop(), lastval(), lazy_check_wraparound_failsafe(), lazy_cleanup_one_index(), lazy_scan_heap(), lazy_space_alloc(), lazy_truncate_heap(), lazy_vacuum(), lazy_vacuum_heap_rel(), lazy_vacuum_one_index(), lc_ctype_is_c(), length_in_encoding(), libpqrcv_check_conninfo(), libpqrcv_connect(), libpqrcv_create_slot(), libpqrcv_endstreaming(), libpqrcv_exec(), libpqrcv_get_conninfo(), libpqrcv_identify_system(), libpqrcv_processTuples(), libpqrcv_readtimelinehistoryfile(), libpqrcv_receive(), libpqrcv_send(), libpqrcv_startstreaming(), like_fixed_prefix(), line_construct_pp(), line_in(), line_recv(), ln_var(), lo_get_fragment_internal(), lo_import_internal(), lo_read(), lo_truncate_internal(), lo_write(), load_categories_hash(), load_dh_file(), load_enum_cache_data(), load_external_function(), load_hba(), load_ident(), load_libraries(), load_relmap_file(), LocalBufferAlloc(), LocalToUtf(), locate_stem_module(), lock_twophase_recover(), LockAcquireExtended(), LockGXact(), LockTableRecurse(), LockViewRecurse_walker(), log_disconnections(), LogCheckpointEnd(), LogCheckpointStart(), LogChildExit(), logfile_open(), logfile_rotate(), logical_end_heap_rewrite(), logical_heap_rewrite_flush_mappings(), logical_rewrite_log_mapping(), logicalrep_rel_open(), logicalrep_worker_attach(), logicalrep_worker_launch(), LogicalRepApplyLoop(), LogicalRepSyncTableStart(), LogRecoveryConflict(), looks_like_temp_rel_name(), lookup_agg_function(), lookup_am_handler_func(), lookup_fdw_handler_func(), lookup_rowtype_tupdesc_domain(), lookup_rowtype_tupdesc_internal(), lookup_type_cache(), LookupFuncName(), LookupFuncWithArgs(), LookupOperName(), LookupTypeNameExtended(), LookupTypeNameOid(), lowerstr_with_len(), lpad(), lt_q_regex(), ltree_concat(), ltree_gist_in(), ltree_gist_out(), ltree_to_plpython(), ltsReadBlock(), ltsWriteBlock(), ltxtq_out(), ltxtq_send(), macaddr8_in(), macaddr8tomacaddr(), macaddr_in(), main(), make_absolute_path(), make_callstmt_target(), make_date(), make_distinct_op(), make_expanded_record_from_tupdesc(), make_expanded_record_from_typeid(), make_interval(), make_op(), make_outerjoininfo(), make_pathkeys_for_window(), make_result_opt_error(), make_row_comparison_op(), make_row_distinct_op(), make_ruledef(), make_scalar_array_op(), make_time(), make_timestamp_internal(), make_timestamptz_at_timezone(), make_tsvector(), makeArrayTypeName(), makeMultirangeTypeName(), makepol(), makeRangeVarFromNameList(), makeWholeRowVar(), map_sql_value_to_xml_value(), mark_index_clustered(), MarkAsPreparing(), MarkInheritDetached(), MarkPortalActive(), MatchText(), materializeResult(), maybe_reread_subscription(), md5_bytea(), md5_text(), mdcreate(), mdextend(), mdimmedsync(), mdopenfork(), mdread(), mdtruncate(), mdunlinkfork(), mdwrite(), MemoryContextAlloc(), MemoryContextAllocExtended(), MemoryContextAllocHuge(), MemoryContextAllocZero(), MemoryContextAllocZeroAligned(), merge_acl_with_grant(), merge_collation_state(), merge_publications(), MergeAttributes(), MergeAttributesIntoExisting(), MergeCheckConstraint(), MergeConstraintsIntoExisting(), MergeWithExistingConstraint(), metaphone(), moddatetime(), ModifyWaitEvent(), movedb(), mul_size(), multirange_constructor1(), multirange_constructor2(), multirange_in(), multirange_intersect_agg_transfn(), namerecv(), NamespaceCreate(), network_host(), network_in(), network_out(), network_recv(), network_show(), next_token(), NextCopyFrom(), nextval_internal(), NIAddAffix(), NIImportAffixes(), NIImportDictionary(), NIImportOOAffixes(), NISortDictionary(), NonFiniteTimestampTzPart(), normal_rand(), NUM_processor(), NUMDesc_prepare(), numeric_div_opt_error(), numeric_div_trunc(), numeric_fac(), numeric_in(), numeric_int2(), numeric_int4_opt_error(), numeric_int8(), numeric_ln(), numeric_log(), numeric_mod_opt_error(), numeric_pg_lsn(), numeric_power(), numeric_recv(), numeric_sqrt(), numerictypmodin(), numericvar_to_double_no_overflow(), objectNamesToOids(), oidin_subr(), oidvectorin(), oidvectorrecv(), okeys_array_start(), okeys_scalar(), OnConflict_CheckForSerializationFailure(), op_error(), OpClassCacheLookup(), OpenPipeStream(), OpenTransientFilePerm(), OperatorCreate(), OperatorShellMake(), OpFamilyCacheLookup(), page_checksum_internal(), page_header(), PageAddItemExtended(), PageGetItemIdCareful(), PageIndexMultiDelete(), PageIndexTupleDelete(), PageIndexTupleDeleteNoCompact(), PageIndexTupleOverwrite(), PageIsVerifiedExtended(), PageRepairFragmentation(), pair_decode(), palloc(), palloc0(), palloc_btree_page(), palloc_extended(), ParallelWorkerMain(), parse_affentry(), parse_and_validate_value(), parse_basebackup_options(), parse_datetime(), parse_extension_control_file(), parse_fcall_arguments(), parse_format(), parse_func_options(), parse_hba_auth_opt(), parse_hba_line(), parse_ident(), parse_ident_line(), parse_jsonb_index_flags(), parse_key_value_arrays(), parse_lquery(), parse_ltree(), parse_one_reloption(), parse_output_parameters(), parse_phrase_operator(), parse_publication_options(), parse_re_flags(), parse_sane_timezone(), parse_snapshot(), parse_subscription_options(), parse_test_flags(), parse_tsquery(), parseCheckAggregates(), parseCreateReplSlotOptions(), ParseFuncOrColumn(), parseIntFromText(), parseNameAndArgTypes(), parseRelOptionsInternal(), parserOpenTable(), parsetext(), parseTypeString(), parseVxidFromText(), parseXidFromText(), path_add(), path_center(), path_decode(), path_in(), path_poly(), path_recv(), PathNameCreateTemporaryDir(), PathNameCreateTemporaryFile(), PathNameDeleteTemporaryFile(), PathNameOpenFilePerm(), PathNameOpenTemporaryFile(), percentile_cont_final_common(), percentile_disc_final(), perform_base_backup(), perform_default_encoding_conversion(), PerformAuthentication(), PerformCursorOpen(), PerformPortalClose(), PerformPortalFetch(), PerformRadiusTransaction(), pg_any_to_server(), pg_atoi(), pg_attribute_aclmask_ext(), pg_attribute_noreturn(), pg_available_extension_versions(), pg_available_extensions(), pg_backup_start_time(), pg_base64_decode(), pg_be_scram_build_secret(), pg_be_scram_exchange(), pg_be_scram_init(), pg_cancel_backend(), pg_class_aclmask_ext(), pg_class_ownercheck(), pg_collation_actual_version(), pg_collation_for(), pg_collation_ownercheck(), pg_config(), pg_control_checkpoint(), pg_control_init(), pg_control_recovery(), pg_control_system(), pg_conversion_ownercheck(), pg_convert(), pg_create_restore_point(), pg_crypt(), pg_cryptohash_create(), pg_current_logfile(), pg_current_wal_flush_lsn(), pg_current_wal_insert_lsn(), pg_current_wal_lsn(), pg_cursor(), pg_database_aclmask(), pg_database_ownercheck(), pg_decode_startup(), pg_decrypt(), pg_decrypt_iv(), pg_dependencies_in(), pg_dependencies_recv(), pg_do_encoding_conversion(), pg_encrypt(), pg_encrypt_iv(), pg_event_trigger_ddl_commands(), pg_event_trigger_dropped_objects(), pg_event_trigger_ownercheck(), pg_event_trigger_table_rewrite_oid(), pg_event_trigger_table_rewrite_reason(), pg_extension_config_dump(), pg_extension_ownercheck(), pg_extension_update_paths(), pg_file_rename_internal(), pg_file_sync(), pg_file_unlink(), pg_file_unlink_v1_1(), pg_file_write_internal(), pg_flush_data(), pg_foreign_data_wrapper_aclmask(), pg_foreign_data_wrapper_ownercheck(), pg_foreign_server_aclmask(), pg_foreign_server_ownercheck(), pg_freespace(), pg_gen_salt(), pg_gen_salt_rounds(), pg_get_backend_memory_contexts(), pg_get_functiondef(), pg_get_multixact_members(), pg_get_object_address(), pg_get_replication_slots(), pg_get_serial_sequence(), pg_get_shmem_allocations(), pg_get_wal_replay_pause_state(), pg_hba_file_rules(), pg_hex_decode(), pg_hmac_create(), pg_import_system_collations(), pg_is_wal_replay_paused(), pg_language_aclmask(), pg_language_ownercheck(), pg_largeobject_aclmask_snapshot(), pg_largeobject_ownercheck(), pg_log_backend_memory_contexts(), pg_logdir_ls(), pg_logdir_ls_internal(), pg_logical_slot_get_changes_guts(), pg_ls_dir(), pg_ls_dir_files(), pg_ls_tmpdir(), pg_lsn_in(), pg_lsn_mii(), pg_lsn_pli(), pg_mcv_list_in(), pg_mcv_list_recv(), pg_namespace_aclmask(), pg_namespace_ownercheck(), pg_ndistinct_in(), pg_ndistinct_recv(), pg_newlocale_from_collation(), pg_nextoid(), pg_opclass_ownercheck(), pg_oper_ownercheck(), pg_opfamily_ownercheck(), pg_prepared_statement(), pg_prewarm(), pg_proc_aclmask(), pg_proc_ownercheck(), pg_promote(), pg_publication_ownercheck(), pg_random_bytes(), pg_read_binary_file(), pg_read_file(), pg_read_file_v2(), pg_reload_conf(), pg_relpages(), pg_relpagesbyid(), pg_replication_origin_create(), pg_replication_origin_session_progress(), pg_replication_origin_xact_setup(), pg_replication_slot_advance(), pg_rotate_logfile(), pg_rotate_logfile_v2(), pg_sequence_last_value(), pg_sequence_parameters(), pg_set_regex_collation(), pg_show_replication_origin_status(), pg_signal_backend(), pg_size_bytes(), pg_snapshot_recv(), pg_start_backup(), pg_stat_file(), pg_stat_get_activity(), pg_stat_get_prefetch_recovery(), pg_stat_get_progress_info(), pg_stat_get_replication_slots(), pg_stat_get_slru(), pg_stat_get_subscription(), pg_stat_get_wal_senders(), pg_stat_statements_info(), pg_stat_statements_internal(), pg_statistics_object_ownercheck(), pg_stats_ext_mcvlist_items(), pg_stop_backup(), pg_stop_backup_v2(), pg_strtoint16(), pg_strtoint32(), pg_subscription_ownercheck(), pg_switch_wal(), pg_tablespace_aclmask(), pg_tablespace_databases(), pg_tablespace_location(), pg_tablespace_ownercheck(), pg_terminate_backend(), pg_timezone_names(), pg_to_ascii(), pg_ts_config_ownercheck(), pg_ts_dict_ownercheck(), pg_type_aclmask(), pg_type_ownercheck(), pg_tzenumerate_next(), pg_tzenumerate_start(), pg_unicode_to_server(), pg_visibility(), pg_visibility_map(), pg_wait_for_backend_termination(), pg_wait_until_termination(), pg_wal_replay_pause(), pg_wal_replay_resume(), pg_walfile_name(), pg_walfile_name_offset(), pgarch_ArchiverCopyLoop(), pgarch_archiveXlog(), pgfdw_cancel_query(), pgfdw_reject_incomplete_xact_state_change(), pgfdw_report_error(), pgfdw_xact_callback(), PGLC_localeconv(), pgoutput_startup(), PGReserveSemaphores(), pgrowlocks(), PGSemaphoreCreate(), PGSemaphoreLock(), PGSemaphoreTryLock(), PGSemaphoreUnlock(), PGSharedMemoryCreate(), pgss_shmem_shutdown(), pgss_shmem_startup(), pgstat_heap(), pgstat_init(), pgstat_read_db_statsfile(), pgstat_read_db_statsfile_timestamp(), pgstat_read_statsfiles(), pgstat_recv_dropdb(), pgstat_recv_inquiry(), pgstat_relation(), pgstat_reset_replslot_counter(), pgstat_reset_shared_counters(), pgstat_start(), pgstat_write_db_statsfile(), pgstat_write_statsfiles(), PgstatCollectorMain(), pgstatginindex(), pgstatginindex_internal(), pgstathashindex(), pgstatindex(), pgstatindex_impl(), pgstatindexbyid(), pgstattuple(), pgstattuple_approx(), pgstattuple_approx_internal(), pgstattuplebyid(), pgwin32_create_signal_listener(), placeChar(), plperl_array_to_datum(), plperl_build_tuple_result(), plperl_call_perl_event_trigger_func(), plperl_call_perl_func(), plperl_call_perl_trigger_func(), plperl_create_sub(), plperl_func_handler(), plperl_init_interp(), plperl_modify_tuple(), plperl_return_next_internal(), plperl_spi_execute_fetch_result(), plperl_sv_to_datum(), plperl_sv_to_literal(), plperl_to_hstore(), plperl_trigger_handler(), plperl_trusted_init(), plperl_untrusted_init(), plperl_validator(), plpgsql_build_variable(), plpgsql_exec_event_trigger(), plpgsql_exec_function(), plpgsql_exec_get_datum_type(), plpgsql_exec_get_datum_type_info(), plpgsql_exec_trigger(), plpgsql_param_eval_generic(), plpgsql_param_eval_generic_ro(), plpgsql_param_eval_recfield(), plpgsql_parse_cwordrowtype(), plpgsql_parse_err_condition(), plpgsql_parse_wordrowtype(), plpgsql_post_column_ref(), plpgsql_recognize_err_condition(), plpgsql_resolve_polymorphic_argtypes(), plpgsql_validator(), plpgsql_yyerror(), plpython_to_hstore(), plsample_func_handler(), pltcl_build_tuple_result(), pltcl_elog(), pltcl_func_handler(), pltcl_trigger_handler(), PLy_abort_open_subtransactions(), PLy_cursor_fetch(), PLy_exec_function(), PLy_exec_trigger(), PLy_function_build_args(), PLy_initialize(), PLy_modify_tuple(), PLy_procedure_create(), PLy_spi_execute_fetch_result(), PLy_spi_prepare(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLyNumber_ToJsonbValue(), PLyObject_AsString(), PLyObject_ToJsonbValue(), PLySequence_ToArray(), PLySequence_ToArray_recurse(), PLySequence_ToComposite(), PLyString_ToComposite(), pmdie(), policy_role_list_to_array(), poly_distance(), poly_in(), poly_recv(), populate_array_check_dimension(), populate_array_report_expected_array(), populate_joinrel_with_paths(), populate_recordset_array_element_start(), populate_recordset_object_start(), populate_recordset_scalar(), populate_recordset_worker(), PortalDrop(), PortalRunSelect(), PortalSetResultFormat(), postgres_fdw_get_connections(), postgres_fdw_validator(), postgresAcquireSampleRowsFunc(), postgresBeginForeignInsert(), postgresExecForeignTruncate(), postgresImportForeignSchema(), PostgresMain(), postgresql_fdw_validator(), PostmasterMain(), PostmasterMarkPIDForWorkerNotify(), PostmasterStateMachine(), PostPrepare_Locks(), power_var(), power_var_int(), pq_check_connection(), pq_copymsgbytes(), pq_getbyte_if_available(), pq_getkeepalivescount(), pq_getkeepalivesidle(), pq_getkeepalivesinterval(), pq_getmessage(), pq_getmsgbyte(), pq_getmsgbytes(), pq_getmsgend(), pq_getmsgrawstring(), pq_getmsgstring(), pq_getmsgtext(), pq_gettcpusertimeout(), pq_init(), pq_putmessage_v2(), pq_recvbuf(), pq_setkeepalivescount(), pq_setkeepalivesidle(), pq_setkeepalivesinterval(), pq_settcpusertimeout(), pq_startmsgread(), PQsetvalue(), PreCommit_CheckForSerializationFailure(), PreCommit_Notify(), PreCommit_Portals(), predicatelock_twophase_recover(), PrefetchBuffer(), prepare_cb_wrapper(), prepare_sql_fn_parse_info(), PrepareQuery(), PrepareRedoAdd(), PrepareTransaction(), preprocess_grouping_sets(), prepTuplestoreResult(), PreventCommandDuringRecovery(), PreventCommandIfParallelMode(), PreventCommandIfReadOnly(), PreventInTransactionBlock(), printtup_prepare_info(), ProcArrayAdd(), ProcedureCreate(), process_matched_tle(), process_owned_by(), process_postgres_switches(), processCancelRequest(), ProcessCopyOptions(), ProcessGUCArray(), ProcessInterrupts(), ProcessLogMemoryContextInterrupt(), ProcessRepliesIfAny(), ProcessStandbyMessage(), ProcessStartupPacket(), ProcessSyncRequests(), ProcessTwoPhaseBuffer(), processTypesSpec(), ProcessUtilitySlow(), ProcessWalRcvInterrupts(), ProcSleep(), protect_out_of_mem(), prsd_headline(), prssyntaxerror(), publication_add_relation(), PublicationDropTables(), pushquery(), PushTransaction(), pushval_asis(), pushValue(), pushValue_internal(), pvsnprintf(), px_crypt_des(), px_THROW_ERROR(), qtext_load_file(), qtext_store(), QTN2QT(), QualifiedNameGetCreationNamespace(), query_to_xml_internal(), queryin(), quickdie(), range_agg_transfn(), range_constructor3(), range_intersect_agg_transfn(), range_minus_internal(), range_parse(), range_parse_bound(), range_parse_flags(), range_serialize(), range_union_internal(), RangeVarAdjustRelationPersistence(), RangeVarCallbackForAlterRelation(), RangeVarCallbackForAttachIndex(), RangeVarCallbackForDropRelation(), RangeVarCallbackForLockTable(), RangeVarCallbackForPolicy(), RangeVarCallbackForReindexIndex(), RangeVarCallbackForRenameRule(), RangeVarCallbackForRenameTrigger(), RangeVarCallbackOwnsRelation(), RangeVarCallbackOwnsTable(), RangeVarGetAndCheckCreationNamespace(), RangeVarGetCreationNamespace(), RangeVarGetRelidExtended(), raw_heap_insert(), RE_compile(), RE_compile_and_cache(), RE_wchar_execute(), read_any_attr(), read_attr_value(), read_backup_label(), read_binary_file(), read_client_final_message(), read_client_first_message(), read_dictionary(), read_objtype_from_string(), read_server_final_message(), read_tablespace_map(), read_whole_file(), ReadArrayBinary(), ReadArrayStr(), ReadBuffer_common(), ReadBufferExtended(), ReadCheckpointRecord(), ReadControlFile(), ReadDirExtended(), ReadRecord(), readRecoverySignalFile(), readstoplist(), readTimeLineHistory(), readtup_heap(), ReadTwoPhaseFile(), reaper(), ReassignOwnedObjects(), ReceiveCopyBinaryHeader(), RecheckDataDirLockFile(), recompute_limits(), record_cmp(), record_eq(), record_image_cmp(), record_image_eq(), record_in(), record_recv(), recordDependencyOnCurrentExtension(), RecoverPreparedTransactions(), recoveryPausesHere(), RecoveryRequiresIntParameter(), recoveryStopsAfter(), recoveryStopsBefore(), RecreateTwoPhaseFile(), recursive_revoke(), recv_password_packet(), refresh_by_match_merge(), refuseDupeIndexAttach(), regex_fixed_prefix(), regexp_fixed_prefix(), regexp_match(), regexp_split_to_array(), regexp_split_to_table(), register_dirty_segment(), RegisterBackgroundWorker(), RegisterExtensibleNodeEntry(), RegisterTimeout(), regnamespacein(), regoperatorin(), regoperin(), regprocedurein(), regprocin(), regrolein(), reindex_index(), reindex_relation(), ReindexMultipleInternal(), ReindexMultipleTables(), ReindexRelationConcurrently(), ReindexTable(), RelationBuildPartitionKey(), RelationCopyStorage(), RelationFindReplTupleByIndex(), RelationFindReplTupleSeq(), RelationGetBufferForTuple(), ReleaseCurrentSubTransaction(), ReleaseOneSerializableXact(), ReleaseSavepoint(), remove_dbtablespaces(), remove_tablespace_symlink(), RemoveExtensionById(), RemoveInheritance(), RemoveObjects(), RemovePgTempFilesInDir(), RemovePgTempRelationFilesInDbspace(), RemovePolicyById(), RemoveRelations(), RemoveRewriteRuleById(), RemoveRoleFromObjectPolicy(), RemoveSubscriptionRel(), RemoveTriggerById(), RemoveTwoPhaseFile(), RemoveUserMapping(), RemoveXlogFile(), rename_constraint_internal(), rename_policy(), renameatt(), renameatt_check(), renameatt_internal(), RenameConstraint(), RenameConstraintById(), RenameDatabase(), RenameEnumLabel(), RenameRelation(), RenameRelationInternal(), RenameRewriteRule(), RenameRole(), RenameSchema(), RenameTableSpace(), renametrig(), RenameType(), RenameTypeInternal(), ReorderBufferCleanupSerializedTXNs(), ReorderBufferRestoreChanges(), ReorderBufferRestoreCleanup(), ReorderBufferSerializeChange(), ReorderBufferSerializeTXN(), repalloc(), repalloc_huge(), repeat(), replace_rte_variables_mutator(), replace_text_regexp(), ReplaceVarsFromTargetList_callback(), ReplicationSlotAcquireInternal(), ReplicationSlotCreate(), ReplicationSlotDropAtPubNode(), ReplicationSlotDropPtr(), ReplicationSlotsDropDBSlots(), ReplicationSlotValidateName(), replorigin_advance(), replorigin_by_name(), replorigin_by_oid(), replorigin_check_prerequisites(), replorigin_create(), replorigin_drop_guts(), replorigin_session_reset(), replorigin_session_setup(), report_invalid_encoding(), report_name_conflict(), report_namespace_conflict(), report_untranslatable_char(), reportDependentObjects(), ReportSlotConnectionError(), ReportTemporaryFileUsage(), RequestCheckpoint(), requireSuperuser(), rescanLatestTimeLine(), reserveAllocatedDesc(), ResetUnloggedRelationsInDbspaceDir(), ResetUnloggedRelationsInTablespaceDir(), resolve_anyarray_from_others(), resolve_anyelement_from_others(), resolve_anymultirange_from_others(), resolve_anyrange_from_others(), resolve_column_ref(), resolve_unique_index_expr(), ResolveOpClass(), RestoreArchivedFile(), RestoreGUCState(), RestoreSlotFromDisk(), restrict_and_check_grant(), revalidate_rectypeid(), RevalidateCachedQuery(), revmap_physical_extend(), RewriteQuery(), rewriteRuleAction(), rewriteTargetListIU(), rewriteTargetView(), ri_CheckTrigger(), ri_FetchConstraintInfo(), RI_FKey_check(), RI_Initial_Check(), ri_PerformCheck(), ri_ReportViolation(), rollback_prepared_cb_wrapper(), RollbackToSavepoint(), rpad(), run_ssl_passphrase_command(), sanity_check_relation(), sanity_check_tid_array(), SanityCheckBackgroundWorker(), satisfies_hash_partition(), SaveSlotToPath(), scanint8(), scanNameSpaceForRefname(), scanNameSpaceForRelid(), scanNSItemForColumn(), scanRTEForColumn(), scram_verify_plain_password(), secure_open_gssapi(), secure_read(), secure_write(), select_common_collation(), select_common_type(), select_common_type_from_oids(), select_perl_context(), SendBackupManifest(), sendDir(), sendFile(), SendFunctionResult(), sendTablespace(), SendTimeLineHistory(), sepgsql_attribute_relabel(), sepgsql_audit_log(), sepgsql_avc_check_perms_label(), sepgsql_avc_init(), sepgsql_avc_unlabeled(), sepgsql_check_perms(), sepgsql_client_auth(), sepgsql_compute_avd(), sepgsql_compute_create(), sepgsql_get_label(), sepgsql_init_client_label(), sepgsql_mcstrans_in(), sepgsql_mcstrans_out(), sepgsql_object_relabel(), sepgsql_relation_relabel(), sepgsql_restorecon(), sepgsql_set_client_label(), sepgsql_utility_command(), serialize_expr_stats(), ServerLoop(), set_authn_id(), set_config_by_name(), set_config_option(), set_max_safe_fds(), set_rot13(), set_var_from_str(), setCompoundAffixFlagValue(), SetDefaultACL(), SetOffsetVacuumLimit(), setPath(), setPathArray(), setPathObject(), SetPossibleUnsafeConflict(), SetRWConflict(), setSchemaName(), setseed(), SetSerializableTransactionSnapshot(), SetSessionAuthorization(), setTargetTable(), SetTransactionIdLimit(), SetTransactionSnapshot(), setup_background_workers(), setup_dynamic_shared_memory(), setup_pct_info(), setup_regexp_matches(), setup_test_matches(), SetUserIdAndContext(), SharedFileSetAttach(), SharedInvalBackendInit(), shdepDropOwned(), shdepLockAndCheckObject(), shdepReassignOwned(), shell_in(), shell_out(), shm_mq_receive(), shm_mq_sendv(), shm_toc_allocate(), shm_toc_insert(), ShmemAlloc(), ShmemAllocUnlocked(), ShmemInitStruct(), show_all_file_settings(), show_debug(), ShutdownXLOG(), SIGHUP_handler(), sigusr1_handler(), similar_escape_internal(), SimpleLruTruncate(), SlabContextCreate(), slot_modify_data(), slot_store_data(), SlruPhysicalReadPage(), SlruReportIOError(), SnapBuildFindSnapshot(), SnapBuildInitialSnapshot(), SnapBuildRestore(), SnapBuildSerialize(), socket_set_nonblocking(), SocketBackend(), sort(), spgadjustmembers(), spgdoinsert(), spgFormInnerTuple(), spgFormNodeTuple(), spgGetCache(), spgvalidate(), SPI_cursor_open_internal(), SPI_sql_row_to_xmlelement(), split_part(), sqrt_var(), ssl_extension_info(), standard_ProcessUtility(), StartAutovacuumWorker(), StartAutoVacWorker(), StartChildProcess(), StartLogicalReplication(), StartReplication(), StartupDecodingContext(), StartupReplicationOrigin(), StartupReplicationSlots(), StartupRequestWalReceiverRestart(), StartupXLOG(), storeOperators(), StorePreparedStatement(), storeProcedures(), StoreRelCheck(), storeRow(), str_initcap(), str_numth(), str_tolower(), str_toupper(), str_udeescape(), stream_abort_cb_wrapper(), stream_change_cb_wrapper(), stream_commit_cb_wrapper(), stream_prepare_cb_wrapper(), stream_start_cb_wrapper(), stream_stop_cb_wrapper(), StreamConnection(), StreamServerPort(), string2ean(), string_to_privilege(), string_to_uuid(), stringToQualifiedNameList(), sts_parallel_scan_next(), sts_read_tuple(), substitute_libpath_macro(), subxact_info_read(), suppress_redundant_updates_trigger(), SV_to_JsonbValue(), SyncDataDirectory(), SyncPostCheckpoint(), SyncRepReleaseWaiters(), SyncRepWaitForLSN(), SysLogger_Start(), SysLoggerMain(), system_beginsamplescan(), system_rows_beginsamplescan(), system_time_beginsamplescan(), table_open(), table_openrv(), table_openrv_extended(), table_tuple_get_latest_tid(), tablesample_init(), tablespace_list_append(), TablespaceCreateDbspace(), tblspc_redo(), TerminateOtherDBBackends(), test_enc_conversion(), test_re_compile(), test_re_execute(), test_shm_mq(), test_shm_mq_main(), test_shm_mq_pipelined(), TestForOldSnapshot_impl(), text_format(), text_format_append_string(), text_format_parse_digits(), text_format_parse_format(), text_format_string_conversion(), text_overlay(), text_position_setup(), text_starts_with(), text_substring(), text_to_bits(), text_to_table(), textarray_to_strvaluelist(), textToQualifiedNameList(), tfuncInitialize(), tfuncLoadRows(), thesaurus_init(), thesaurusRead(), throw_tcl_error(), tidin(), time_part_common(), time_recv(), timestamp2timestamptz_opt_overflow(), timestamp_age(), timestamp_bin(), timestamp_date(), timestamp_in(), timestamp_izone(), timestamp_mi(), timestamp_out(), timestamp_part_common(), timestamp_pl_interval(), timestamp_recv(), timestamp_time(), timestamp_to_char(), timestamp_trunc(), timestamp_zone(), timestamptz2timestamp(), timestamptz_age(), timestamptz_bin(), timestamptz_date(), timestamptz_in(), timestamptz_izone(), timestamptz_out(), timestamptz_part_common(), timestamptz_pl_interval(), timestamptz_recv(), timestamptz_time(), timestamptz_timetz(), timestamptz_to_char(), timestamptz_trunc_internal(), timestamptz_trunc_zone(), timestamptz_zone(), timetz_izone(), timetz_part_common(), timetz_recv(), timetz_zone(), tliSwitchPoint(), to_ascii_enc(), to_ascii_encname(), to_date(), to_json(), to_jsonb(), to_regnamespace(), to_regoperator(), to_regrole(), to_timestamp(), tokenize_file(), tokenize_inc_file(), TopologicalSort(), tqueueReceiveSlot(), TransactionIdGetCommitTsData(), TransactionIdInRecentPast(), TransactionIdIsInProgress(), transformAExprNullIf(), transformAggregateCall(), transformAlterTableStmt(), transformArrayExpr(), transformAssignedExpr(), transformAssignmentIndirection(), transformAssignmentSubscripts(), transformCaseExpr(), transformCoalesceExpr(), transformCollateClause(), transformColumnDefinition(), transformColumnNameList(), transformColumnRef(), transformColumnType(), transformConstraintAttrs(), transformContainerSubscripts(), transformCreateStmt(), transformCreateTableAsStmt(), transformDeclareCursorStmt(), transformDistinctClause(), transformDistinctOnClause(), transformExprRecurse(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformFrameOffset(), transformFromClauseItem(), transformGenericOptions(), transformGroupingFunc(), transformGroupingSet(), transformIndexConstraint(), transformIndexStmt(), transformIndirection(), transformInsertRow(), transformInsertStmt(), transformLimitClause(), transformLockingClause(), transformMultiAssignRef(), transformOnConflictArbiter(), transformParamRef(), transformPartitionBound(), transformPartitionBoundValue(), transformPartitionCmd(), transformPartitionRangeBounds(), transformPartitionSpec(), transformPLAssignStmt(), transformRangeFunction(), transformRangeTableFunc(), transformRangeTableSample(), transformRelOptions(), transformReturningList(), transformRuleStmt(), transformSelectStmt(), transformSetOperationStmt(), transformSetOperationTree(), transformStatsStmt(), transformSubLink(), transformTableConstraint(), transformTableLikeClause(), transformTypeCast(), transformUpdateTargetList(), transformValuesClause(), transformWindowDefinitions(), transformWindowFuncCall(), transformWithClause(), transformXmlExpr(), transformXmlSerialize(), translate(), triggered_change_notification(), trim_array(), truncate_check_activity(), truncate_check_rel(), truncate_identifier(), TruncateMultiXact(), try_table_open(), ts_headline_byid_opt(), ts_headline_json_byid_opt(), ts_headline_jsonb_byid_opt(), ts_stat_sql(), tsquery_phrase_distance(), tsquery_rewrite_query(), tsvector_concat(), tsvector_delete_arr(), tsvector_filter(), tsvector_setweight_by_filter(), tsvector_update_trigger(), tsvectorin(), ttdummy(), tuple_data_split(), tuple_data_split_internal(), tupledesc_match(), tuples_equal(), tuplestore_copy_read_pointer(), tuplestore_gettuple(), tuplestore_puttuple_common(), tuplestore_rescan(), tuplestore_select_read_pointer(), TypeCreate(), TypeGetTupleDesc(), typenameType(), typenameTypeMod(), TypeShellMake(), typeStringToTypeName(), unaccent_dict(), unaccent_init(), unicode_norm_form_from_string(), unique_key_recheck(), unistr(), unknown_attribute(), unlink_if_exists_fname(), unlink_initfile(), UnlinkLockFiles(), update_controlfile(), update_metainfo_datafile(), UserAbortTransactionBlock(), utf8_to_iso8859(), utf8_to_win(), UtfToLocal(), uuid_generate_internal(), vac_truncate_clog(), vacuum(), vacuum_is_relation_owner(), vacuum_open_relation(), vacuum_rel(), vacuum_set_xid_limits(), validate_ddl_tags(), validate_option_array_item(), validate_pkattnums(), validate_string_option(), validate_table_rewrite_tags(), validateConnectbyTupleDesc(), validateDomainConstraint(), validateInfiniteBounds(), ValidateJoinEstimator(), ValidatePgVersion(), validateRecoveryParameters(), ValidateRestrictionEstimator(), ValidateXLOGDirectoryStructure(), varbit(), varbit_in(), varbit_recv(), varchar(), varchar_input(), variable_coerce_param_hook(), variable_paramref_hook(), varstr_abbrev_convert(), varstr_cmp(), varstr_levenshtein(), varstrfastcmp_locale(), verify_brin_page(), verify_dictoptions(), verify_hash_page(), verify_heapam(), verify_message(), verify_option_list_length(), VirtualXactLock(), wait_for_workers_to_become_ready(), WaitEventSetWait(), WaitForParallelWorkersToAttach(), WaitForParallelWorkersToExit(), WaitForParallelWorkersToFinish(), WaitXLogInsertionsToFinish(), wal_segment_open(), walkdir(), WalRcvFetchTimeLineHistoryFiles(), WALReadRaiseError(), WalReceiverMain(), WalSndCheckTimeOut(), WalSndSegmentOpen(), widget_in(), width_bucket_array(), width_bucket_float8(), width_bucket_numeric(), win_to_utf8(), window_nth_value(), window_ntile(), worker_spi_launch(), write_auto_conf_file(), write_relcache_init_file(), write_relmap_file(), write_syslogger_file(), WriteControlFile(), writeTimeLineHistory(), writeTimeLineHistoryFile(), X509_NAME_field_to_text(), X509_NAME_to_cstring(), xlog_redo(), XLogArchiveForceDone(), XLogArchiveNotify(), XLogFileClose(), XLogFileCopy(), XLogFileInit(), XLogFileOpen(), XLogFileRead(), XLogFileReadAnyTLI(), XLogPageRead(), XLogPrefetcherFree(), XLogPrefetcherScanRecords(), XlogReadTwoPhaseData(), XLogRestorePoint(), XLogWalRcvWrite(), XLogWrite(), xml_is_document(), xmlcomment(), xmlpi(), XmlTableGetValue(), XmlTableSetColumnFilter(), XmlTableSetNamespace(), XmlTableSetRowFilter(), xmltotext_with_xmloption(), xmlvalidate(), xpath_table(), and xslt_process().

910 {
912  MemoryContext oldcontext;
913 
914  recursion_depth++;
916  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
917 
918  edata->message_id = fmt;
919  EVALUATE_MESSAGE(edata->domain, message, false, true);
920 
921  MemoryContextSwitchTo(oldcontext);
922  recursion_depth--;
923  return 0; /* return value does not matter */
924 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:149
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:828
static int errordata_stack_depth
Definition: elog.c:147
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
const char * message_id
Definition: elog.h:388
struct MemoryContextData * assoc_context
Definition: elog.h:400
const char * domain
Definition: elog.h:379

◆ errmsg_internal()

int errmsg_internal ( const char *  fmt,
  ... 
)

Definition at line 996 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE, MemoryContextSwitchTo(), ErrorData::message_id, and recursion_depth.

Referenced by _bt_get_endpoint(), _bt_insert_parent(), _bt_lock_subtree_parent(), _bt_mark_page_halfdead(), _bt_pagedel(), _bt_split(), _bt_unlink_halfdead_page(), _dosmaperr(), AlterSubscription_refresh(), ApplyLauncherMain(), apw_dump_now(), ATRewriteTable(), auth_peer(), AutoVacLauncherMain(), AutoVacWorkerMain(), BackendInitialize(), BackendRun(), BackendStartup(), BackgroundWorkerStateChange(), before_shmem_exit(), BeginCopyFrom(), brinGetTupleForHeapBlock(), bt_check_every_level(), bt_check_level_from_leftmost(), bt_downlink_missing_check(), bt_recheck_sibling_links(), bt_right_page_check_scankey(), bt_target_page_check(), BTreeTupleGetHeapTIDCareful(), btvacuumpage(), build_attrmap_by_position(), byteaout(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), check_agglevels_and_constraints(), check_default_partition_contents(), check_srf_call_placement(), check_strxfrm_bug(), CheckSCRAMAuth(), ClosePostmasterPorts(), CompactCheckpointerRequestQueue(), create_and_test_bloom(), CreateCheckPoint(), CreateRestartPoint(), dblink_res_error(), DefineIndex(), do_analyze_rel(), do_start_bgworker(), elog_node_display(), enforce_generic_type_consistency(), errstart(), exec_bind_message(), exec_parse_message(), exec_replication_command(), exec_stmt_assert(), exec_stmt_raise(), ExecuteRecoveryCommand(), ExitPostmaster(), ForgetBackgroundWorker(), FreezeMultiXactId(), generateSerialExtraStmts(), get_object_property_data(), GetConnection(), GetErrorContextStack(), GetSafeSnapshot(), HandleAutoVacLauncherInterrupts(), HandleChildCrash(), heap_fetch_toast_slice(), heap_getnext(), heap_prepare_freeze_tuple(), heap_vacuum_rel(), heapam_index_build_range_scan(), heapam_index_validate_scan(), heapam_tuple_lock(), index_build(), info_cb(), InitPostmasterDeathWatchHandle(), InsertOneValue(), inv_seek(), inv_truncate(), IpcSemaphoreInitialize(), llvm_compile_module(), load_dh_buffer(), load_libraries(), logicalrep_worker_launch(), lz4_decompress_datum(), lz4_decompress_datum_slice(), MemoryContextStatsDetail(), MemoryContextStatsInternal(), MemoryContextStatsPrint(), NotNullImpliedByRelConstraints(), on_proc_exit(), on_shmem_exit(), palloc_btree_page(), PerformAuthentication(), pg_GSS_error(), pg_tzenumerate_next(), pgarch_archiveXlog(), pgfdw_report_error(), pglz_decompress_datum(), pglz_decompress_datum_slice(), PGSharedMemoryCreate(), pgwin32_recv(), pgwin32_signal_initialize(), pgwin32_waitforsinglesocket(), PLy_elog_impl(), PLy_output(), pmdie(), PostmasterMain(), PostmasterMarkPIDForWorkerNotify(), processCancelRequest(), ProcessInterrupts(), ProcessSyncRequests(), ProcSleep(), QueuePartitionConstraintValidation(), read_backup_label(), ReadRecord(), reaper(), register_dirty_segment(), RegisterBackgroundWorker(), RemoveXlogFile(), reportDependentObjects(), RestoreArchivedFile(), ReThrowError(), secure_open_server(), setitimer(), SetMultiXactIdLimit(), SetOffsetVacuumLimit(), SetTransactionIdLimit(), ShowTransactionStateRec(), ShowUsage(), SignalSomeChildren(), SlruInternalDeleteSegment(), SnapBuildFindSnapshot(), SocketBackend(), StartupXLOG(), statistic_proc_security_check(), SyncRepInitConfig(), SysLoggerMain(), transformColumnRef(), transformSubLink(), transformWindowFuncCall(), TranslateSocketError(), UpdateMinRecoveryPoint(), validateForeignKeyConstraint(), WalRcvFetchTimeLineHistoryFiles(), WalSndLoop(), XLogWalRcvProcessMsg(), and xml_is_document().

997 {
999  MemoryContext oldcontext;
1000 
1001  recursion_depth++;
1003  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1004 
1005  edata->message_id = fmt;
1006  EVALUATE_MESSAGE(edata->domain, message, false, false);
1007 
1008  MemoryContextSwitchTo(oldcontext);
1009  recursion_depth--;
1010  return 0; /* return value does not matter */
1011 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:149
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:828
static int errordata_stack_depth
Definition: elog.c:147
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
const char * message_id
Definition: elog.h:388
struct MemoryContextData * assoc_context
Definition: elog.h:400
const char * domain
Definition: elog.h:379

◆ errmsg_plural()

int errmsg_plural ( const char *  fmt_singular,
const char *  fmt_plural,
unsigned long  n,
  ... 
)

Definition at line 1019 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, ErrorData::domain, errordata_stack_depth, EVALUATE_MESSAGE_PLURAL, MemoryContextSwitchTo(), ErrorData::message_id, and recursion_depth.

Referenced by AggregateCreate(), CheckpointerMain(), CheckPointTwoPhase(), exec_eval_expr(), ExecInitFunc(), ExecuteCallStmt(), func_select_candidate(), GetNewMultiXactId(), init_sexpr(), logicalrep_report_missing_attrs(), LookupFuncWithArgs(), ParseFuncOrColumn(), perform_base_backup(), pg_promote(), ProcedureCreate(), ReadControlFile(), ReadTwoPhaseFile(), reportDependentObjects(), sendFile(), SetMultiXactIdLimit(), SnapBuildExportSnapshot(), transformPLAssignStmt(), and transformRangeTableSample().

1021 {
1023  MemoryContext oldcontext;
1024 
1025  recursion_depth++;
1027  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1028 
1029  edata->message_id = fmt_singular;
1030  EVALUATE_MESSAGE_PLURAL(edata->domain, message, false);
1031 
1032  MemoryContextSwitchTo(oldcontext);
1033  recursion_depth--;
1034  return 0; /* return value does not matter */
1035 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
static int recursion_depth
Definition: elog.c:149
static int errordata_stack_depth
Definition: elog.c:147
#define EVALUATE_MESSAGE_PLURAL(domain, targetfield, appendval)
Definition: elog.c:864
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
const char * message_id
Definition: elog.h:388
struct MemoryContextData * assoc_context
Definition: elog.h:400
const char * domain
Definition: elog.h:379

◆ error_severity()

static const char * error_severity ( int  elevel)
static

Definition at line 3485 of file elog.c.

References DEBUG1, DEBUG2, DEBUG3, DEBUG4, DEBUG5, ERROR, FATAL, gettext_noop, INFO, LOG, LOG_SERVER_ONLY, NOTICE, PANIC, WARNING, and WARNING_CLIENT_ONLY.

Referenced by send_message_to_frontend(), send_message_to_server_log(), and write_csvlog().

3486 {
3487  const char *prefix;
3488 
3489  switch (elevel)
3490  {
3491  case DEBUG1:
3492  case DEBUG2:
3493  case DEBUG3:
3494  case DEBUG4:
3495  case DEBUG5:
3496  prefix = gettext_noop("DEBUG");
3497  break;
3498  case LOG:
3499  case LOG_SERVER_ONLY:
3500  prefix = gettext_noop("LOG");
3501  break;
3502  case INFO:
3503  prefix = gettext_noop("INFO");
3504  break;
3505  case NOTICE:
3506  prefix = gettext_noop("NOTICE");
3507  break;
3508  case WARNING:
3509  case WARNING_CLIENT_ONLY:
3510  prefix = gettext_noop("WARNING");
3511  break;
3512  case ERROR:
3513  prefix = gettext_noop("ERROR");
3514  break;
3515  case FATAL:
3516  prefix = gettext_noop("FATAL");
3517  break;
3518  case PANIC:
3519  prefix = gettext_noop("PANIC");
3520  break;
3521  default:
3522  prefix = "???";
3523  break;
3524  }
3525 
3526  return prefix;
3527 }
#define LOG_SERVER_ONLY
Definition: elog.h:28
#define DEBUG1
Definition: elog.h:25
#define DEBUG3
Definition: elog.h:23
#define gettext_noop(x)
Definition: c.h:1197
#define INFO
Definition: elog.h:33
#define LOG
Definition: elog.h:26
#define DEBUG4
Definition: elog.h:22
#define PANIC
Definition: elog.h:50
#define ERROR
Definition: elog.h:46
#define WARNING_CLIENT_ONLY
Definition: elog.h:44
#define FATAL
Definition: elog.h:49
#define DEBUG2
Definition: elog.h:24
#define WARNING
Definition: elog.h:40
static int elevel
Definition: vacuumlazy.c:400
#define NOTICE
Definition: elog.h:37
#define DEBUG5
Definition: elog.h:20

◆ errposition()

int errposition ( int  cursorpos)

Definition at line 1285 of file elog.c.

References CHECK_STACK_DEPTH, ErrorData::cursorpos, and errordata_stack_depth.

Referenced by _SPI_error_callback(), executor_errposition(), function_parse_error_transpose(), import_error_callback(), parser_errposition(), sql_exec_error_callback(), and sql_inline_error_callback().

1286 {
1288 
1289  /* we don't bother incrementing recursion_depth */
1291 
1292  edata->cursorpos = cursorpos;
1293 
1294  return 0; /* return value does not matter */
1295 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
int cursorpos
Definition: elog.h:394
static int errordata_stack_depth
Definition: elog.c:147
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145

◆ errstart()

bool errstart ( int  elevel,
const char *  domain 
)

Definition at line 340 of file elog.c.

References ErrorData::assoc_context, ErrorData::context_domain, CritSectionCount, debug_query_string, ErrorData::domain, ErrorData::elevel, elevel, ereport, errmsg_internal(), ERROR, ErrorContext, errordata_stack_depth, ERRORDATA_STACK_SIZE, ExitOnAnyError, FATAL, i, in_error_recursion_trouble(), Max, MemoryContextReset(), MemSet, ErrorData::output_to_client, ErrorData::output_to_server, PANIC, PG_exception_stack, PG_TEXTDOMAIN, proc_exit_inprogress, recursion_depth, ErrorData::saved_errno, should_output_to_client(), should_output_to_server(), ErrorData::sqlerrcode, WARNING, and write_stderr().

Referenced by errstart_cold(), and ThrowErrorData().

341 {
342  ErrorData *edata;
343  bool output_to_server;
344  bool output_to_client = false;
345  int i;
346 
347  /*
348  * Check some cases in which we want to promote an error into a more
349  * severe error. None of this logic applies for non-error messages.
350  */
351  if (elevel >= ERROR)
352  {
353  /*
354  * If we are inside a critical section, all errors become PANIC
355  * errors. See miscadmin.h.
356  */
357  if (CritSectionCount > 0)
358  elevel = PANIC;
359 
360  /*
361  * Check reasons for treating ERROR as FATAL:
362  *
363  * 1. we have no handler to pass the error to (implies we are in the
364  * postmaster or in backend startup).
365  *
366  * 2. ExitOnAnyError mode switch is set (initdb uses this).
367  *
368  * 3. the error occurred after proc_exit has begun to run. (It's
369  * proc_exit's responsibility to see that this doesn't turn into
370  * infinite recursion!)
371  */
372  if (elevel == ERROR)
373  {
374  if (PG_exception_stack == NULL ||
375  ExitOnAnyError ||
377  elevel = FATAL;
378  }
379 
380  /*
381  * If the error level is ERROR or more, errfinish is not going to
382  * return to caller; therefore, if there is any stacked error already
383  * in progress it will be lost. This is more or less okay, except we
384  * do not want to have a FATAL or PANIC error downgraded because the
385  * reporting process was interrupted by a lower-grade error. So check
386  * the stack and make sure we panic if panic is warranted.
387  */
388  for (i = 0; i <= errordata_stack_depth; i++)
390  }
391 
392  /*
393  * Now decide whether we need to process this report at all; if it's
394  * warning or less and not enabled for logging, just return false without
395  * starting up any error logging machinery.
396  */
397  output_to_server = should_output_to_server(elevel);
398  output_to_client = should_output_to_client(elevel);
399  if (elevel < ERROR && !output_to_server && !output_to_client)
400  return false;
401 
402  /*
403  * We need to do some actual work. Make sure that memory context
404  * initialization has finished, else we can't do anything useful.
405  */
406  if (ErrorContext == NULL)
407  {
408  /* Oops, hard crash time; very little we can do safely here */
409  write_stderr("error occurred before error message processing is available\n");
410  exit(2);
411  }
412 
413  /*
414  * Okay, crank up a stack entry to store the info in.
415  */
416 
417  if (recursion_depth++ > 0 && elevel >= ERROR)
418  {
419  /*
420  * Oops, error during error processing. Clear ErrorContext as
421  * discussed at top of file. We will not return to the original
422  * error's reporter or handler, so we don't need it.
423  */
425 
426  /*
427  * Infinite error recursion might be due to something broken in a
428  * context traceback routine. Abandon them too. We also abandon
429  * attempting to print the error statement (which, if long, could
430  * itself be the source of the recursive failure).
431  */
433  {
434  error_context_stack = NULL;
435  debug_query_string = NULL;
436  }
437  }
439  {
440  /*
441  * Wups, stack not big enough. We treat this as a PANIC condition
442  * because it suggests an infinite loop of errors during error
443  * recovery.
444  */
445  errordata_stack_depth = -1; /* make room on stack */
446  ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded")));
447  }
448 
449  /* Initialize data for this error frame */
451  MemSet(edata, 0, sizeof(ErrorData));
452  edata->elevel = elevel;
453  edata->output_to_server = output_to_server;
454  edata->output_to_client = output_to_client;
455  /* the default text domain is the backend's */
456  edata->domain = domain ? domain : PG_TEXTDOMAIN("postgres");
457  /* initialize context_domain the same way (see set_errcontext_domain()) */
458  edata->context_domain = edata->domain;
459  /* Select default errcode based on elevel */
460  if (elevel >= ERROR)
461  edata->sqlerrcode = ERRCODE_INTERNAL_ERROR;
462  else if (elevel >= WARNING)
463  edata->sqlerrcode = ERRCODE_WARNING;
464  else
465  edata->sqlerrcode = ERRCODE_SUCCESSFUL_COMPLETION;
466  /* errno is saved here so that error parameter eval can't change it */
467  edata->saved_errno = errno;
468 
469  /*
470  * Any allocations for this error state level should go into ErrorContext
471  */
472  edata->assoc_context = ErrorContext;
473 
474  recursion_depth--;
475  return true;
476 }
MemoryContext ErrorContext
Definition: mcxt.c:49
int sqlerrcode
Definition: elog.h:381
#define ERRORDATA_STACK_SIZE
Definition: elog.c:143
static int recursion_depth
Definition: elog.c:149
#define MemSet(start, val, len)
Definition: c.h:1008
void MemoryContextReset(MemoryContext context)
Definition: mcxt.c:143
#define PANIC
Definition: elog.h:50
ErrorContextCallback * error_context_stack
Definition: elog.c:93
const char * context_domain
Definition: elog.h:380
static int errordata_stack_depth
Definition: elog.c:147
#define ERROR
Definition: elog.h:46
#define FATAL
Definition: elog.h:49
bool output_to_server
Definition: elog.h:372
int saved_errno
Definition: elog.h:397
volatile uint32 CritSectionCount
Definition: globals.c:41
#define WARNING
Definition: elog.h:40
const char * debug_query_string
Definition: postgres.c:89
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
static bool should_output_to_client(int elevel)
Definition: elog.c:242
int elevel
Definition: elog.h:371
static int elevel
Definition: vacuumlazy.c:400
bool ExitOnAnyError
Definition: globals.c:116
#define PG_TEXTDOMAIN(domain)
Definition: c.h:1215
#define ereport(elevel,...)
Definition: elog.h:157
bool in_error_recursion_trouble(void)
Definition: elog.c:291
int errmsg_internal(const char *fmt,...)
Definition: elog.c:996
#define Max(x, y)
Definition: c.h:980
void write_stderr(const char *fmt,...)
Definition: elog.c:3556
bool proc_exit_inprogress
Definition: ipc.c:40
static bool should_output_to_server(int elevel)
Definition: elog.c:233
struct MemoryContextData * assoc_context
Definition: elog.h:400
sigjmp_buf * PG_exception_stack
Definition: elog.c:95
int i
const char * domain
Definition: elog.h:379
bool output_to_client
Definition: elog.h:373

◆ errstart_cold()

pg_attribute_cold bool errstart_cold ( int  elevel,
const char *  domain 
)

Definition at line 324 of file elog.c.

References errstart().

325 {
326  return errstart(elevel, domain);
327 }
bool errstart(int elevel, const char *domain)
Definition: elog.c:340
static int elevel
Definition: vacuumlazy.c:400

◆ FlushErrorState()

void FlushErrorState ( void  )

Definition at line 1654 of file elog.c.

References ErrorContext, errordata_stack_depth, MemoryContextResetAndDeleteChildren, and recursion_depth.

Referenced by AutoVacLauncherMain(), BackgroundWriterMain(), call_bool_check_hook(), call_enum_check_hook(), call_int_check_hook(), call_real_check_hook(), call_string_check_hook(), CheckpointerMain(), do_autovacuum(), exec_stmt_block(), GetConnection(), initTrie(), perform_work_item(), plperl_return_next(), plperl_spi_commit(), plperl_spi_exec(), plperl_spi_exec_prepared(), plperl_spi_fetchrow(), plperl_spi_prepare(), plperl_spi_query(), plperl_spi_query_prepared(), plperl_spi_rollback(), plperl_util_elog(), pltcl_commit(), pltcl_elog(), pltcl_rollback(), pltcl_subtrans_abort(), PLy_output(), PLy_spi_subtransaction_abort(), PostgresMain(), ReorderBufferProcessTXN(), WalWriterMain(), xml_is_document(), and xpath_exists().

1655 {
1656  /*
1657  * Reset stack to empty. The only case where it would be more than one
1658  * deep is if we serviced an error that interrupted construction of
1659  * another message. We assume control escaped out of that message
1660  * construction and won't ever go back.
1661  */
1662  errordata_stack_depth = -1;
1663  recursion_depth = 0;
1664  /* Delete all data in ErrorContext */
1666 }
MemoryContext ErrorContext
Definition: mcxt.c:49
static int recursion_depth
Definition: elog.c:149
static int errordata_stack_depth
Definition: elog.c:147
#define MemoryContextResetAndDeleteChildren(ctx)
Definition: memutils.h:67

◆ format_elog_string()

char* format_elog_string ( const char *  fmt,
  ... 
)

Definition at line 1476 of file elog.c.

References ErrorData::domain, ErrorContext, EVALUATE_MESSAGE, MemoryContextSwitchTo(), MemSet, ErrorData::message, ErrorData::message_id, PG_TEXTDOMAIN, save_format_domain, save_format_errnumber, and ErrorData::saved_errno.

1477 {
1478  ErrorData errdata;
1479  ErrorData *edata;
1480  MemoryContext oldcontext;
1481 
1482  /* Initialize a mostly-dummy error frame */
1483  edata = &errdata;
1484  MemSet(edata, 0, sizeof(ErrorData));
1485  /* the default text domain is the backend's */
1486  edata->domain = save_format_domain ? save_format_domain : PG_TEXTDOMAIN("postgres");
1487  /* set the errno to be used to interpret %m */
1489 
1490  oldcontext = MemoryContextSwitchTo(ErrorContext);
1491 
1492  edata->message_id = fmt;
1493  EVALUATE_MESSAGE(edata->domain, message, false, true);
1494 
1495  MemoryContextSwitchTo(oldcontext);
1496 
1497  return edata->message;
1498 }
MemoryContext ErrorContext
Definition: mcxt.c:49
static int save_format_errnumber
Definition: elog.c:1463
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
#define MemSet(start, val, len)
Definition: c.h:1008
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:828
int saved_errno
Definition: elog.h:397
#define PG_TEXTDOMAIN(domain)
Definition: c.h:1215
const char * message_id
Definition: elog.h:388
static const char * save_format_domain
Definition: elog.c:1464
const char * domain
Definition: elog.h:379
char * message
Definition: elog.h:382

◆ FreeErrorData()

void FreeErrorData ( ErrorData edata)

Definition at line 1616 of file elog.c.

References ErrorData::backtrace, ErrorData::column_name, ErrorData::constraint_name, ErrorData::context, ErrorData::datatype_name, ErrorData::detail, ErrorData::detail_log, ErrorData::hint, ErrorData::internalquery, ErrorData::message, pfree(), ErrorData::schema_name, and ErrorData::table_name.

Referenced by GetConnection(), pltcl_commit(), pltcl_elog(), pltcl_rollback(), pltcl_subtrans_abort(), PLy_output(), PLy_spi_subtransaction_abort(), and ReorderBufferProcessTXN().

1617 {
1618  if (edata->message)
1619  pfree(edata->message);
1620  if (edata->detail)
1621  pfree(edata->detail);
1622  if (edata->detail_log)
1623  pfree(edata->detail_log);
1624  if (edata->hint)
1625  pfree(edata->hint);
1626  if (edata->context)
1627  pfree(edata->context);
1628  if (edata->backtrace)
1629  pfree(edata->backtrace);
1630  if (edata->schema_name)
1631  pfree(edata->schema_name);
1632  if (edata->table_name)
1633  pfree(edata->table_name);
1634  if (edata->column_name)
1635  pfree(edata->column_name);
1636  if (edata->datatype_name)
1637  pfree(edata->datatype_name);
1638  if (edata->constraint_name)
1639  pfree(edata->constraint_name);
1640  if (edata->internalquery)
1641  pfree(edata->internalquery);
1642  pfree(edata);
1643 }
char * schema_name
Definition: elog.h:389
char * internalquery
Definition: elog.h:396
void pfree(void *pointer)
Definition: mcxt.c:1169
char * detail_log
Definition: elog.h:384
char * table_name
Definition: elog.h:390
char * backtrace
Definition: elog.h:387
char * datatype_name
Definition: elog.h:392
char * detail
Definition: elog.h:383
char * column_name
Definition: elog.h:391
char * hint
Definition: elog.h:385
char * context
Definition: elog.h:386
char * constraint_name
Definition: elog.h:393
char * message
Definition: elog.h:382

◆ geterrcode()

int geterrcode ( void  )

Definition at line 1400 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::sqlerrcode.

Referenced by pcb_error_callback().

1401 {
1403 
1404  /* we don't bother incrementing recursion_depth */
1406 
1407  return edata->sqlerrcode;
1408 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
int sqlerrcode
Definition: elog.h:381
static int errordata_stack_depth
Definition: elog.c:147
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145

◆ GetErrorContextStack()

char* GetErrorContextStack ( void  )

Definition at line 1855 of file elog.c.

References ErrorContextCallback::arg, ErrorData::assoc_context, ErrorContextCallback::callback, ErrorData::context, CurrentMemoryContext, ereport, errmsg_internal(), errordata_stack_depth, ERRORDATA_STACK_SIZE, MemSet, PANIC, ErrorContextCallback::previous, and recursion_depth.

Referenced by exec_stmt_getdiag().

1856 {
1857  ErrorData *edata;
1858  ErrorContextCallback *econtext;
1859 
1860  /*
1861  * Okay, crank up a stack entry to store the info in.
1862  */
1863  recursion_depth++;
1864 
1866  {
1867  /*
1868  * Wups, stack not big enough. We treat this as a PANIC condition
1869  * because it suggests an infinite loop of errors during error
1870  * recovery.
1871  */
1872  errordata_stack_depth = -1; /* make room on stack */
1873  ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded")));
1874  }
1875 
1876  /*
1877  * Things look good so far, so initialize our error frame
1878  */
1879  edata = &errordata[errordata_stack_depth];
1880  MemSet(edata, 0, sizeof(ErrorData));
1881 
1882  /*
1883  * Set up assoc_context to be the caller's context, so any allocations
1884  * done (which will include edata->context) will use their context.
1885  */
1887 
1888  /*
1889  * Call any context callback functions to collect the context information
1890  * into edata->context.
1891  *
1892  * Errors occurring in callback functions should go through the regular
1893  * error handling code which should handle any recursive errors, though we
1894  * double-check above, just in case.
1895  */
1896  for (econtext = error_context_stack;
1897  econtext != NULL;
1898  econtext = econtext->previous)
1899  econtext->callback(econtext->arg);
1900 
1901  /*
1902  * Clean ourselves off the stack, any allocations done should have been
1903  * using edata->assoc_context, which we set up earlier to be the caller's
1904  * context, so we're free to just remove our entry off the stack and
1905  * decrement recursion depth and exit.
1906  */
1908  recursion_depth--;
1909 
1910  /*
1911  * Return a pointer to the string the caller asked for, which should have
1912  * been allocated in their context.
1913  */
1914  return edata->context;
1915 }
#define ERRORDATA_STACK_SIZE
Definition: elog.c:143
static int recursion_depth
Definition: elog.c:149
#define MemSet(start, val, len)
Definition: c.h:1008
void(* callback)(void *arg)
Definition: elog.h:247
struct ErrorContextCallback * previous
Definition: elog.h:246
#define PANIC
Definition: elog.h:50
ErrorContextCallback * error_context_stack
Definition: elog.c:93
static int errordata_stack_depth
Definition: elog.c:147
MemoryContext CurrentMemoryContext
Definition: mcxt.c:42
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
#define ereport(elevel,...)
Definition: elog.h:157
int errmsg_internal(const char *fmt,...)
Definition: elog.c:996
char * context
Definition: elog.h:386
struct MemoryContextData * assoc_context
Definition: elog.h:400

◆ geterrposition()

int geterrposition ( void  )

Definition at line 1417 of file elog.c.

References CHECK_STACK_DEPTH, ErrorData::cursorpos, and errordata_stack_depth.

Referenced by _SPI_error_callback(), function_parse_error_transpose(), import_error_callback(), sql_exec_error_callback(), and sql_inline_error_callback().

1418 {
1420 
1421  /* we don't bother incrementing recursion_depth */
1423 
1424  return edata->cursorpos;
1425 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
int cursorpos
Definition: elog.h:394
static int errordata_stack_depth
Definition: elog.c:147
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145

◆ getinternalerrposition()

int getinternalerrposition ( void  )

Definition at line 1434 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::internalpos.

Referenced by function_parse_error_transpose().

1435 {
1437 
1438  /* we don't bother incrementing recursion_depth */
1440 
1441  return edata->internalpos;
1442 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static int errordata_stack_depth
Definition: elog.c:147
int internalpos
Definition: elog.h:395
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145

◆ in_error_recursion_trouble()

bool in_error_recursion_trouble ( void  )

Definition at line 291 of file elog.c.

References recursion_depth.

Referenced by DebugFileOpen(), err_gettext(), err_sendstring(), errstart(), pgfdw_subxact_callback(), pgfdw_xact_callback(), and write_console().

292 {
293  /* Pull the plug if recurse more than once */
294  return (recursion_depth > 2);
295 }
static int recursion_depth
Definition: elog.c:149

◆ internalerrposition()

int internalerrposition ( int  cursorpos)

Definition at line 1301 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::internalpos.

Referenced by _SPI_error_callback(), function_parse_error_transpose(), import_error_callback(), plpgsql_scanner_errposition(), PLy_elog_impl(), sql_exec_error_callback(), and sql_inline_error_callback().

1302 {
1304 
1305  /* we don't bother incrementing recursion_depth */
1307 
1308  edata->internalpos = cursorpos;
1309 
1310  return 0; /* return value does not matter */
1311 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static int errordata_stack_depth
Definition: elog.c:147
int internalpos
Definition: elog.h:395
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145

◆ internalerrquery()

int internalerrquery ( const char *  query)

Definition at line 1321 of file elog.c.

References ErrorData::assoc_context, CHECK_STACK_DEPTH, errordata_stack_depth, ErrorData::internalquery, MemoryContextStrdup(), and pfree().

Referenced by _SPI_error_callback(), function_parse_error_transpose(), import_error_callback(), plpgsql_scanner_errposition(), PLy_elog_impl(), sql_exec_error_callback(), and sql_inline_error_callback().

1322 {
1324 
1325  /* we don't bother incrementing recursion_depth */
1327 
1328  if (edata->internalquery)
1329  {
1330  pfree(edata->internalquery);
1331  edata->internalquery = NULL;
1332  }
1333 
1334  if (query)
1335  edata->internalquery = MemoryContextStrdup(edata->assoc_context, query);
1336 
1337  return 0; /* return value does not matter */
1338 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
char * internalquery
Definition: elog.h:396
void pfree(void *pointer)
Definition: mcxt.c:1169
static int errordata_stack_depth
Definition: elog.c:147
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
struct MemoryContextData * assoc_context
Definition: elog.h:400
char * MemoryContextStrdup(MemoryContext context, const char *string)
Definition: mcxt.c:1286

◆ is_log_level_output()

static bool is_log_level_output ( int  elevel,
int  log_min_level 
)
inlinestatic

Definition at line 199 of file elog.c.

References ERROR, FATAL, LOG, LOG_SERVER_ONLY, and WARNING_CLIENT_ONLY.

Referenced by send_message_to_server_log(), should_output_to_server(), and write_csvlog().

200 {
201  if (elevel == LOG || elevel == LOG_SERVER_ONLY)
202  {
203  if (log_min_level == LOG || log_min_level <= ERROR)
204  return true;
205  }
206  else if (elevel == WARNING_CLIENT_ONLY)
207  {
208  /* never sent to log, regardless of log_min_level */
209  return false;
210  }
211  else if (log_min_level == LOG)
212  {
213  /* elevel != LOG */
214  if (elevel >= FATAL)
215  return true;
216  }
217  /* Neither is LOG */
218  else if (elevel >= log_min_level)
219  return true;
220 
221  return false;
222 }
#define LOG_SERVER_ONLY
Definition: elog.h:28
#define LOG
Definition: elog.h:26
#define ERROR
Definition: elog.h:46
#define WARNING_CLIENT_ONLY
Definition: elog.h:44
#define FATAL
Definition: elog.h:49
static int elevel
Definition: vacuumlazy.c:400

◆ log_line_prefix()

static void log_line_prefix ( StringInfo  buf,
ErrorData edata 
)
static

Definition at line 2380 of file elog.c.

References _, appendBinaryStringInfo(), appendStringInfo(), appendStringInfoChar(), appendStringInfoSpaces(), appendStringInfoString(), application_name, B_BG_WORKER, PGPROC::backendId, BackgroundWorker::bgw_type, Port::database_name, dbname, formatted_log_time, formatted_start_time, get_ps_display(), GetBackendTypeDesc(), gettimeofday(), GetTopTransactionIdIfAny(), InvalidBackendId, PGPROC::lockGroupLeader, Log_line_prefix, log_timezone, PGPROC::lxid, MyBackendType, MyBgworkerEntry, MyProc, MyProcPid, MyProcPort, MyStartTime, pfree(), pg_localtime(), pg_strftime(), pgstat_get_my_query_id(), PGPROC::pid, PostmasterPid, process_log_prefix_padding(), psprintf(), Port::remote_host, Port::remote_port, saved_timeval, saved_timeval_set, setup_formatted_log_time(), setup_formatted_start_time(), snprintf, ErrorData::sqlerrcode, unpack_sql_state(), Port::user_name, and username.

Referenced by send_message_to_server_log().

2381 {
2382  /* static counter for line numbers */
2383  static long log_line_number = 0;
2384 
2385  /* has counter been reset in current process? */
2386  static int log_my_pid = 0;
2387  int padding;
2388  const char *p;
2389 
2390  /*
2391  * This is one of the few places where we'd rather not inherit a static
2392  * variable's value from the postmaster. But since we will, reset it when
2393  * MyProcPid changes. MyStartTime also changes when MyProcPid does, so
2394  * reset the formatted start timestamp too.
2395  */
2396  if (log_my_pid != MyProcPid)
2397  {
2398  log_line_number = 0;
2399  log_my_pid = MyProcPid;
2400  formatted_start_time[0] = '\0';
2401  }
2402  log_line_number++;
2403 
2404  if (Log_line_prefix == NULL)
2405  return; /* in case guc hasn't run yet */
2406 
2407  for (p = Log_line_prefix; *p != '\0'; p++)
2408  {
2409  if (*p != '%')
2410  {
2411  /* literal char, just copy */
2412  appendStringInfoChar(buf, *p);
2413  continue;
2414  }
2415 
2416  /* must be a '%', so skip to the next char */
2417  p++;
2418  if (*p == '\0')
2419  break; /* format error - ignore it */
2420  else if (*p == '%')
2421  {
2422  /* string contains %% */
2423  appendStringInfoChar(buf, '%');
2424  continue;
2425  }
2426 
2427 
2428  /*
2429  * Process any formatting which may exist after the '%'. Note that
2430  * process_log_prefix_padding moves p past the padding number if it
2431  * exists.
2432  *
2433  * Note: Since only '-', '0' to '9' are valid formatting characters we
2434  * can do a quick check here to pre-check for formatting. If the char
2435  * is not formatting then we can skip a useless function call.
2436  *
2437  * Further note: At least on some platforms, passing %*s rather than
2438  * %s to appendStringInfo() is substantially slower, so many of the
2439  * cases below avoid doing that unless non-zero padding is in fact
2440  * specified.
2441  */
2442  if (*p > '9')
2443  padding = 0;
2444  else if ((p = process_log_prefix_padding(p, &padding)) == NULL)
2445  break;
2446 
2447  /* process the option */
2448  switch (*p)
2449  {
2450  case 'a':
2451  if (MyProcPort)
2452  {
2453  const char *appname = application_name;
2454 
2455  if (appname == NULL || *appname == '\0')
2456  appname = _("[unknown]");
2457  if (padding != 0)
2458  appendStringInfo(buf, "%*s", padding, appname);
2459  else
2460  appendStringInfoString(buf, appname);
2461  }
2462  else if (padding != 0)
2464  padding > 0 ? padding : -padding);
2465 
2466  break;
2467  case 'b':
2468  {
2469  const char *backend_type_str;
2470 
2471  if (MyProcPid == PostmasterPid)
2472  backend_type_str = "postmaster";
2473  else if (MyBackendType == B_BG_WORKER)
2474  backend_type_str = MyBgworkerEntry->bgw_type;
2475  else
2476  backend_type_str = GetBackendTypeDesc(MyBackendType);
2477 
2478  if (padding != 0)
2479  appendStringInfo(buf, "%*s", padding, backend_type_str);
2480  else
2481  appendStringInfoString(buf, backend_type_str);
2482  break;
2483  }
2484  case 'u':
2485  if (MyProcPort)
2486  {
2487  const char *username = MyProcPort->user_name;
2488 
2489  if (username == NULL || *username == '\0')
2490  username = _("[unknown]");
2491  if (padding != 0)
2492  appendStringInfo(buf, "%*s", padding, username);
2493  else
2494  appendStringInfoString(buf, username);
2495  }
2496  else if (padding != 0)
2498  padding > 0 ? padding : -padding);
2499  break;
2500  case 'd':
2501  if (MyProcPort)
2502  {
2503  const char *dbname = MyProcPort->database_name;
2504 
2505  if (dbname == NULL || *dbname == '\0')
2506  dbname = _("[unknown]");
2507  if (padding != 0)
2508  appendStringInfo(buf, "%*s", padding, dbname);
2509  else
2510  appendStringInfoString(buf, dbname);
2511  }
2512  else if (padding != 0)
2514  padding > 0 ? padding : -padding);
2515  break;
2516  case 'c':
2517  if (padding != 0)
2518  {
2519  char strfbuf[128];
2520 
2521  snprintf(strfbuf, sizeof(strfbuf) - 1, "%lx.%x",
2522  (long) (MyStartTime), MyProcPid);
2523  appendStringInfo(buf, "%*s", padding, strfbuf);
2524  }
2525  else
2526  appendStringInfo(buf, "%lx.%x", (long) (MyStartTime), MyProcPid);
2527  break;
2528  case 'p':
2529  if (padding != 0)
2530  appendStringInfo(buf, "%*d", padding, MyProcPid);
2531  else
2532  appendStringInfo(buf, "%d", MyProcPid);
2533  break;
2534 
2535  case 'P':
2536  if (MyProc)
2537  {
2538  PGPROC *leader = MyProc->lockGroupLeader;
2539 
2540  /*
2541  * Show the leader only for active parallel workers. This
2542  * leaves out the leader of a parallel group.
2543  */
2544  if (leader == NULL || leader->pid == MyProcPid)
2546  padding > 0 ? padding : -padding);
2547  else if (padding != 0)
2548  appendStringInfo(buf, "%*d", padding, leader->pid);
2549  else
2550  appendStringInfo(buf, "%d", leader->pid);
2551  }
2552  else if (padding != 0)
2554  padding > 0 ? padding : -padding);
2555  break;
2556 
2557  case 'l':
2558  if (padding != 0)
2559  appendStringInfo(buf, "%*ld", padding, log_line_number);
2560  else
2561  appendStringInfo(buf, "%ld", log_line_number);
2562  break;
2563  case 'm':
2565  if (padding != 0)
2566  appendStringInfo(buf, "%*s", padding, formatted_log_time);
2567  else
2569  break;
2570  case 't':
2571  {
2572  pg_time_t stamp_time = (pg_time_t) time(NULL);
2573  char strfbuf[128];
2574 
2575  pg_strftime(strfbuf, sizeof(strfbuf),
2576  "%Y-%m-%d %H:%M:%S %Z",
2577  pg_localtime(&stamp_time, log_timezone));
2578  if (padding != 0)
2579  appendStringInfo(buf, "%*s", padding, strfbuf);
2580  else
2581  appendStringInfoString(buf, strfbuf);
2582  }
2583  break;
2584  case 'n':
2585  {
2586  char strfbuf[128];
2587 
2588  if (!saved_timeval_set)
2589  {
2590  gettimeofday(&saved_timeval, NULL);
2591  saved_timeval_set = true;
2592  }
2593 
2594  snprintf(strfbuf, sizeof(strfbuf), "%ld.%03d",
2595  (long) saved_timeval.tv_sec,
2596  (int) (saved_timeval.tv_usec / 1000));
2597 
2598  if (padding != 0)
2599  appendStringInfo(buf, "%*s", padding, strfbuf);
2600  else
2601  appendStringInfoString(buf, strfbuf);
2602  }
2603  break;
2604  case 's':
2605  if (formatted_start_time[0] == '\0')
2607  if (padding != 0)
2608  appendStringInfo(buf, "%*s", padding, formatted_start_time);
2609  else
2611  break;
2612  case 'i':
2613  if (MyProcPort)
2614  {
2615  const char *psdisp;
2616  int displen;
2617 
2618  psdisp = get_ps_display(&displen);
2619  if (padding != 0)
2620  appendStringInfo(buf, "%*s", padding, psdisp);
2621  else
2622  appendBinaryStringInfo(buf, psdisp, displen);
2623 
2624  }
2625  else if (padding != 0)
2627  padding > 0 ? padding : -padding);
2628  break;
2629  case 'r':
2631  {
2632  if (padding != 0)
2633  {
2634  if (MyProcPort->remote_port && MyProcPort->remote_port[0] != '\0')
2635  {
2636  /*
2637  * This option is slightly special as the port
2638  * number may be appended onto the end. Here we
2639  * need to build 1 string which contains the
2640  * remote_host and optionally the remote_port (if
2641  * set) so we can properly align the string.
2642  */
2643 
2644  char *hostport;
2645 
2646  hostport = psprintf("%s(%s)", MyProcPort->remote_host, MyProcPort->remote_port);
2647  appendStringInfo(buf, "%*s", padding, hostport);
2648  pfree(hostport);
2649  }
2650  else
2651  appendStringInfo(buf, "%*s", padding, MyProcPort->remote_host);
2652  }
2653  else
2654  {
2655  /* padding is 0, so we don't need a temp buffer */
2657  if (MyProcPort->remote_port &&
2658  MyProcPort->remote_port[0] != '\0')
2659  appendStringInfo(buf, "(%s)",
2661  }
2662 
2663  }
2664  else if (padding != 0)
2666  padding > 0 ? padding : -padding);
2667  break;
2668  case 'h':
2670  {
2671  if (padding != 0)
2672  appendStringInfo(buf, "%*s", padding, MyProcPort->remote_host);
2673  else
2675  }
2676  else if (padding != 0)
2677