PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <dirent.h>
#include <fcntl.h>
#include <netdb.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <unistd.h>
#include <signal.h>
#include <time.h>
#include "sys/mman.h"
#include "access/xlog_internal.h"
#include "catalog/pg_authid_d.h"
#include "catalog/pg_class_d.h"
#include "catalog/pg_collation_d.h"
#include "catalog/pg_database_d.h"
#include "common/file_perm.h"
#include "common/file_utils.h"
#include "common/logging.h"
#include "common/pg_prng.h"
#include "common/restricted_token.h"
#include "common/string.h"
#include "common/username.h"
#include "fe_utils/option_utils.h"
#include "fe_utils/string_utils.h"
#include "getopt_long.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
Go to the source code of this file.
Data Structures | |
struct | _stringlist |
struct | tsearch_config_match |
Macros | |
#define | AUTHTRUST_WARNING |
#define | PG_CMD_DECL FILE *cmdfd |
#define | PG_CMD_OPEN(cmd) |
#define | PG_CMD_CLOSE() |
#define | PG_CMD_PUTS(line) |
#define | PG_CMD_PRINTF(fmt, ...) |
#define | LETTERS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" |
#define | DIGITS "0123456789" |
#define | MIN_BUFS_FOR_CONNS(nconns) ((nconns) * 10) |
Typedefs | |
typedef struct _stringlist | _stringlist |
typedef char * | save_locale_t |
Functions | |
const char * | select_default_timezone (const char *share_path) |
static char ** | replace_token (char **lines, const char *token, const char *replacement) |
static char ** | replace_guc_value (char **lines, const char *guc_name, const char *guc_value, bool mark_as_comment) |
static bool | guc_value_requires_quotes (const char *guc_value) |
static char ** | readfile (const char *path) |
static void | writefile (char *path, char **lines) |
static FILE * | popen_check (const char *command, const char *mode) |
static char * | get_id (void) |
static int | get_encoding_id (const char *encoding_name) |
static void | set_input (char **dest, const char *filename) |
static void | check_input (char *path) |
static void | write_version_file (const char *extrapath) |
static void | set_null_conf (void) |
static void | test_config_settings (void) |
static bool | test_specific_config_settings (int test_conns, int test_buffs) |
static void | setup_config (void) |
static void | bootstrap_template1 (void) |
static void | setup_auth (FILE *cmdfd) |
static void | get_su_pwd (void) |
static void | setup_depend (FILE *cmdfd) |
static void | setup_run_file (FILE *cmdfd, const char *filename) |
static void | setup_description (FILE *cmdfd) |
static void | setup_collation (FILE *cmdfd) |
static void | setup_privileges (FILE *cmdfd) |
static void | set_info_version (void) |
static void | setup_schema (FILE *cmdfd) |
static void | load_plpgsql (FILE *cmdfd) |
static void | vacuum_db (FILE *cmdfd) |
static void | make_template0 (FILE *cmdfd) |
static void | make_postgres (FILE *cmdfd) |
static void | trapsig (SIGNAL_ARGS) |
static void | check_ok (void) |
static char * | escape_quotes (const char *src) |
static char * | escape_quotes_bki (const char *src) |
static int | locale_date_order (const char *locale) |
static void | check_locale_name (int category, const char *locale, char **canonname) |
static bool | check_locale_encoding (const char *locale, int user_enc) |
static void | setlocales (void) |
static void | usage (const char *progname) |
void | setup_pgdata (void) |
void | setup_bin_paths (const char *argv0) |
void | setup_data_file_paths (void) |
void | setup_locale_encoding (void) |
void | setup_signals (void) |
void | setup_text_search (void) |
void | create_data_directory (void) |
void | create_xlog_or_symlink (void) |
void | warn_on_mount_point (int error) |
void | initialize_data_directory (void) |
static save_locale_t | save_global_locale (int category) |
static void | restore_global_locale (int category, save_locale_t save) |
static void | add_stringlist_item (_stringlist **listhead, const char *str) |
static void | cleanup_directories_atexit (void) |
static char * | encodingid_to_string (int enc) |
static const char * | find_matching_ts_config (const char *lc_type) |
static const char * | choose_dsm_implementation (void) |
static char * | pretty_wal_size (int segment_count) |
static size_t | my_strftime (char *s, size_t max, const char *fmt, const struct tm *tm) |
static bool | check_icu_locale_encoding (int user_enc) |
static char * | icu_language_tag (const char *loc_str) |
static void | icu_validate_locale (const char *loc_str) |
static void | check_authmethod_unspecified (const char **authmethod) |
static void | check_authmethod_valid (const char *authmethod, const char *const *valid_methods, const char *conntype) |
static void | check_need_password (const char *authmethodlocal, const char *authmethodhost) |
int | main (int argc, char *argv[]) |
Variables | |
static const char *const | auth_methods_host [] |
static const char *const | auth_methods_local [] |
static char * | share_path = NULL |
static char * | pg_data = NULL |
static char * | encoding = NULL |
static char * | locale = NULL |
static char * | lc_collate = NULL |
static char * | lc_ctype = NULL |
static char * | lc_monetary = NULL |
static char * | lc_numeric = NULL |
static char * | lc_time = NULL |
static char * | lc_messages = NULL |
static char | locale_provider = COLLPROVIDER_LIBC |
static bool | builtin_locale_specified = false |
static char * | datlocale = NULL |
static bool | icu_locale_specified = false |
static char * | icu_rules = NULL |
static const char * | default_text_search_config = NULL |
static char * | username = NULL |
static bool | pwprompt = false |
static char * | pwfilename = NULL |
static char * | superuser_password = NULL |
static const char * | authmethodhost = NULL |
static const char * | authmethodlocal = NULL |
static _stringlist * | extra_guc_names = NULL |
static _stringlist * | extra_guc_values = NULL |
static bool | debug = false |
static bool | noclean = false |
static bool | noinstructions = false |
static bool | do_sync = true |
static bool | sync_only = false |
static bool | show_setting = false |
static bool | data_checksums = true |
static char * | xlog_dir = NULL |
static int | wal_segment_size_mb = (DEFAULT_XLOG_SEG_SIZE) / (1024 * 1024) |
static DataDirSyncMethod | sync_method = DATA_DIR_SYNC_METHOD_FSYNC |
static const char * | progname |
static int | encodingid |
static char * | bki_file |
static char * | hba_file |
static char * | ident_file |
static char * | conf_file |
static char * | dictionary_file |
static char * | info_schema_file |
static char * | features_file |
static char * | system_constraints_file |
static char * | system_functions_file |
static char * | system_views_file |
static bool | success = false |
static bool | made_new_pgdata = false |
static bool | found_existing_pgdata = false |
static bool | made_new_xlogdir = false |
static bool | found_existing_xlogdir = false |
static char | infoversion [100] |
static bool | caught_signal = false |
static bool | output_failed = false |
static int | output_errno = 0 |
static char * | pgdata_native |
static int | n_connections = 10 |
static int | n_buffers = 50 |
static const char * | dynamic_shared_memory_type = NULL |
static const char * | default_timezone = NULL |
static bool | authwarning = false |
static const char *const | boot_options = "-F -c log_checkpoints=false" |
static const char *const | backend_options = "--single -F -O -j -c search_path=pg_catalog -c exit_on_error=true -c log_checkpoints=false" |
static char * | extra_options = "" |
static const char *const | subdirs [] |
static char | bin_path [MAXPGPATH] |
static char | backend_exec [MAXPGPATH] |
static const struct tsearch_config_match | tsearch_config_languages [] |
#define AUTHTRUST_WARNING |
#define DIGITS "0123456789" |
#define LETTERS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" |
#define PG_CMD_CLOSE | ( | ) |
#define PG_CMD_OPEN | ( | cmd | ) |
#define PG_CMD_PRINTF | ( | fmt, | |
... | |||
) |
#define PG_CMD_PUTS | ( | line | ) |
typedef struct _stringlist _stringlist |
typedef char* save_locale_t |
|
static |
Definition at line 442 of file initdb.c.
References _stringlist::next, pg_malloc(), pg_strdup(), _stringlist::str, and str.
Referenced by ecpg_start_test(), isolation_init(), isolation_start_test(), main(), psql_init(), and psql_start_test().
|
static |
Definition at line 1527 of file initdb.c.
References _, appendPQExpBuffer(), backend_exec, bki_file, boot_options, buf, check_ok(), PQExpBufferData::data, data_checksums, datlocale, debug, encodingid, encodingid_to_string(), escape_quotes_bki(), exit(), extra_options, fflush(), FLOAT8PASSBYVAL, free, icu_rules, initPQExpBuffer(), lc_collate, lc_ctype, locale_provider, MAXPGPATH, NAMEDATALEN, PG_CMD_CLOSE, PG_CMD_DECL, PG_CMD_OPEN, PG_CMD_PUTS, pg_log_error, pg_log_error_hint, printf, printfPQExpBuffer(), readfile(), replace_token(), snprintf, sprintf, generate_unaccent_rules::stdout, termPQExpBuffer(), unsetenv, username, and wal_segment_size_mb.
Referenced by initialize_data_directory().
|
static |
|
static |
|
static |
Definition at line 2282 of file initdb.c.
References is_encoding_supported_by_icu(), pg_encoding_to_char, pg_log_error, pg_log_error_detail, pg_log_error_hint, and progname.
Referenced by setup_locale_encoding().
|
static |
Definition at line 988 of file initdb.c.
References exit(), pg_log_error, pg_log_error_hint, S_ISREG, stat::st_mode, and stat.
Referenced by setup_data_file_paths().
|
static |
Definition at line 2247 of file initdb.c.
References locale, pg_encoding_to_char, pg_get_encoding_from_locale(), pg_log_error, pg_log_error_detail, pg_log_error_hint, PG_SQL_ASCII, PG_UTF8, and progname.
Referenced by setup_locale_encoding().
|
static |
Definition at line 2184 of file initdb.c.
References exit(), locale, pg_fatal, pg_is_ascii(), pg_log_error, pg_log_error_hint, pg_strdup(), res, restore_global_locale(), save_global_locale(), and setlocale.
Referenced by setlocales().
|
static |
Definition at line 2576 of file initdb.c.
References authmethodhost, authmethodlocal, pg_fatal, pwfilename, and pwprompt.
Referenced by main().
|
static |
Definition at line 2091 of file initdb.c.
References _, caught_signal, exit(), fflush(), output_errno, output_failed, printf, generate_unaccent_rules::stdout, and strerror.
Referenced by adjust_data_dir(), bootstrap_template1(), check_cluster_versions(), check_for_connection_status(), check_for_data_types_usage(), check_for_incompatible_polymorphics(), check_for_isn_and_int8_passing_mismatch(), check_for_new_tablespace_dir(), check_for_pg_role_prefix(), check_for_prepared_transactions(), check_for_tables_with_oids(), check_for_user_defined_encoding_conversions(), check_for_user_defined_postfix_ops(), check_is_install_user(), check_loadable_libraries(), check_new_cluster_logical_replication_slots(), check_new_cluster_subscription_configuration(), check_old_cluster_for_valid_slots(), check_old_cluster_subscription_state(), copy_subdir_files(), copy_xact_xlog_xid(), create_data_directory(), create_logical_replication_slots(), create_new_objects(), create_script_for_old_cluster_deletion(), create_xlog_or_symlink(), disable_old_cluster(), generate_old_dump(), initialize_data_directory(), main(), old_9_6_invalidate_hash_indexes(), prepare_new_cluster(), prepare_new_globals(), remove_new_subdir(), report_extension_updates(), set_frozenxids(), set_locale_and_encoding(), setup_config(), and transfer_all_new_tablespaces().
|
static |
Definition at line 1071 of file initdb.c.
References close, fd(), name, pg_prng_seed(), pg_prng_uint32(), prng_state, and snprintf.
Referenced by test_config_settings().
|
static |
Definition at line 759 of file initdb.c.
References found_existing_pgdata, found_existing_xlogdir, made_new_pgdata, made_new_xlogdir, noclean, pg_data, pg_log_error, pg_log_info, rmtree(), success, and xlog_dir.
Referenced by main().
void create_data_directory | ( | void | ) |
Definition at line 2876 of file initdb.c.
References _, check_ok(), exit(), fflush(), found_existing_pgdata, made_new_pgdata, pg_check_dir(), pg_data, pg_dir_create_mode, pg_fatal, pg_log_error, pg_log_error_hint, pg_mkdir_p(), printf, progname, generate_unaccent_rules::stdout, and warn_on_mount_point().
Referenced by initialize_data_directory().
void create_xlog_or_symlink | ( | void | ) |
Definition at line 2934 of file initdb.c.
References _, canonicalize_path(), check_ok(), exit(), fflush(), found_existing_xlogdir, free, is_absolute_path, made_new_xlogdir, mkdir, pg_check_dir(), pg_data, pg_dir_create_mode, pg_fatal, pg_log_error, pg_log_error_hint, pg_mkdir_p(), printf, psprintf(), generate_unaccent_rules::stdout, symlink, warn_on_mount_point(), and xlog_dir.
Referenced by initialize_data_directory().
|
static |
Definition at line 831 of file initdb.c.
References enc, pg_strdup(), and sprintf.
Referenced by bootstrap_template1().
|
static |
Definition at line 403 of file initdb.c.
References escape_single_quotes_ascii(), and pg_fatal.
Referenced by escape_quotes_bki(), replace_guc_value(), setup_auth(), setup_privileges(), and setup_schema().
|
static |
Definition at line 419 of file initdb.c.
References data, escape_quotes(), free, and pg_malloc().
Referenced by bootstrap_template1().
|
static |
Definition at line 933 of file initdb.c.
References free, i, tsearch_config_match::langname, pg_strcasecmp(), pg_strdup(), tsearch_config_match::tsconfname, and tsearch_config_languages.
Referenced by setup_text_search().
|
static |
Definition at line 843 of file initdb.c.
References enc, pg_fatal, and pg_valid_server_encoding.
Referenced by setup_locale_encoding().
|
static |
Definition at line 812 of file initdb.c.
References exit(), get_user_name_or_exit(), pg_log_error, pg_log_error_hint, pg_strdup(), progname, and username.
Referenced by main().
|
static |
Definition at line 1639 of file initdb.c.
References _, exit(), fflush(), fprintf, free, pg_fatal, pg_get_line(), pg_strip_crlf(), printf, pwfilename, pwprompt, simple_prompt(), generate_unaccent_rules::stdout, and superuser_password.
Referenced by main().
|
static |
Definition at line 641 of file initdb.c.
References DIGITS, and LETTERS.
Referenced by replace_guc_value().
|
static |
Definition at line 2302 of file initdb.c.
References pg_fatal, pg_free(), pg_malloc(), and pg_realloc().
Referenced by setlocales().
|
static |
void initialize_data_directory | ( | void | ) |
Definition at line 3030 of file initdb.c.
References _, backend_exec, backend_options, bootstrap_template1(), check_ok(), create_data_directory(), create_xlog_or_symlink(), PQExpBufferData::data, DEVNULL, dictionary_file, extra_options, fflush(), free, i, initPQExpBuffer(), lengthof, load_plpgsql(), make_postgres(), make_template0(), mkdir, PG_CMD_CLOSE, PG_CMD_DECL, PG_CMD_OPEN, pg_data, pg_dir_create_mode, pg_fatal, pg_mode_mask, printf, printfPQExpBuffer(), psprintf(), set_null_conf(), setup_auth(), setup_collation(), setup_config(), setup_depend(), setup_description(), setup_privileges(), setup_run_file(), setup_schema(), setup_signals(), generate_unaccent_rules::stdout, subdirs, system_constraints_file, system_functions_file, system_views_file, termPQExpBuffer(), test_config_settings(), vacuum_db(), and write_version_file().
Referenced by main().
|
static |
Definition at line 1974 of file initdb.c.
References PG_CMD_PUTS.
Referenced by initialize_data_directory().
|
static |
Definition at line 2125 of file initdb.c.
References buf, DATEORDER_DMY, DATEORDER_MDY, DATEORDER_YMD, locale, my_strftime(), res, restore_global_locale(), save_global_locale(), setlocale, and tm.
Referenced by setup_config().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 3144 of file initdb.c.
References _, add_stringlist_item(), appendPQExpBuffer(), appendPQExpBufferStr(), appendShellString(), auth_methods_host, auth_methods_local, authmethodhost, authmethodlocal, authwarning, buf, builtin_locale_specified, canonicalize_path(), check_authmethod_unspecified(), check_authmethod_valid(), check_need_password(), check_ok(), cleanup_directories_atexit(), createPQExpBuffer(), PQExpBufferData::data, data_checksums, datlocale, debug, default_text_search_config, destroyPQExpBuffer(), do_sync, encoding, exit(), extra_guc_names, extra_guc_values, extra_options, fflush(), get_id(), get_parent_directory(), get_progname(), get_restricted_token(), get_su_pwd(), getopt_long(), icu_locale_specified, icu_rules, initialize_data_directory(), IsValidWalSegSize, join_path_components(), lc_collate, lc_ctype, lc_messages, lc_monetary, lc_numeric, lc_time, locale, locale_provider, make_native_path(), MAXPGPATH, no_argument, noclean, noinstructions, optarg, optind, option_parse_int(), parse_sync_method(), pfree(), pg_check_dir(), pg_ctl_path, pg_data, PG_DIR_MODE_GROUP, pg_fatal, PG_IOLBF, pg_log_error, pg_log_error_hint, pg_log_warning, pg_log_warning_hint, pg_logging_init(), pg_strdup(), PG_TEXTDOMAIN, pgdata_native, printf, progname, psprintf(), pwfilename, pwprompt, required_argument, set_info_version(), set_pglocale_pgservice(), SetDataDirectoryCreatePerm(), setup_bin_paths(), setup_data_file_paths(), setup_locale_encoding(), setup_pgdata(), setup_text_search(), share_path, show_setting, generate_unaccent_rules::stdout, strlcpy(), success, sync_method, sync_only, usage(), username, wal_segment_size_mb, and xlog_dir.
|
static |
Definition at line 2047 of file initdb.c.
References CppAsString2, and PG_CMD_PUTS.
Referenced by initialize_data_directory().
|
static |
Definition at line 1993 of file initdb.c.
References CppAsString2, and PG_CMD_PUTS.
Referenced by initialize_data_directory().
|
inlinestatic |
|
static |
|
static |
Definition at line 1247 of file initdb.c.
References pg_malloc(), snprintf, and wal_segment_size_mb.
Referenced by setup_config().
|
static |
Definition at line 673 of file initdb.c.
References StringInfoData::data, infile(), initStringInfo(), pfree(), pg_fatal, pg_get_line_buf(), pg_malloc(), pg_realloc(), and pg_strdup().
Referenced by bootstrap_template1(), setup_config(), and setup_run_file().
|
static |
Definition at line 525 of file initdb.c.
References appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), createPQExpBuffer(), escape_quotes(), free, guc_value_requires_quotes(), i, Max, newline, pg_realloc_array, and pg_strncasecmp().
Referenced by setup_config().
|
static |
Definition at line 470 of file initdb.c.
References free, i, newline, pg_malloc(), and token.
Referenced by bootstrap_template1(), and setup_config().
|
static |
Definition at line 386 of file initdb.c.
References free, pg_fatal, and setlocale.
Referenced by check_locale_name(), and locale_date_order().
|
static |
Definition at line 362 of file initdb.c.
References pg_fatal, pg_strdup(), and setlocale.
Referenced by check_locale_name(), and locale_date_order().
const char* select_default_timezone | ( | const char * | share_path | ) |
Definition at line 1757 of file findtimezone.c.
References identify_system_timezone(), share_path, snprintf, tzdirpath, and validate_zone().
Referenced by test_config_settings().
|
static |
Definition at line 1927 of file initdb.c.
References infoversion, pg_strdup(), and snprintf.
Referenced by main().
|
static |
Definition at line 979 of file initdb.c.
References generate_unaccent_rules::dest, filename, psprintf(), and share_path.
Referenced by setup_data_file_paths().
|
static |
Definition at line 1042 of file initdb.c.
References conf_file, free, PG_BINARY_W, pg_data, pg_fatal, and psprintf().
Referenced by initialize_data_directory().
|
static |
Definition at line 2406 of file initdb.c.
References _, check_locale_name(), datlocale, icu_language_tag(), icu_validate_locale(), lc_collate, lc_ctype, lc_messages, lc_monetary, lc_numeric, lc_time, locale, locale_provider, pg_fatal, pg_free(), and printf.
Referenced by setup_locale_encoding().
|
static |
Definition at line 1622 of file initdb.c.
References escape_quotes(), PG_CMD_PRINTF, PG_CMD_PUTS, superuser_password, and username.
Referenced by initialize_data_directory().
void setup_bin_paths | ( | const char * | argv0 | ) |
Definition at line 2627 of file initdb.c.
References argv0, backend_exec, bin_path, canonicalize_path(), find_my_exec(), find_other_exec(), get_share_path(), is_absolute_path, last_dir_separator(), MAXPGPATH, PG_BACKEND_VERSIONSTR, pg_fatal, pg_malloc(), progname, share_path, and strlcpy().
Referenced by main().
|
static |
Definition at line 1753 of file initdb.c.
References PG_CMD_PUTS.
Referenced by initialize_data_directory().
|
static |
Definition at line 1264 of file initdb.c.
References _, authmethodhost, authmethodlocal, AUTHTRUST_WARNING, check_ok(), conf_file, DATEORDER_DMY, DATEORDER_MDY, DATEORDER_YMD, DEFAULT_BACKEND_FLUSH_AFTER, DEFAULT_BGWRITER_FLUSH_AFTER, DEFAULT_CHECKPOINT_FLUSH_AFTER, DEFAULT_MAX_WAL_SEGS, DEFAULT_MIN_WAL_SEGS, DEFAULT_PGSOCKET_DIR, default_text_search_config, default_timezone, dynamic_shared_memory_type, err(), extra_guc_names, extra_guc_values, fflush(), hba_file, ident_file, lc_messages, lc_monetary, lc_numeric, lc_time, locale_date_order(), MAXPGPATH, n_buffers, n_connections, _stringlist::next, pg_data, pg_dir_create_mode, PG_DIR_MODE_GROUP, pg_fatal, pg_file_create_mode, pg_malloc_array, pg_strdup(), pretty_wal_size(), readfile(), replace_guc_value(), replace_token(), snprintf, sprintf, generate_unaccent_rules::stdout, _stringlist::str, and writefile().
Referenced by initialize_data_directory().
void setup_data_file_paths | ( | void | ) |
Definition at line 2769 of file initdb.c.
References bin_path, bki_file, check_input(), conf_file, debug, dictionary_file, exit(), features_file, fprintf, hba_file, ident_file, info_schema_file, pg_data, set_input(), share_path, show_setting, system_constraints_file, system_functions_file, system_views_file, and username.
Referenced by main().
|
static |
Definition at line 1698 of file initdb.c.
References PG_CMD_PUTS.
Referenced by initialize_data_directory().
|
static |
Definition at line 1732 of file initdb.c.
References PG_CMD_PUTS.
Referenced by initialize_data_directory().
void setup_locale_encoding | ( | void | ) |
Definition at line 2664 of file initdb.c.
References _, check_icu_locale_encoding(), check_locale_encoding(), datlocale, encoding, encodingid, exit(), get_encoding_id(), lc_collate, lc_ctype, lc_messages, lc_monetary, lc_numeric, lc_time, locale_provider, pg_encoding_to_char, pg_fatal, pg_get_encoding_from_locale(), pg_log_error, pg_log_error_detail, pg_log_error_hint, PG_SQL_ASCII, PG_UTF8, pg_valid_server_encoding_id, printf, progname, and setlocales().
Referenced by main().
void setup_pgdata | ( | void | ) |
Definition at line 2590 of file initdb.c.
References canonicalize_path(), exit(), pg_data, pg_fatal, pg_log_error, pg_log_error_hint, pg_strdup(), pgdata_native, and setenv.
Referenced by main().
|
static |
Definition at line 1786 of file initdb.c.
References CppAsString2, escape_quotes(), PG_CMD_PRINTF, PG_CMD_PUTS, and username.
Referenced by initialize_data_directory().
|
static |
Definition at line 1711 of file initdb.c.
References filename, free, PG_CMD_PUTS, and readfile().
Referenced by initialize_data_directory(), and setup_schema().
|
static |
Definition at line 1954 of file initdb.c.
References escape_quotes(), features_file, info_schema_file, infoversion, PG_CMD_PRINTF, and setup_run_file().
Referenced by initialize_data_directory().
void setup_signals | ( | void | ) |
Definition at line 2847 of file initdb.c.
References pqsignal(), SIG_IGN, SIGHUP, SIGPIPE, SIGQUIT, and trapsig().
Referenced by initialize_data_directory().
void setup_text_search | ( | void | ) |
Definition at line 2813 of file initdb.c.
References _, default_text_search_config, find_matching_ts_config(), lc_ctype, pg_log_info, pg_log_warning, and printf.
Referenced by main().
|
static |
Definition at line 1113 of file initdb.c.
References _, choose_dsm_implementation(), default_timezone, dynamic_shared_memory_type, fflush(), i, MIN_BUFS_FOR_CONNS, n_buffers, n_connections, printf, select_default_timezone(), share_path, generate_unaccent_rules::stdout, and test_specific_config_settings().
Referenced by initialize_data_directory().
|
static |
Definition at line 1203 of file initdb.c.
References appendPQExpBuffer(), appendShellString(), backend_exec, boot_options, PQExpBufferData::data, DEVNULL, dynamic_shared_memory_type, extra_guc_names, extra_guc_values, extra_options, fflush(), initPQExpBuffer(), _stringlist::next, printfPQExpBuffer(), _stringlist::str, and termPQExpBuffer().
Referenced by test_config_settings().
|
static |
Definition at line 2080 of file initdb.c.
References caught_signal, and pqsignal().
Referenced by setup_signals().
|
static |
|
static |
Definition at line 1983 of file initdb.c.
References PG_CMD_PUTS.
Referenced by initialize_data_directory().
void warn_on_mount_point | ( | int | error | ) |
Definition at line 3017 of file initdb.c.
References error(), pg_log_error_detail, and pg_log_error_hint.
Referenced by create_data_directory(), and create_xlog_or_symlink().
|
static |
Definition at line 1019 of file initdb.c.
References fprintf, free, PG_BINARY_W, pg_data, pg_fatal, psprintf(), and version_file.
Referenced by initialize_data_directory().
|
static |
Definition at line 720 of file initdb.c.
References free, and pg_fatal.
Referenced by setup_config().
|
static |
|
static |
|
static |
Definition at line 157 of file initdb.c.
Referenced by check_need_password(), main(), and setup_config().
|
static |
Definition at line 158 of file initdb.c.
Referenced by check_need_password(), main(), and setup_config().
Definition at line 211 of file initdb.c.
Referenced by check_authmethod_unspecified(), and main().
|
static |
Definition at line 258 of file initdb.c.
Referenced by bootstrap_template1(), initialize_data_directory(), setup_bin_paths(), and test_specific_config_settings().
|
static |
Definition at line 224 of file initdb.c.
Referenced by initialize_data_directory().
|
static |
Definition at line 257 of file initdb.c.
Referenced by make_relative_path(), setup_bin_paths(), and setup_data_file_paths().
|
static |
Definition at line 176 of file initdb.c.
Referenced by bootstrap_template1(), and setup_data_file_paths().
|
static |
Definition at line 223 of file initdb.c.
Referenced by bootstrap_template1(), and test_specific_config_settings().
Definition at line 192 of file initdb.c.
Referenced by check_ok(), and trapsig().
|
static |
Definition at line 179 of file initdb.c.
Referenced by set_null_conf(), setup_config(), and setup_data_file_paths().
Definition at line 167 of file initdb.c.
Referenced by bootstrap_template1(), and main().
|
static |
Definition at line 149 of file initdb.c.
Referenced by bootstrap_template1(), init_database_collation(), main(), setlocales(), and setup_locale_encoding().
Definition at line 161 of file initdb.c.
Referenced by bootstrap_template1(), main(), pg_regcomp(), reconstruct_from_incremental_file(), setup_data_file_paths(), slice_check(), and write_reconstructed_file().
|
static |
Definition at line 152 of file initdb.c.
Referenced by main(), setup_config(), and setup_text_search().
|
static |
Definition at line 201 of file initdb.c.
Referenced by setup_config(), and test_config_settings().
|
static |
Definition at line 180 of file initdb.c.
Referenced by initialize_data_directory(), and setup_data_file_paths().
Definition at line 164 of file initdb.c.
Referenced by main(), sync_target_dir(), and update_controlfile().
|
static |
Definition at line 200 of file initdb.c.
Referenced by setup_config(), test_config_settings(), and test_specific_config_settings().
|
static |
Definition at line 139 of file initdb.c.
Referenced by main(), and setup_locale_encoding().
|
static |
Definition at line 175 of file initdb.c.
Referenced by bootstrap_template1(), and setup_locale_encoding().
|
static |
Definition at line 159 of file initdb.c.
Referenced by main(), setup_config(), and test_specific_config_settings().
|
static |
Definition at line 160 of file initdb.c.
Referenced by main(), setup_config(), and test_specific_config_settings().
|
static |
Definition at line 227 of file initdb.c.
Referenced by bootstrap_template1(), initialize_data_directory(), main(), and test_specific_config_settings().
|
static |
Definition at line 182 of file initdb.c.
Referenced by setup_data_file_paths(), and setup_schema().
Definition at line 188 of file initdb.c.
Referenced by cleanup_directories_atexit(), and create_data_directory().
Definition at line 190 of file initdb.c.
Referenced by cleanup_directories_atexit(), and create_xlog_or_symlink().
|
static |
Definition at line 177 of file initdb.c.
Referenced by setup_config(), and setup_data_file_paths().
|
static |
Definition at line 151 of file initdb.c.
Referenced by bootstrap_template1(), and main().
|
static |
Definition at line 178 of file initdb.c.
Referenced by setup_config(), and setup_data_file_paths().
|
static |
Definition at line 181 of file initdb.c.
Referenced by setup_data_file_paths(), and setup_schema().
|
static |
Definition at line 191 of file initdb.c.
Referenced by set_info_version(), and setup_schema().
|
static |
Definition at line 141 of file initdb.c.
Referenced by bootstrap_template1(), get_control_data(), main(), setlocales(), and setup_locale_encoding().
|
static |
Definition at line 142 of file initdb.c.
Referenced by bootstrap_template1(), get_control_data(), main(), setlocales(), setup_locale_encoding(), and setup_text_search().
|
static |
Definition at line 146 of file initdb.c.
Referenced by get_control_data(), main(), setlocales(), setup_config(), and setup_locale_encoding().
|
static |
Definition at line 143 of file initdb.c.
Referenced by get_control_data(), main(), setlocales(), setup_config(), and setup_locale_encoding().
|
static |
Definition at line 144 of file initdb.c.
Referenced by get_control_data(), main(), setlocales(), setup_config(), and setup_locale_encoding().
|
static |
Definition at line 145 of file initdb.c.
Referenced by get_control_data(), main(), setlocales(), setup_config(), and setup_locale_encoding().
|
static |
Definition at line 140 of file initdb.c.
Referenced by btvarstrequalimage(), builtin_locale_encoding(), builtin_validate_locale(), char2wchar(), check_locale(), check_locale_encoding(), check_locale_name(), CheckMyDatabase(), createdb(), DefineCollation(), dumpDatabase(), Generic_Text_IC_like(), GenericMatchText(), get_template0_info(), if(), init_locale(), like_fixed_prefix(), locale_date_order(), main(), map_locale(), MatchText(), pattern_char_isalpha(), pg_collation_actual_version(), pg_import_system_collations(), pg_perm_setlocale(), pg_set_regex_collation(), pg_strcoll(), pg_strncoll(), pg_strnxfrm(), pg_strnxfrm_prefix(), pg_strxfrm(), pg_strxfrm_enabled(), pg_strxfrm_prefix(), pg_strxfrm_prefix_enabled(), pgwin32_setlocale(), SB_lower_char(), set_locale_and_encoding(), setlocales(), strncoll_libc(), strnxfrm_libc(), varstr_sortsupport(), and wchar2char().
|
static |
Definition at line 147 of file initdb.c.
Referenced by bootstrap_template1(), main(), setlocales(), and setup_locale_encoding().
Definition at line 187 of file initdb.c.
Referenced by cleanup_directories_atexit(), and create_data_directory().
Definition at line 189 of file initdb.c.
Referenced by cleanup_directories_atexit(), and create_xlog_or_symlink().
|
static |
Definition at line 199 of file initdb.c.
Referenced by setup_config(), and test_config_settings().
|
static |
Definition at line 198 of file initdb.c.
Referenced by setup_config(), and test_config_settings().
Definition at line 162 of file initdb.c.
Referenced by cleanup_directories_atexit(), and main().
|
static |
Definition at line 194 of file initdb.c.
Referenced by check_ok().
Definition at line 193 of file initdb.c.
Referenced by check_ok().
|
static |
Definition at line 138 of file initdb.c.
Referenced by check_data_dir(), check_single_dir(), cleanup_directories_atexit(), create_data_directory(), create_xlog_or_symlink(), initialize_data_directory(), main(), set_null_conf(), setup_config(), setup_data_file_paths(), setup_pgdata(), and write_version_file().
|
static |
Definition at line 195 of file initdb.c.
Referenced by main(), and setup_pgdata().
|
static |
Definition at line 174 of file initdb.c.
Referenced by check_icu_locale_encoding(), check_locale_encoding(), create_data_directory(), get_id(), main(), setup_bin_paths(), setup_locale_encoding(), and usage().
|
static |
Definition at line 155 of file initdb.c.
Referenced by check_need_password(), get_su_pwd(), and main().
Definition at line 154 of file initdb.c.
Referenced by check_need_password(), get_su_pwd(), and main().
|
static |
Definition at line 135 of file initdb.c.
Referenced by main(), ParseTzFile(), select_default_timezone(), set_input(), setup_bin_paths(), setup_data_file_paths(), and test_config_settings().
Definition at line 166 of file initdb.c.
Referenced by main(), and setup_data_file_paths().
|
static |
Definition at line 229 of file initdb.c.
Referenced by initialize_data_directory().
Definition at line 186 of file initdb.c.
Referenced by checkLevel(), cleanup_directories_atexit(), ClockSweepTick(), do_connect(), do_copy(), dsm_impl_mmap(), exec_command_a(), exec_command_C(), exec_command_cd(), exec_command_connect(), exec_command_copy(), exec_command_d(), exec_command_dfo(), exec_command_elif(), exec_command_else(), exec_command_endif(), exec_command_f(), exec_command_getenv(), exec_command_html(), exec_command_include(), exec_command_list(), exec_command_lo(), exec_command_out(), exec_command_password(), exec_command_prompt(), exec_command_pset(), exec_command_s(), exec_command_set(), exec_command_setenv(), exec_command_shell_escape(), exec_command_t(), exec_command_T(), exec_command_timing(), exec_command_unset(), exec_command_watch(), exec_command_x(), exec_command_z(), ExecPartitionCheck(), ExecQueryAndProcessResults(), ExecQueryTuples(), HandleCopyResult(), is_true_boolean_expression(), main(), MainLoop(), parse_lsn(), parse_tli(), PostmasterMain(), PredicateLockPageSplit(), PrintQueryResult(), process_command_g_options(), ProcessProcSignalBarrier(), RegisterDynamicBackgroundWorker(), SetResultVariables(), SharedFileSetAttach(), StoreQueryTuple(), vacuumlo(), and winsock_strerror().
|
static |
Definition at line 156 of file initdb.c.
Referenced by get_su_pwd(), and setup_auth().
|
static |
Definition at line 170 of file initdb.c.
Referenced by _allocAH(), CreateArchive(), main(), parse_sync_method(), and sync_target_dir().
|
static |
Definition at line 183 of file initdb.c.
Referenced by initialize_data_directory(), and setup_data_file_paths().
|
static |
Definition at line 184 of file initdb.c.
Referenced by initialize_data_directory(), and setup_data_file_paths().
|
static |
Definition at line 185 of file initdb.c.
Referenced by initialize_data_directory(), and setup_data_file_paths().
|
static |
Definition at line 843 of file initdb.c.
Referenced by find_matching_ts_config().
|
static |
Definition at line 153 of file initdb.c.
Referenced by BackgroundWorkerInitializeConnection(), bootstrap_template1(), check_password(), dumpUserConfig(), get_id(), get_object_address_defacl(), get_object_address_usermapping(), get_user_name(), getObjectDescription(), getObjectIdentityParts(), has_any_column_privilege_name_id(), has_column_privilege_name_id_attnum(), has_column_privilege_name_id_name(), has_database_privilege_name_id(), has_database_privilege_name_name(), has_foreign_data_wrapper_privilege_name_id(), has_foreign_data_wrapper_privilege_name_name(), has_function_privilege_name_id(), has_function_privilege_name_name(), has_language_privilege_name_id(), has_language_privilege_name_name(), has_largeobject_privilege_name_id(), has_parameter_privilege_name_name(), has_schema_privilege_name_id(), has_schema_privilege_name_name(), has_sequence_privilege_name_id(), has_server_privilege_name_id(), has_server_privilege_name_name(), has_table_privilege_name_id(), has_tablespace_privilege_name_id(), has_tablespace_privilege_name_name(), has_type_privilege_name_id(), has_type_privilege_name_name(), InitPostgres(), log_status_format(), main(), mock_scram_secret(), passwordFromFile(), pg_fe_getusername(), pg_has_role_name_id(), pg_has_role_name_name(), PostgresMain(), PostgresSingleUserMain(), process_pgfdw_appname(), prompt_for_password(), scram_mock_salt(), scram_verify_plain_password(), setup_auth(), setup_data_file_paths(), and setup_privileges().
|
static |
Definition at line 169 of file initdb.c.
Referenced by bootstrap_template1(), main(), and pretty_wal_size().
|
static |
Definition at line 168 of file initdb.c.
Referenced by cleanup_directories_atexit(), create_xlog_or_symlink(), and main().