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 errcontext_msg (const char *fmt,...)
 
int set_errcontext_domain (const char *domain)
 
int errhidestmt (bool hide_stmt)
 
int errhidecontext (bool hide_ctx)
 
int errfunction (const char *funcname)
 
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(), CustomizableNextWALFileReady(), dbState(), DeadLockReport(), DefineView(), describeAccessMethods(), describeAggregates(), describeFunctions(), DescribeLockTag(), describeOneTableDetails(), describeOneTSConfig(), describeOneTSParser(), describeOperators(), describePublications(), DescribeQuery(), describeRoles(), describeSubscriptions(), describeTablespaces(), describeTypes(), do_advice(), 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(), 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(), ProcSleep(), 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:1187
static char * buf
Definition: pg_test_fsync.c:68
#define dgettext(d, x)
Definition: c.h:1169
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 834 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 870 of file elog.c.

Referenced by errdetail_log_plural(), errdetail_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 3530 of file elog.c.

References appendStringInfoCharMacro.

Referenced by send_message_to_server_log().

3531 {
3532  char ch;
3533 
3534  while ((ch = *str++) != '\0')
3535  {
3536  appendStringInfoCharMacro(buf, ch);
3537  if (ch == '\n')
3538  appendStringInfoCharMacro(buf, '\t');
3539  }
3540 }
#define appendStringInfoCharMacro(str, ch)
Definition: stringinfo.h:128

◆ appendCSVLiteral()

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

Definition at line 2733 of file elog.c.

References appendStringInfoCharMacro.

Referenced by write_csvlog().

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

◆ CopyErrorData()

ErrorData* CopyErrorData ( void  )

Definition at line 1565 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().

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

◆ DebugFileOpen()

void DebugFileOpen ( void  )

Definition at line 1927 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().

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

◆ EmitErrorReport()

void EmitErrorReport ( void  )

Definition at line 1514 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().

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

◆ err_generic_string()

int err_generic_string ( int  field,
const char *  str 
)

Definition at line 1356 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().

1357 {
1359 
1360  /* we don't bother incrementing recursion_depth */
1362 
1363  switch (field)
1364  {
1365  case PG_DIAG_SCHEMA_NAME:
1366  set_errdata_field(edata->assoc_context, &edata->schema_name, str);
1367  break;
1368  case PG_DIAG_TABLE_NAME:
1369  set_errdata_field(edata->assoc_context, &edata->table_name, str);
1370  break;
1371  case PG_DIAG_COLUMN_NAME:
1372  set_errdata_field(edata->assoc_context, &edata->column_name, str);
1373  break;
1374  case PG_DIAG_DATATYPE_NAME:
1376  break;
1379  break;
1380  default:
1381  elog(ERROR, "unsupported ErrorData field id: %d", field);
1382  break;
1383  }
1384 
1385  return 0; /* return value does not matter */
1386 }
char * schema_name
Definition: elog.h:386
#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:45
char * table_name
Definition: elog.h:387
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
char * datatype_name
Definition: elog.h:389
static void set_errdata_field(MemoryContextData *cxt, char **ptr, const char *str)
Definition: elog.c:1392
#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:388
struct MemoryContextData * assoc_context
Definition: elog.h:397
#define elog(elevel,...)
Definition: elog.h:228
char * constraint_name
Definition: elog.h:390

◆ 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:1168
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 3278 of file elog.c.

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

Referenced by send_message_to_frontend().

3279 {
3281  pq_send_ascii_string(buf, str);
3282  else
3283  pq_sendstring(buf, str);
3284 }
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 937 of file elog.c.

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

938 {
940  MemoryContext oldcontext;
941 
942  recursion_depth++;
944  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
945 
946  set_backtrace(edata, 1);
947 
948  MemoryContextSwitchTo(oldcontext);
949  recursion_depth--;
950 
951  return 0;
952 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static pg_noinline void set_backtrace(ErrorData *edata, int num_skip)
Definition: elog.c:961
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:397

◆ errcode()

int errcode ( int  sqlerrcode)

Definition at line 704 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(), ATExecDropColumn(), ATExecDropConstraint(), ATExecDropExpression(), ATExecDropIdentity(), ATExecDropInherit(), ATExecDropNotNull(), ATExecDropOf(), ATExecGenericOptions(), ATExecReplicaIdentity(), ATExecSetIdentity(), ATExecSetNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetStatistics(), ATExecSetStorage(), ATExecSetTableSpace(), ATExecSetTableSpaceNoStorage(), 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_desummarize_range(), brin_doinsert(), brin_doupdate(), brin_getinsertbuffer(), brin_metapage_info(), 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_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_rolespec_name(), check_safe_enum_use(), 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(), 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(), CopySendEndOfRow(), 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_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(), 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_call(), 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(), ExecBRUpdateTriggers(), ExecBSDeleteTriggers(), ExecBSInsertTriggers(), ExecBSTruncateTriggers(), ExecBSUpdateTriggers(), 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_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_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_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(), GetColumnDefCollation(), GetConfigOption(), GetConfigOptionByName(), GetConfigOptionFlags(), GetConfigOptionResetString(), GetConflictingVirtualXIDs(), GetCurrentTimeUsec(), getdatafield(), GetDefaultOpClass(), GetDefaultTablespace(), GetExtensibleNodeEntry(), GetFdwRoutineByServerId(), getid(), GetIndexAmRoutineByAmId(), getJsonPathVariable(), GetMultiXactIdMembers(), GetNewMultiXactId(), GetNewTransactionId(), getNextFlagFromString(), GetOldFunctionMessage(), 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(), 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(), 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(), 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(), macaddr8_in(), macaddr8tomacaddr(), macaddr_in(), make_absolute_path(), 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(), MarkPortalActive(), MatchText(), materializeResult(), md5_bytea(), md5_text(), mdextend(), mdread(), mdwrite(), MemoryContextAlloc(), MemoryContextAllocExtended(), MemoryContextAllocHuge(), MemoryContextAllocZero(), MemoryContextAllocZeroAligned(), merge_acl_with_grant(), merge_collation_state(), 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_fcall_arguments_20(), 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(), 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(), 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_hba_file_rules(), pg_hex_decode(), pg_import_system_collations(), pg_is_wal_replay_paused(), pg_language_aclmask(), pg_language_ownercheck(), pg_largeobject_aclmask_snapshot(), pg_largeobject_ownercheck(), 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_progress_info(), pg_stat_get_replication_slots(), pg_stat_get_slru(), pg_stat_get_subscription(), pg_stat_get_wal_senders(), 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_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(), 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(), 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(), publicationListToArray(), 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(), ReceiveCopyBegin(), 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(), 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(), 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(), SendCopyBegin(), 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(), 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_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(), time_recv(), timestamp2timestamptz_opt_overflow(), timestamp_age(), timestamp_date(), timestamp_in(), timestamp_izone(), timestamp_mi(), timestamp_out(), timestamp_part(), timestamp_pl_interval(), timestamp_recv(), timestamp_time(), timestamp_to_char(), timestamp_trunc(), timestamp_zone(), timestamptz2timestamp(), timestamptz_age(), timestamptz_date(), timestamptz_in(), timestamptz_izone(), timestamptz_out(), timestamptz_part(), timestamptz_pl_interval(), timestamptz_recv(), timestamptz_time(), timestamptz_timetz(), timestamptz_to_char(), timestamptz_trunc_internal(), timestamptz_trunc_zone(), timestamptz_zone(), timetz_izone(), timetz_part(), 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(), transformSubLink(), transformTableConstraint(), transformTableLikeClause(), transformTypeCast(), transformUpdateTargetList(), transformValuesClause(), transformWindowDefinitions(), transformWindowFuncCall(), transformWithClause(), transformXmlExpr(), transformXmlSerialize(), translate(), triggered_change_notification(), 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(), 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().

705 {
707 
708  /* we don't bother incrementing recursion_depth */
710 
711  edata->sqlerrcode = sqlerrcode;
712 
713  return 0; /* return value does not matter */
714 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
int sqlerrcode
Definition: elog.h:378
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 727 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(), 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().

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

◆ errcode_for_socket_access()

int errcode_for_socket_access ( void  )

Definition at line 798 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_getbyte_if_available(), pq_recvbuf(), ProcessStartupPacket(), ServerLoop(), StreamConnection(), StreamServerPort(), SysLogger_Start(), SysLoggerMain(), and WaitEventSetWait().

799 {
801 
802  /* we don't bother incrementing recursion_depth */
804 
805  switch (edata->saved_errno)
806  {
807  /* Loss of connection */
809  edata->sqlerrcode = ERRCODE_CONNECTION_FAILURE;
810  break;
811 
812  /* All else is classified as internal errors */
813  default:
814  edata->sqlerrcode = ERRCODE_INTERNAL_ERROR;
815  break;
816  }
817 
818  return 0; /* return value does not matter */
819 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
int sqlerrcode
Definition: elog.h:378
static int errordata_stack_depth
Definition: elog.c:147
int saved_errno
Definition: elog.h:394
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 1187 of file elog.c.

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

1188 {
1190  MemoryContext oldcontext;
1191 
1192  recursion_depth++;
1194  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1195 
1196  EVALUATE_MESSAGE(edata->context_domain, context, true, true);
1197 
1198  MemoryContextSwitchTo(oldcontext);
1199  recursion_depth--;
1200  return 0; /* return value does not matter */
1201 }
#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:834
const char * context_domain
Definition: elog.h:377
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:397

◆ errdetail()

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

Definition at line 1048 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(), 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_subset(), dblink_connect(), dblink_connstr_check(), dblink_fdw_validator(), dblink_get_conn(), dblink_security_check(), DefineIndex(), DefineOpClass(), DefineOperator(), DefineRelation(), do_collation_version_check(), DropSubscription(), 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(), ExecBRUpdateTriggers(), ExecCheckPlanOutput(), ExecConstraints(), ExecCrossPartitionUpdate(), ExecEvalArrayExpr(), ExecEvalFieldSelect(), ExecEvalWholeRowVar(), ExecFindPartition(), ExecGrant_Language(), ExecPartitionCheckEmitError(), executeJsonPath(), ExecWithCheckOptions(), ExitPostmaster(), expandTableLikeClause(), fatal_system_new_handler(), FetchDynamicTimeZone(), 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(), 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_cleanup_index(), lc_ctype_is_c(), libpqrcv_identify_system(), libpqrcv_processTuples(), libpqrcv_readtimelinehistoryfile(), LogChildExit(), LogicalRepSyncTableStart(), 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(), 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(), RenameEnumLabel(), RenameRole(), RenameSchema(), RenameTableSpace(), repalloc(), repalloc_huge(), reportDependentObjects(), RestoreArchivedFile(), RewriteQuery(), rewriteTargetListIU(), RI_FKey_check(), RI_Initial_Check(), ri_ReportViolation(), set_max_safe_fds(), SetTransactionSnapshot(), SlabContextCreate(), SlruReportIOError(), SnapBuildFindSnapshot(), SnapBuildRestore(), SPI_cursor_open_internal(), SPI_sql_row_to_xmlelement(), StartLogicalReplication(), StartReplication(), StartupXLOG(), SyncRepWaitForLSN(), 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().

1049 {
1051  MemoryContext oldcontext;
1052 
1053  recursion_depth++;
1055  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1056 
1057  EVALUATE_MESSAGE(edata->domain, detail, false, true);
1058 
1059  MemoryContextSwitchTo(oldcontext);
1060  recursion_depth--;
1061  return 0; /* return value does not matter */
1062 }
#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:834
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:397
const char * domain
Definition: elog.h:376

◆ errdetail_internal()

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

Definition at line 1075 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(), lazy_vacuum_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().

1076 {
1078  MemoryContext oldcontext;
1079 
1080  recursion_depth++;
1082  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1083 
1084  EVALUATE_MESSAGE(edata->domain, detail, false, false);
1085 
1086  MemoryContextSwitchTo(oldcontext);
1087  recursion_depth--;
1088  return 0; /* return value does not matter */
1089 }
#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:834
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:397
const char * domain
Definition: elog.h:376

◆ errdetail_log()

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

Definition at line 1096 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(), and reportDependentObjects().

1097 {
1099  MemoryContext oldcontext;
1100 
1101  recursion_depth++;
1103  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1104 
1105  EVALUATE_MESSAGE(edata->domain, detail_log, false, true);
1106 
1107  MemoryContextSwitchTo(oldcontext);
1108  recursion_depth--;
1109  return 0; /* return value does not matter */
1110 }
#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:834
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:397
const char * domain
Definition: elog.h:376

◆ errdetail_log_plural()

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

Definition at line 1117 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().

1119 {
1121  MemoryContext oldcontext;
1122 
1123  recursion_depth++;
1125  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1126 
1127  EVALUATE_MESSAGE_PLURAL(edata->domain, detail_log, false);
1128 
1129  MemoryContextSwitchTo(oldcontext);
1130  recursion_depth--;
1131  return 0; /* return value does not matter */
1132 }
#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:870
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
struct MemoryContextData * assoc_context
Definition: elog.h:397
const char * domain
Definition: elog.h:376

◆ errdetail_plural()

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

Definition at line 1140 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().

1142 {
1144  MemoryContext oldcontext;
1145 
1146  recursion_depth++;
1148  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1149 
1150  EVALUATE_MESSAGE_PLURAL(edata->domain, detail, false);
1151 
1152  MemoryContextSwitchTo(oldcontext);
1153  recursion_depth--;
1154  return 0; /* return value does not matter */
1155 }
#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:870
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
struct MemoryContextData * assoc_context
Definition: elog.h:397
const char * domain
Definition: elog.h:376

◆ 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, elevel, ErrorData::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, pq_endcopyout, 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  }
533 
534  edata->filename = filename;
535  edata->lineno = lineno;
536  edata->funcname = funcname;
537 
538  elevel = edata->elevel;
539 
540  /*
541  * Do processing in ErrorContext, which we hope has enough reserved space
542  * to report an error.
543  */
544  oldcontext = MemoryContextSwitchTo(ErrorContext);
545 
546  if (!edata->backtrace &&
547  edata->funcname &&
550  set_backtrace(edata, 2);
551 
552  /*
553  * Call any context callback functions. Errors occurring in callback
554  * functions will be treated as recursive errors --- this ensures we will
555  * avoid infinite recursion (see errstart).
556  */
557  for (econtext = error_context_stack;
558  econtext != NULL;
559  econtext = econtext->previous)
560  econtext->callback(econtext->arg);
561 
562  /*
563  * If ERROR (not more nor less) we pass it off to the current handler.
564  * Printing it and popping the stack is the responsibility of the handler.
565  */
566  if (elevel == ERROR)
567  {
568  /*
569  * We do some minimal cleanup before longjmp'ing so that handlers can
570  * execute in a reasonably sane state.
571  *
572  * Reset InterruptHoldoffCount in case we ereport'd from inside an
573  * interrupt holdoff section. (We assume here that no handler will
574  * itself be inside a holdoff section. If necessary, such a handler
575  * could save and restore InterruptHoldoffCount for itself, but this
576  * should make life easier for most.)
577  */
580 
581  CritSectionCount = 0; /* should be unnecessary, but... */
582 
583  /*
584  * Note that we leave CurrentMemoryContext set to ErrorContext. The
585  * handler should reset it to something else soon.
586  */
587 
588  recursion_depth--;
589  PG_RE_THROW();
590  }
591 
592  /*
593  * If we are doing FATAL or PANIC, abort any old-style COPY OUT in
594  * progress, so that we can report the message before dying. (Without
595  * this, pq_putmessage will refuse to send the message at all, which is
596  * what we want for NOTICE messages, but not for fatal exits.) This hack
597  * is necessary because of poor design of old-style copy protocol.
598  */
599  if (elevel >= FATAL && whereToSendOutput == DestRemote)
600  pq_endcopyout(true);
601 
602  /* Emit the message to the right places */
603  EmitErrorReport();
604 
605  /* Now free up subsidiary data attached to stack entry, and release it */
606  if (edata->message)
607  pfree(edata->message);
608  if (edata->detail)
609  pfree(edata->detail);
610  if (edata->detail_log)
611  pfree(edata->detail_log);
612  if (edata->hint)
613  pfree(edata->hint);
614  if (edata->context)
615  pfree(edata->context);
616  if (edata->backtrace)
617  pfree(edata->backtrace);
618  if (edata->schema_name)
619  pfree(edata->schema_name);
620  if (edata->table_name)
621  pfree(edata->table_name);
622  if (edata->column_name)
623  pfree(edata->column_name);
624  if (edata->datatype_name)
625  pfree(edata->datatype_name);
626  if (edata->constraint_name)
627  pfree(edata->constraint_name);
628  if (edata->internalquery)
629  pfree(edata->internalquery);
630 
632 
633  /* Exit error-handling context */
634  MemoryContextSwitchTo(oldcontext);
635  recursion_depth--;
636 
637  /*
638  * Perform error recovery action as specified by elevel.
639  */
640  if (elevel == FATAL)
641  {
642  /*
643  * For a FATAL error, we let proc_exit clean up and exit.
644  *
645  * If we just reported a startup failure, the client will disconnect
646  * on receiving it, so don't send any more to the client.
647  */
650 
651  /*
652  * fflush here is just to improve the odds that we get to see the
653  * error message, in case things are so hosed that proc_exit crashes.
654  * Any other code you might be tempted to add here should probably be
655  * in an on_proc_exit or on_shmem_exit callback instead.
656  */
657  fflush(stdout);
658  fflush(stderr);
659 
660  /*
661  * Let the statistics collector know. Only mark the session as
662  * terminated by fatal error if there is no other known cause.
663  */
666 
667  /*
668  * Do normal process-exit cleanup, then return exit code 1 to indicate
669  * FATAL termination. The postmaster may or may not consider this
670  * worthy of panic, depending on which subprocess returns it.
671  */
672  proc_exit(1);
673  }
674 
675  if (elevel >= PANIC)
676  {
677  /*
678  * Serious crash time. Postmaster will observe SIGABRT process exit
679  * status and kill the other backends too.
680  *
681  * XXX: what if we are *in* the postmaster? abort() won't kill our
682  * children...
683  */
684  fflush(stdout);
685  fflush(stderr);
686  abort();
687  }
688 
689  /*
690  * Check for cancel/die interrupt first --- this is so that the user can
691  * stop a query emitting tons of notice or warning messages, even if it's
692  * in a loop that otherwise fails to check for interrupts.
693  */
695 }
char * schema_name
Definition: elog.h:386
volatile uint32 InterruptHoldoffCount
Definition: globals.c:37
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
MemoryContext ErrorContext
Definition: mcxt.c:45
static pg_noinline void set_backtrace(ErrorData *edata, int num_skip)
Definition: elog.c:961
const char * funcname
Definition: elog.h:375
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
int lineno
Definition: elog.h:374
volatile uint32 QueryCancelHoldoffCount
Definition: globals.c:38
void proc_exit(int code)
Definition: ipc.c:104
static int recursion_depth
Definition: elog.c:149
char * internalquery
Definition: elog.h:393
SessionEndType pgStatSessionEndCause
Definition: pgstat.c:263
void(* callback)(void *arg)
Definition: elog.h:243
struct ErrorContextCallback * previous
Definition: elog.h:242
#define PANIC
Definition: elog.h:55
ErrorContextCallback * error_context_stack
Definition: elog.c:93
void pfree(void *pointer)
Definition: mcxt.c:1057
static int errordata_stack_depth
Definition: elog.c:147
#define ERROR
Definition: elog.h:45
const char * filename
Definition: elog.h:373
char * detail_log
Definition: elog.h:381
#define FATAL
Definition: elog.h:54
Definition: dest.h:89
char * table_name
Definition: elog.h:387
static bool matches_backtrace_functions(const char *funcname)
Definition: elog.c:483
volatile uint32 CritSectionCount
Definition: globals.c:39
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
char * backtrace
Definition: elog.h:384
char * datatype_name
Definition: elog.h:389
int elevel
Definition: elog.h:367
static int elevel
Definition: vacuumlazy.c:333
char * detail
Definition: elog.h:380
void EmitErrorReport(void)
Definition: elog.c:1514
char * column_name
Definition: elog.h:388
char * backtrace_functions
Definition: guc.c:550
char * hint
Definition: elog.h:382
#define pq_endcopyout(errorAbort)
Definition: libpq.h:47
#define PG_RE_THROW()
Definition: elog.h:350
char * context
Definition: elog.h:383
sigjmp_buf * PG_exception_stack
Definition: elog.c:95
static char * filename
Definition: pg_dumpall.c:91
#define CHECK_FOR_INTERRUPTS()
Definition: miscadmin.h:100
CommandDest whereToSendOutput
Definition: postgres.c:92
char * constraint_name
Definition: elog.h:390
char * message
Definition: elog.h:379

◆ errfunction()

int errfunction ( const char *  funcname)

Definition at line 1273 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, ErrorData::funcname, and ErrorData::show_funcname.

1274 {
1276 
1277  /* we don't bother incrementing recursion_depth */
1279 
1280  edata->funcname = funcname;
1281  edata->show_funcname = true;
1282 
1283  return 0; /* return value does not matter */
1284 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
const char * funcname
Definition: elog.h:375
static int errordata_stack_depth
Definition: elog.c:147
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
bool show_funcname
Definition: elog.h:370

◆ errhidecontext()

int errhidecontext ( bool  hide_ctx)

Definition at line 1252 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::hide_ctx.

Referenced by llvm_compile_module().

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

◆ errhidestmt()

int errhidestmt ( bool  hide_stmt)

Definition at line 1233 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(), and llvm_compile_module().

1234 {
1236 
1237  /* we don't bother incrementing recursion_depth */
1239 
1240  edata->hide_stmt = hide_stmt;
1241 
1242  return 0; /* return value does not matter */
1243 }
bool hide_stmt
Definition: elog.h:371
#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 1162 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(), 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(), do_collation_version_check(), do_compile(), do_pg_start_backup(), do_pg_stop_backup(), do_to_timestamp(), DoCopy(), DropErrorMsgWrongType(), DropSubscription(), 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(), 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_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(), RenameType(), ReplicationSlotCreate(), ReplicationSlotValidateName(), replorigin_advance(), replorigin_session_setup(), reportDependentObjects(), 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(), vacuum_set_xid_limits(), ValidatePgVersion(), validateRecoveryParameters(), verify_heapam(), VirtualXactLock(), WaitForParallelWorkersToAttach(), WaitForParallelWorkersToFinish(), worker_spi_launch(), and xml_is_document().

1163 {
1165  MemoryContext oldcontext;
1166 
1167  recursion_depth++;
1169  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1170 
1171  EVALUATE_MESSAGE(edata->domain, hint, false, true);
1172 
1173  MemoryContextSwitchTo(oldcontext);
1174  recursion_depth--;
1175  return 0; /* return value does not matter */
1176 }
#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:834
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:397
const char * domain
Definition: elog.h:376

◆ errmsg()

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

Definition at line 915 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(), _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(), _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(), ApplyLauncherMain(), 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(), ATExecDropColumn(), ATExecDropConstraint(), ATExecDropExpression(), ATExecDropIdentity(), ATExecDropInherit(), ATExecDropNotNull(), ATExecDropOf(), ATExecGenericOptions(), ATExecReplicaIdentity(), ATExecSetIdentity(), ATExecSetNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetStatistics(), ATExecSetStorage(), ATExecSetTableSpace(), ATExecSetTableSpaceNoStorage(), 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(), AutoVacLauncherMain(), AutoVacWorkerMain(), 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_desummarize_range(), brin_doinsert(), brin_doupdate(), brin_getinsertbuffer(), brin_metapage_info(), 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_right_page_check_scankey(), 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_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_rolespec_name(), check_safe_enum_use(), check_same_host_or_net(), 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(), 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(), CompactCheckpointerRequestQueue(), 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_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(), 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_autovacuum(), do_collation_version_check(), do_compile(), do_connect(), 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_call(), 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(), ExecBRUpdateTriggers(), ExecBSDeleteTriggers(), ExecBSInsertTriggers(), ExecBSTruncateTriggers(), ExecBSUpdateTriggers(), 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_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_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(), ForgetBackgroundWorker(), 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_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(), GetColumnDefCollation(), GetConfigOption(), GetConfigOptionByName(), GetConfigOptionFlags(), GetConfigOptionResetString(), GetConflictingVirtualXIDs(), GetCurrentTimeUsec(), getdatafield(), GetDefaultOpClass(), GetDefaultTablespace(), GetExtensibleNodeEntry(), GetFdwRoutineByServerId(), getid(), GetIndexAmRoutineByAmId(), getInstallationPaths(), getJsonPathVariable(), getlen(), GetMultiXactIdMembers(), GetNewMultiXactId(), GetNewTransactionId(), getNextFlagFromString(), GetOldFunctionMessage(), getParamDescriptions(), getRowDescriptions(), 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(), gistdoinsert(), gistfixsplit(), gistSplit(), gistUserPicksplit(), gistvacuumpage(), gistvalidate(), GrantRole(), grouping_planner(), gtsvectorin(), guc_malloc(), guc_realloc(), guc_strdup(), HandleAutoVacLauncherInterrupts(), 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_build(), 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(), 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(), JsonEncodeDateTime(), jsonPathFromCstring(), JsValueToJsObject(), KeepFileRestoredFromArchive(), LargeObjectDrop(), lastval(), lazy_cleanup_index(), lazy_parallel_vacuum_indexes(), lazy_scan_heap(), lazy_truncate_heap(), lazy_vacuum_heap(), lazy_vacuum_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(), llvm_compile_module(), 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(), 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_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(), 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(), 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(), NotNullImpliedByRelConstraints(), 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_fcall_arguments_20(), 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(), 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(), 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_hba_file_rules(), pg_hex_decode(), pg_import_system_collations(), pg_is_wal_replay_paused(), pg_language_aclmask(), pg_language_ownercheck(), pg_largeobject_aclmask_snapshot(), pg_largeobject_ownercheck(), 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_progress_info(), pg_stat_get_replication_slots(), pg_stat_get_slru(), pg_stat_get_subscription(), pg_stat_get_wal_senders(), 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_wal_replay_pause(), pg_wal_replay_resume(), pg_walfile_name(), pg_walfile_name_offset(), pgarch_ArchiverCopyLoop(), pgarch_archiveXlog(), pgarch_start(), 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(), postgresImportForeignSchema(), PostgresMain(), postgresql_fdw_validator(), PostmasterMain(), PostmasterMarkPIDForWorkerNotify(), PostmasterStateMachine(), PostPrepare_Locks(), power_var(), power_var_int(), 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_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(), ProcessRepliesIfAny(), ProcessStandbyMessage(), ProcessStartupPacket(), ProcessSyncRequests(), ProcessTwoPhaseBuffer(), processTypesSpec(), ProcessUtilitySlow(), ProcessWalRcvInterrupts(), ProcSleep(), protect_out_of_mem(), prsd_headline(), prssyntaxerror(), publication_add_relation(), PublicationDropTables(), publicationListToArray(), 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(), QueuePartitionConstraintValidation(), 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(), ReceiveCopyBegin(), 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(), 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(), ReplicationSlotDropPtr(), ReplicationSlotsDropDBSlots(), ReplicationSlotValidateName(), replorigin_advance(), replorigin_by_name(), replorigin_by_oid(), replorigin_check_prerequisites(), replorigin_create(), replorigin_drop(), replorigin_session_reset(), replorigin_session_setup(), report_invalid_encoding(), report_name_conflict(), report_namespace_conflict(), report_untranslatable_char(), reportDependentObjects(), 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_open_server(), secure_read(), secure_write(), select_common_collation(), select_common_type(), select_common_type_from_oids(), select_perl_context(), SendBackupManifest(), SendCopyBegin(), 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(), ServerLoop(), set_config_by_name(), set_config_option(), set_max_safe_fds(), set_rot13(), set_var_from_str(), setCompoundAffixFlagValue(), SetDefaultACL(), SetMultiXactIdLimit(), 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(), SlruInternalDeleteSegment(), SlruPhysicalReadPage(), SlruReportIOError(), SnapBuildFindSnapshot(), SnapBuildInitialSnapshot(), SnapBuildRestore(), SnapBuildSerialize(), socket_endcopyout(), 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(), SyncRepInitConfig(), 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_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(), time_recv(), timestamp2timestamptz_opt_overflow(), timestamp_age(), timestamp_date(), timestamp_in(), timestamp_izone(), timestamp_mi(), timestamp_out(), timestamp_part(), timestamp_pl_interval(), timestamp_recv(), timestamp_time(), timestamp_to_char(), timestamp_trunc(), timestamp_zone(), timestamptz2timestamp(), timestamptz_age(), timestamptz_date(), timestamptz_in(), timestamptz_izone(), timestamptz_out(), timestamptz_part(), timestamptz_pl_interval(), timestamptz_recv(), timestamptz_time(), timestamptz_timetz(), timestamptz_to_char(), timestamptz_trunc_internal(), timestamptz_trunc_zone(), timestamptz_zone(), timetz_izone(), timetz_part(), 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(), transformSubLink(), transformTableConstraint(), transformTableLikeClause(), transformTypeCast(), transformUpdateTargetList(), transformValuesClause(), transformWindowDefinitions(), transformWindowFuncCall(), transformWithClause(), transformXmlExpr(), transformXmlSerialize(), translate(), triggered_change_notification(), 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(), unknown_attribute(), unlink_if_exists_fname(), unlink_initfile(), UnlinkLockFiles(), update_controlfile(), update_metainfo_datafile(), UpdateMinRecoveryPoint(), 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(), validateForeignKeyConstraint(), 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(), WalSndLoop(), 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(), XlogReadTwoPhaseData(), XLogRestorePoint(), XLogWalRcvWrite(), XLogWrite(), xml_is_document(), xmlcomment(), xmlpi(), XmlTableGetValue(), XmlTableSetColumnFilter(), XmlTableSetNamespace(), XmlTableSetRowFilter(), xmltotext_with_xmloption(), xmlvalidate(), xpath_table(), and xslt_process().

916 {
918  MemoryContext oldcontext;
919 
920  recursion_depth++;
922  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
923 
924  edata->message_id = fmt;
925  EVALUATE_MESSAGE(edata->domain, message, false, true);
926 
927  MemoryContextSwitchTo(oldcontext);
928  recursion_depth--;
929  return 0; /* return value does not matter */
930 }
#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:834
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:385
struct MemoryContextData * assoc_context
Definition: elog.h:397
const char * domain
Definition: elog.h:376

◆ errmsg_internal()

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

Definition at line 1002 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(), auth_peer(), BackendInitialize(), BackendRun(), BackendStartup(), before_shmem_exit(), BeginCopyFrom(), brinGetTupleForHeapBlock(), bt_check_every_level(), bt_downlink_missing_check(), 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_srf_call_placement(), check_strxfrm_bug(), CheckSCRAMAuth(), ClosePostmasterPorts(), create_and_test_bloom(), dblink_res_error(), elog_node_display(), enforce_generic_type_consistency(), errstart(), exec_replication_command(), exec_stmt_assert(), exec_stmt_raise(), ExecuteRecoveryCommand(), ExitPostmaster(), FreezeMultiXactId(), get_object_property_data(), GetConnection(), GetErrorContextStack(), 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(), info_cb(), InitPostmasterDeathWatchHandle(), InsertOneValue(), inv_seek(), inv_truncate(), IpcSemaphoreInitialize(), load_dh_buffer(), on_proc_exit(), on_shmem_exit(), PerformAuthentication(), pg_GSS_error(), pg_tzenumerate_next(), pgarch_archiveXlog(), pgfdw_report_error(), pgwin32_recv(), pgwin32_signal_initialize(), pgwin32_waitforsinglesocket(), PLy_elog_impl(), PLy_output(), pmdie(), PostmasterMain(), PostmasterMarkPIDForWorkerNotify(), processCancelRequest(), ReadRecord(), reaper(), reportDependentObjects(), RestoreArchivedFile(), ReThrowError(), setitimer(), ShowTransactionStateRec(), ShowUsage(), SignalSomeChildren(), SnapBuildFindSnapshot(), StartupXLOG(), statistic_proc_security_check(), transformColumnRef(), transformSubLink(), transformWindowFuncCall(), TranslateSocketError(), WalRcvFetchTimeLineHistoryFiles(), XLogWalRcvProcessMsg(), and xml_is_document().

1003 {
1005  MemoryContext oldcontext;
1006 
1007  recursion_depth++;
1009  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1010 
1011  edata->message_id = fmt;
1012  EVALUATE_MESSAGE(edata->domain, message, false, false);
1013 
1014  MemoryContextSwitchTo(oldcontext);
1015  recursion_depth--;
1016  return 0; /* return value does not matter */
1017 }
#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:834
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:385
struct MemoryContextData * assoc_context
Definition: elog.h:397
const char * domain
Definition: elog.h:376

◆ errmsg_plural()

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

Definition at line 1025 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(), index_build(), init_sexpr(), logicalrep_report_missing_attrs(), LookupFuncWithArgs(), ParseFuncOrColumn(), perform_base_backup(), ProcedureCreate(), ReadControlFile(), ReadTwoPhaseFile(), reportDependentObjects(), sendFile(), SetMultiXactIdLimit(), SnapBuildExportSnapshot(), transformPLAssignStmt(), and transformRangeTableSample().

1027 {
1029  MemoryContext oldcontext;
1030 
1031  recursion_depth++;
1033  oldcontext = MemoryContextSwitchTo(edata->assoc_context);
1034 
1035  edata->message_id = fmt_singular;
1036  EVALUATE_MESSAGE_PLURAL(edata->domain, message, false);
1037 
1038  MemoryContextSwitchTo(oldcontext);
1039  recursion_depth--;
1040  return 0; /* return value does not matter */
1041 }
#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:870
static ErrorData errordata[ERRORDATA_STACK_SIZE]
Definition: elog.c:145
const char * message_id
Definition: elog.h:385
struct MemoryContextData * assoc_context
Definition: elog.h:397
const char * domain
Definition: elog.h:376

◆ error_severity()

static const char * error_severity ( int  elevel)
static

Definition at line 3478 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().

3479 {
3480  const char *prefix;
3481 
3482  switch (elevel)
3483  {
3484  case DEBUG1:
3485  case DEBUG2:
3486  case DEBUG3:
3487  case DEBUG4:
3488  case DEBUG5:
3489  prefix = gettext_noop("DEBUG");
3490  break;
3491  case LOG:
3492  case LOG_SERVER_ONLY:
3493  prefix = gettext_noop("LOG");
3494  break;
3495  case INFO:
3496  prefix = gettext_noop("INFO");
3497  break;
3498  case NOTICE:
3499  prefix = gettext_noop("NOTICE");
3500  break;
3501  case WARNING:
3502  case WARNING_CLIENT_ONLY:
3503  prefix = gettext_noop("WARNING");
3504  break;
3505  case ERROR:
3506  prefix = gettext_noop("ERROR");
3507  break;
3508  case FATAL:
3509  prefix = gettext_noop("FATAL");
3510  break;
3511  case PANIC:
3512  prefix = gettext_noop("PANIC");
3513  break;
3514  default:
3515  prefix = "???";
3516  break;
3517  }
3518 
3519  return prefix;
3520 }
#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:1185
#define INFO
Definition: elog.h:33
#define LOG
Definition: elog.h:26
#define DEBUG4
Definition: elog.h:22
#define PANIC
Definition: elog.h:55
#define ERROR
Definition: elog.h:45
#define WARNING_CLIENT_ONLY
Definition: elog.h:43
#define FATAL
Definition: elog.h:54
#define DEBUG2
Definition: elog.h:24
#define WARNING
Definition: elog.h:40
static int elevel
Definition: vacuumlazy.c:333
#define NOTICE
Definition: elog.h:37
#define DEBUG5
Definition: elog.h:20

◆ errposition()

int errposition ( int  cursorpos)

Definition at line 1290 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().

1291 {
1293 
1294  /* we don't bother incrementing recursion_depth */
1296 
1297  edata->cursorpos = cursorpos;
1298 
1299  return 0; /* return value does not matter */
1300 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
int cursorpos
Definition: elog.h:391
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, elevel, ErrorData::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:45
int sqlerrcode
Definition: elog.h:378
#define ERRORDATA_STACK_SIZE
Definition: elog.c:143
static int recursion_depth
Definition: elog.c:149
#define MemSet(start, val, len)
Definition: c.h:996
void MemoryContextReset(MemoryContext context)
Definition: mcxt.c:137
#define PANIC
Definition: elog.h:55
ErrorContextCallback * error_context_stack
Definition: elog.c:93
const char * context_domain
Definition: elog.h:377
static int errordata_stack_depth
Definition: elog.c:147
#define ERROR
Definition: elog.h:45
#define FATAL
Definition: elog.h:54
bool output_to_server
Definition: elog.h:368
int saved_errno
Definition: elog.h:394
volatile uint32 CritSectionCount
Definition: globals.c:39
#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:367
static int elevel
Definition: vacuumlazy.c:333
bool ExitOnAnyError
Definition: globals.c:114
#define PG_TEXTDOMAIN(domain)
Definition: c.h:1203
#define ereport(elevel,...)
Definition: elog.h:155
bool in_error_recursion_trouble(void)
Definition: elog.c:291
int errmsg_internal(const char *fmt,...)
Definition: elog.c:1002
#define Max(x, y)
Definition: c.h:968
void write_stderr(const char *fmt,...)
Definition: elog.c:3549
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:397
sigjmp_buf * PG_exception_stack
Definition: elog.c:95
int i
const char * domain
Definition: elog.h:376
bool output_to_client
Definition: elog.h:369

◆ 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:333

◆ FlushErrorState()

void FlushErrorState ( void  )

Definition at line 1659 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().

1660 {
1661  /*
1662  * Reset stack to empty. The only case where it would be more than one
1663  * deep is if we serviced an error that interrupted construction of
1664  * another message. We assume control escaped out of that message
1665  * construction and won't ever go back.
1666  */
1667  errordata_stack_depth = -1;
1668  recursion_depth = 0;
1669  /* Delete all data in ErrorContext */
1671 }
MemoryContext ErrorContext
Definition: mcxt.c:45
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 1481 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.

1482 {
1483  ErrorData errdata;
1484  ErrorData *edata;
1485  MemoryContext oldcontext;
1486 
1487  /* Initialize a mostly-dummy error frame */
1488  edata = &errdata;
1489  MemSet(edata, 0, sizeof(ErrorData));
1490  /* the default text domain is the backend's */
1491  edata->domain = save_format_domain ? save_format_domain : PG_TEXTDOMAIN("postgres");
1492  /* set the errno to be used to interpret %m */
1494 
1495  oldcontext = MemoryContextSwitchTo(ErrorContext);
1496 
1497  edata->message_id = fmt;
1498  EVALUATE_MESSAGE(edata->domain, message, false, true);
1499 
1500  MemoryContextSwitchTo(oldcontext);
1501 
1502  return edata->message;
1503 }
MemoryContext ErrorContext
Definition: mcxt.c:45
static int save_format_errnumber
Definition: elog.c:1468
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
#define MemSet(start, val, len)
Definition: c.h:996
#define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit)
Definition: elog.c:834
int saved_errno
Definition: elog.h:394
#define PG_TEXTDOMAIN(domain)
Definition: c.h:1203
const char * message_id
Definition: elog.h:385
static const char * save_format_domain
Definition: elog.c:1469
const char * domain
Definition: elog.h:376
char * message
Definition: elog.h:379

◆ FreeErrorData()

void FreeErrorData ( ErrorData edata)

Definition at line 1621 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().

1622 {
1623  if (edata->message)
1624  pfree(edata->message);
1625  if (edata->detail)
1626  pfree(edata->detail);
1627  if (edata->detail_log)
1628  pfree(edata->detail_log);
1629  if (edata->hint)
1630  pfree(edata->hint);
1631  if (edata->context)
1632  pfree(edata->context);
1633  if (edata->backtrace)
1634  pfree(edata->backtrace);
1635  if (edata->schema_name)
1636  pfree(edata->schema_name);
1637  if (edata->table_name)
1638  pfree(edata->table_name);
1639  if (edata->column_name)
1640  pfree(edata->column_name);
1641  if (edata->datatype_name)
1642  pfree(edata->datatype_name);
1643  if (edata->constraint_name)
1644  pfree(edata->constraint_name);
1645  if (edata->internalquery)
1646  pfree(edata->internalquery);
1647  pfree(edata);
1648 }
char * schema_name
Definition: elog.h:386
char * internalquery
Definition: elog.h:393
void pfree(void *pointer)
Definition: mcxt.c:1057
char * detail_log
Definition: elog.h:381
char * table_name
Definition: elog.h:387
char * backtrace
Definition: elog.h:384
char * datatype_name
Definition: elog.h:389
char * detail
Definition: elog.h:380
char * column_name
Definition: elog.h:388
char * hint
Definition: elog.h:382
char * context
Definition: elog.h:383
char * constraint_name
Definition: elog.h:390
char * message
Definition: elog.h:379

◆ geterrcode()

int geterrcode ( void  )

Definition at line 1405 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::sqlerrcode.

Referenced by pcb_error_callback().

1406 {
1408 
1409  /* we don't bother incrementing recursion_depth */
1411 
1412  return edata->sqlerrcode;
1413 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
int sqlerrcode
Definition: elog.h:378
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 1860 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().

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

◆ geterrposition()

int geterrposition ( void  )

Definition at line 1422 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().

1423 {
1425 
1426  /* we don't bother incrementing recursion_depth */
1428 
1429  return edata->cursorpos;
1430 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
int cursorpos
Definition: elog.h:391
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 1439 of file elog.c.

References CHECK_STACK_DEPTH, errordata_stack_depth, and ErrorData::internalpos.

Referenced by function_parse_error_transpose().

1440 {
1442 
1443  /* we don't bother incrementing recursion_depth */
1445 
1446  return edata->internalpos;
1447 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
static int errordata_stack_depth
Definition: elog.c:147
int internalpos
Definition: elog.h:392
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 1306 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().

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

◆ internalerrquery()

int internalerrquery ( const char *  query)

Definition at line 1326 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().

1327 {
1329 
1330  /* we don't bother incrementing recursion_depth */
1332 
1333  if (edata->internalquery)
1334  {
1335  pfree(edata->internalquery);
1336  edata->internalquery = NULL;
1337  }
1338 
1339  if (query)
1340  edata->internalquery = MemoryContextStrdup(edata->assoc_context, query);
1341 
1342  return 0; /* return value does not matter */
1343 }
#define CHECK_STACK_DEPTH()
Definition: elog.c:164
char * internalquery
Definition: elog.h:393
void pfree(void *pointer)
Definition: mcxt.c:1057
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:397
char * MemoryContextStrdup(MemoryContext context, const char *string)
Definition: mcxt.c:1174

◆ 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:45
#define WARNING_CLIENT_ONLY
Definition: elog.h:43
#define FATAL
Definition: elog.h:54
static int elevel
Definition: vacuumlazy.c:333

◆ log_line_prefix()

static void log_line_prefix ( StringInfo  buf,
ErrorData edata 
)
static

Definition at line 2383 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(), 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().

2384 {
2385  /* static counter for line numbers */
2386  static long log_line_number = 0;
2387 
2388  /* has counter been reset in current process? */
2389  static int log_my_pid = 0;
2390  int padding;
2391  const char *p;
2392 
2393  /*
2394  * This is one of the few places where we'd rather not inherit a static
2395  * variable's value from the postmaster. But since we will, reset it when
2396  * MyProcPid changes. MyStartTime also changes when MyProcPid does, so
2397  * reset the formatted start timestamp too.
2398  */
2399  if (log_my_pid != MyProcPid)
2400  {
2401  log_line_number = 0;
2402  log_my_pid = MyProcPid;
2403  formatted_start_time[0] = '\0';
2404  }
2405  log_line_number++;
2406 
2407  if (Log_line_prefix == NULL)
2408  return; /* in case guc hasn't run yet */
2409 
2410  for (p = Log_line_prefix; *p != '\0'; p++)
2411  {
2412  if (*p != '%')
2413  {
2414  /* literal char, just copy */
2415  appendStringInfoChar(buf, *p);
2416  continue;
2417  }
2418 
2419  /* must be a '%', so skip to the next char */
2420  p++;
2421  if (*p == '\0')
2422  break; /* format error - ignore it */
2423  else if (*p == '%')
2424  {
2425  /* string contains %% */
2426  appendStringInfoChar(buf, '%');
2427  continue;
2428  }
2429 
2430 
2431  /*
2432  * Process any formatting which may exist after the '%'. Note that
2433  * process_log_prefix_padding moves p past the padding number if it
2434  * exists.
2435  *
2436  * Note: Since only '-', '0' to '9' are valid formatting characters we
2437  * can do a quick check here to pre-check for formatting. If the char
2438  * is not formatting then we can skip a useless function call.
2439  *
2440  * Further note: At least on some platforms, passing %*s rather than
2441  * %s to appendStringInfo() is substantially slower, so many of the
2442  * cases below avoid doing that unless non-zero padding is in fact
2443  * specified.
2444  */
2445  if (*p > '9')
2446  padding = 0;
2447  else if ((p = process_log_prefix_padding(p, &padding)) == NULL)
2448  break;
2449 
2450  /* process the option */
2451  switch (*p)
2452  {
2453  case 'a':
2454  if (MyProcPort)
2455  {
2456  const char *appname = application_name;
2457 
2458  if (appname == NULL || *appname == '\0')
2459  appname = _("[unknown]");
2460  if (padding != 0)
2461  appendStringInfo(buf, "%*s", padding, appname);
2462  else
2463  appendStringInfoString(buf, appname);
2464  }
2465  else if (padding != 0)
2467  padding > 0 ? padding : -padding);
2468 
2469  break;
2470  case 'b':
2471  {
2472  const char *backend_type_str;
2473 
2474  if (MyProcPid == PostmasterPid)
2475  backend_type_str = "postmaster";
2476  else if (MyBackendType == B_BG_WORKER)
2477  backend_type_str = MyBgworkerEntry->bgw_type;
2478  else
2479  backend_type_str = GetBackendTypeDesc(MyBackendType);
2480 
2481  if (padding != 0)
2482  appendStringInfo(buf, "%*s", padding, backend_type_str);
2483  else
2484  appendStringInfoString(buf, backend_type_str);
2485  break;
2486  }
2487  case 'u':
2488  if (MyProcPort)
2489  {
2490  const char *username = MyProcPort->user_name;
2491 
2492  if (username == NULL || *username == '\0')
2493  username = _("[unknown]");
2494  if (padding != 0)
2495  appendStringInfo(buf, "%*s", padding, username);
2496  else
2497  appendStringInfoString(buf, username);
2498  }
2499  else if (padding != 0)
2501  padding > 0 ? padding : -padding);
2502  break;
2503  case 'd':
2504  if (MyProcPort)
2505  {
2506  const char *dbname = MyProcPort->database_name;
2507 
2508  if (dbname == NULL || *dbname == '\0')
2509  dbname = _("[unknown]");
2510  if (padding != 0)
2511  appendStringInfo(buf, "%*s", padding, dbname);
2512  else
2513  appendStringInfoString(buf, dbname);
2514  }
2515  else if (padding != 0)
2517  padding > 0 ? padding : -padding);
2518  break;
2519  case 'c':
2520  if (padding != 0)
2521  {
2522  char strfbuf[128];
2523 
2524  snprintf(strfbuf, sizeof(strfbuf) - 1, "%lx.%x",
2525  (long) (MyStartTime), MyProcPid);
2526  appendStringInfo(buf, "%*s", padding, strfbuf);
2527  }
2528  else
2529  appendStringInfo(buf, "%lx.%x", (long) (MyStartTime), MyProcPid);
2530  break;
2531  case 'p':
2532  if (padding != 0)
2533  appendStringInfo(buf, "%*d", padding, MyProcPid);
2534  else
2535  appendStringInfo(buf, "%d", MyProcPid);
2536  break;
2537 
2538  case 'P':
2539  if (MyProc)
2540  {
2541  PGPROC *leader = MyProc->lockGroupLeader;
2542 
2543  /*
2544  * Show the leader only for active parallel workers. This
2545  * leaves out the leader of a parallel group.
2546  */
2547  if (leader == NULL || leader->pid == MyProcPid)
2549  padding > 0 ? padding : -padding);
2550  else if (padding != 0)
2551  appendStringInfo(buf, "%*d", padding, leader->pid);
2552  else
2553  appendStringInfo(buf, "%d", leader->pid);
2554  }
2555  else if (padding != 0)
2557  padding > 0 ? padding : -padding);
2558  break;
2559 
2560  case 'l':
2561  if (padding != 0)
2562  appendStringInfo(buf, "%*ld", padding, log_line_number);
2563  else
2564  appendStringInfo(buf, "%ld", log_line_number);
2565  break;
2566  case 'm':
2568  if (padding != 0)
2569  appendStringInfo(buf, "%*s", padding, formatted_log_time);
2570  else
2572  break;
2573  case 't':
2574  {
2575  pg_time_t stamp_time = (pg_time_t) time(NULL);
2576  char strfbuf[128];
2577 
2578  pg_strftime(strfbuf, sizeof(strfbuf),
2579  "%Y-%m-%d %H:%M:%S %Z",
2580  pg_localtime(&stamp_time, log_timezone));
2581  if (padding != 0)
2582  appendStringInfo(buf, "%*s", padding, strfbuf);
2583  else
2584  appendStringInfoString(buf, strfbuf);
2585  }
2586  break;
2587  case 'n':
2588  {
2589  char strfbuf[128];
2590 
2591  if (!saved_timeval_set)
2592  {
2593  gettimeofday(&saved_timeval, NULL);
2594  saved_timeval_set = true;
2595  }
2596 
2597  snprintf(strfbuf, sizeof(strfbuf), "%ld.%03d",
2598  (long) saved_timeval.tv_sec,
2599  (int) (saved_timeval.tv_usec / 1000));
2600 
2601  if (padding != 0)
2602  appendStringInfo(buf, "%*s", padding, strfbuf);
2603  else
2604  appendStringInfoString(buf, strfbuf);
2605  }
2606  break;
2607  case 's':
2608  if (formatted_start_time[0] == '\0')
2610  if (padding != 0)
2611  appendStringInfo(buf, "%*s", padding, formatted_start_time);
2612  else
2614  break;
2615  case 'i':
2616  if (MyProcPort)
2617  {
2618  const char *psdisp;
2619  int displen;
2620 
2621  psdisp = get_ps_display(&displen);
2622  if (padding != 0)
2623  appendStringInfo(buf, "%*s", padding, psdisp);
2624  else
2625  appendBinaryStringInfo(buf, psdisp, displen);
2626 
2627  }
2628  else if (padding != 0)
2630  padding > 0 ? padding : -padding);
2631  break;
2632  case 'r':
2634  {
2635  if (padding != 0)
2636  {
2637  if (MyProcPort->remote_port && MyProcPort->remote_port[0] != '\0')
2638  {
2639  /*
2640  * This option is slightly special as the port
2641  * number may be appended onto the end. Here we
2642  * need to build 1 string which contains the
2643  * remote_host and optionally the remote_port (if
2644  * set) so we can properly align the string.
2645  */
2646 
2647  char *hostport;
2648 
2649  hostport = psprintf("%s(%s)", MyProcPort->remote_host, MyProcPort->remote_port);
2650  appendStringInfo(buf, "%*s", padding, hostport);
2651  pfree(hostport);
2652  }
2653  else
2654  appendStringInfo(buf, "%*s", padding, MyProcPort->remote_host);
2655  }
2656  else
2657  {
2658  /* padding is 0, so we don't need a temp buffer */
2660  if (MyProcPort->remote_port &&
2661  MyProcPort->remote_port[0] != '\0')
2662  appendStringInfo(buf, "(%s)",
2664  }
2665 
2666  }
2667  else if (padding != 0)
2669  padding > 0 ? padding : -padding);
2670  break;
2671  case 'h':
2673  {
2674  if (padding != 0)
2675  appendStringInfo(buf, "%*s", padding, MyProcPort->remote_host);
2676  else
2678  }
2679  else if (padding != 0)
2681  padding > 0 ? padding : -padding);
2682  break;
2683  case 'q':
2684  /* in postmaster and friends, stop if %q is seen */
2685  /* in a backend, just ignore */
2686  if (MyProcPort == NULL)
2687  return;
2688  break;
2689  case 'v':
2690  /* keep VXID format in sync with lockfuncs.c */
2691  if (MyProc != NULL && MyProc->backendId != InvalidBackendId)
2692  {
2693  if (padding != 0)
2694  {
2695  char strfbuf[128];
2696 
2697  snprintf(strfbuf, sizeof(strfbuf) - 1, "%d/%u",
2699  appendStringInfo(buf, "%*s", padding, strfbuf);
2700  }
2701  else
2702  appendStringInfo(buf, "%d/%u", MyProc->backendId, MyProc->lxid);
2703  }
2704  else if (padding != 0)
2706  padding > 0 ? padding : -padding);
2707  break;
2708  case 'x':
2709  if (padding != 0)
2710  appendStringInfo(buf, "%*u", padding, GetTopTransactionIdIfAny());
2711  else
2713  break;
2714  case 'e':
2715  if (padding != 0)
2716  appendStringInfo(buf, "%*s", padding, unpack_sql_state(edata->sqlerrcode));
2717  else
2719  break;
2720  default:
2721  /* format error - ignore it */
2722  break;
2723  }
2724  }
2725 }
size_t pg_strftime(char *s, size_t max, const char *format, const struct pg_tm *tm)
Definition: strftime.c:128
int gettimeofday(struct timeval *tp, struct timezone *tzp)
Definition: gettimeofday.c:104
int MyProcPid
Definition: globals.c:41
int64 pg_time_t
Definition: pgtime.h:23
struct Port * MyProcPort
Definition: globals.c:44
static struct timeval saved_timeval
Definition: elog.c:155
BackendId backendId
Definition: proc.h:153
const char * GetBackendTypeDesc(BackendType backendType)
Definition: miscinit.c:230
int sqlerrcode
Definition: elog.h:378
BackendType MyBackendType
Definition: miscinit.c:62
PGPROC * MyProc
Definition: proc.c:68
char * psprintf(const char *fmt,...)
Definition: psprintf.c:46
char * unpack_sql_state(int sql_state)
Definition: elog.c:2979