69#define token_has_regexp(t) (t->regex != NULL)
70#define token_is_member_check(t) (!t->quoted && t->string[0] == '+')
71#define token_is_keyword(t, k) (!t->quoted && strcmp(t->string, k) == 0)
72#define token_matches(t, k) (strcmp(t->string, k) == 0)
73#define token_matches_insensitive(t,k) (pg_strcasecmp(t->string, k) == 0)
126 "UserAuthName[] must match the UserAuth enum");
131 int depth,
char **err_msg);
133 int elevel,
char **err_msg);
135 char **err_msg,
int elevel);
211 while ((
c = (*(*
lineptr)++)) !=
'\0')
301 char **err_msg,
int elevel)
309 if (
token->string[0] !=
'/')
326 errmsg(
"invalid regular expression \"%s\": %s",
328 errcontext(
"line %d of configuration file \"%s\"",
331 *err_msg =
psprintf(
"invalid regular expression \"%s\": %s",
379 int elevel,
int depth,
char **err_msg)
397 elevel, depth + 1, err_msg);
456 (
errmsg(
"skipping missing authentication file \"%s\"",
608 errmsg(
"could not open file \"%s\": maximum nesting depth exceeded",
611 *err_msg =
psprintf(
"could not open file \"%s\": maximum nesting depth exceeded",
623 errmsg(
"could not open file \"%s\": %m",
628 *err_msg =
psprintf(
"could not open file \"%s\": %m",
663 errcontext(
"line %d of configuration file \"%s\"",
689 int elevel,
int depth)
701 callback_arg.
linenum = line_number;
713 "tokenize_auth_file",
728 char *err_msg =
NULL;
746 buf.data[
buf.len - 1] ==
'\\')
749 buf.data[--
buf.len] =
'\0';
768 err_msg =
psprintf(
"could not read file \"%s\": %m",
780 elevel, depth, &err_msg);
813 elevel, depth + 1,
false, &err_msg);
844 elevel, depth + 1,
false, &err_msg);
870 else if (
strcmp(first->
string,
"include_if_exists") == 0)
874 elevel, depth + 1,
true, &err_msg);
905 callback_arg.
linenum = line_number;
1036 return (
a->sin_addr.s_addr ==
b->sin_addr.s_addr);
1044 for (
i = 0;
i < 16;
i++)
1045 if (
a->sin6_addr.s6_addr[
i] !=
b->sin6_addr.s6_addr[
i])
1057 if (pattern[0] ==
'.')
1059 size_t plen =
strlen(pattern);
1083 if (
port->remote_hostname_resolv < 0)
1087 if (!
port->remote_hostname)
1092 remote_hostname,
sizeof(remote_hostname),
1098 port->remote_hostname_resolv = -2;
1099 port->remote_hostname_errcode = ret;
1111 if (
port->remote_hostname_resolv == +1)
1119 port->remote_hostname_resolv = -2;
1120 port->remote_hostname_errcode = ret;
1127 if (
gai->ai_addr->sa_family ==
port->raddr.addr.ss_family)
1154 elog(
DEBUG2,
"pg_hba.conf host name \"%s\" rejected because address resolution did not return a match with IP address of client",
1157 port->remote_hostname_resolv = found ? +1 : -1;
1168 if (raddr->
addr.ss_family == addr->sa_family &&
1219 (
errmsg(
"error enumerating network interfaces: %m")));
1241#define INVALID_AUTH_OPTION(optname, validmethods) \
1244 (errcode(ERRCODE_CONFIG_FILE_ERROR), \
1246 errmsg("authentication option \"%s\" is only valid for authentication methods %s", \
1247 optname, _(validmethods)), \
1248 errcontext("line %d of configuration file \"%s\"", \
1249 line_num, file_name))); \
1250 *err_msg = psprintf("authentication option \"%s\" is only valid for authentication methods %s", \
1251 optname, validmethods); \
1255#define REQUIRE_AUTH_OPTION(methodval, optname, validmethods) \
1257 if (hbaline->auth_method != methodval) \
1258 INVALID_AUTH_OPTION(optname, validmethods); \
1261#define MANDATORY_AUTH_ARG(argvar, argname, authname) \
1263 if (argvar == NULL) { \
1265 (errcode(ERRCODE_CONFIG_FILE_ERROR), \
1266 errmsg("authentication method \"%s\" requires argument \"%s\" to be set", \
1267 authname, argname), \
1268 errcontext("line %d of configuration file \"%s\"", \
1269 line_num, file_name))); \
1270 *err_msg = psprintf("authentication method \"%s\" requires argument \"%s\" to be set", \
1271 authname, argname); \
1285#define IDENT_FIELD_ABSENT(field) \
1289 (errcode(ERRCODE_CONFIG_FILE_ERROR), \
1290 errmsg("missing entry at end of line"), \
1291 errcontext("line %d of configuration file \"%s\"", \
1292 line_num, file_name))); \
1293 *err_msg = pstrdup("missing entry at end of line"); \
1298#define IDENT_MULTI_VALUE(tokens) \
1300 if (tokens->length > 1) { \
1302 (errcode(ERRCODE_CONFIG_FILE_ERROR), \
1303 errmsg("multiple values in ident field"), \
1304 errcontext("line %d of configuration file \"%s\"", \
1305 line_num, file_name))); \
1306 *err_msg = pstrdup("multiple values in ident field"); \
1328 char *file_name =
tok_line->file_name;
1329 char **err_msg = &
tok_line->err_msg;
1355 errmsg(
"multiple values specified for connection type"),
1356 errhint(
"Specify exactly one connection type per line."),
1357 errcontext(
"line %d of configuration file \"%s\"",
1358 line_num, file_name)));
1359 *err_msg =
"multiple values specified for connection type";
1374 if (
token->string[4] ==
's')
1383 errmsg(
"hostssl record cannot match because SSL is disabled"),
1384 errhint(
"Set \"ssl = on\" in postgresql.conf."),
1385 errcontext(
"line %d of configuration file \"%s\"",
1386 line_num, file_name)));
1387 *err_msg =
"hostssl record cannot match because SSL is disabled";
1392 errmsg(
"hostssl record cannot match because SSL is not supported by this build"),
1393 errcontext(
"line %d of configuration file \"%s\"",
1394 line_num, file_name)));
1395 *err_msg =
"hostssl record cannot match because SSL is not supported by this build";
1398 else if (
token->string[4] ==
'g')
1404 errmsg(
"hostgssenc record cannot match because GSSAPI is not supported by this build"),
1405 errcontext(
"line %d of configuration file \"%s\"",
1406 line_num, file_name)));
1407 *err_msg =
"hostgssenc record cannot match because GSSAPI is not supported by this build";
1410 else if (
token->string[4] ==
'n' &&
token->string[6] ==
's')
1412 else if (
token->string[4] ==
'n' &&
token->string[6] ==
'g')
1424 errmsg(
"invalid connection type \"%s\"",
1426 errcontext(
"line %d of configuration file \"%s\"",
1427 line_num, file_name)));
1428 *err_msg =
psprintf(
"invalid connection type \"%s\"",
token->string);
1438 errmsg(
"end-of-line before database specification"),
1439 errcontext(
"line %d of configuration file \"%s\"",
1440 line_num, file_name)));
1441 *err_msg =
"end-of-line before database specification";
1463 errmsg(
"end-of-line before role specification"),
1464 errcontext(
"line %d of configuration file \"%s\"",
1465 line_num, file_name)));
1466 *err_msg =
"end-of-line before role specification";
1490 errmsg(
"end-of-line before IP address specification"),
1491 errcontext(
"line %d of configuration file \"%s\"",
1492 line_num, file_name)));
1493 *err_msg =
"end-of-line before IP address specification";
1501 errmsg(
"multiple values specified for host address"),
1502 errhint(
"Specify one address range per line."),
1503 errcontext(
"line %d of configuration file \"%s\"",
1504 line_num, file_name)));
1505 *err_msg =
"multiple values specified for host address";
1540 hints.ai_socktype = 0;
1541 hints.ai_protocol = 0;
1542 hints.ai_addrlen = 0;
1560 errmsg(
"invalid IP address \"%s\": %s",
1562 errcontext(
"line %d of configuration file \"%s\"",
1563 line_num, file_name)));
1564 *err_msg =
psprintf(
"invalid IP address \"%s\": %s",
1580 errmsg(
"specifying both host name and CIDR mask is invalid: \"%s\"",
1582 errcontext(
"line %d of configuration file \"%s\"",
1583 line_num, file_name)));
1584 *err_msg =
psprintf(
"specifying both host name and CIDR mask is invalid: \"%s\"",
1594 errmsg(
"invalid CIDR mask in address \"%s\"",
1596 errcontext(
"line %d of configuration file \"%s\"",
1597 line_num, file_name)));
1598 *err_msg =
psprintf(
"invalid CIDR mask in address \"%s\"",
1614 errmsg(
"end-of-line before netmask specification"),
1615 errhint(
"Specify an address range in CIDR notation, or provide a separate netmask."),
1616 errcontext(
"line %d of configuration file \"%s\"",
1617 line_num, file_name)));
1618 *err_msg =
"end-of-line before netmask specification";
1626 errmsg(
"multiple values specified for netmask"),
1627 errcontext(
"line %d of configuration file \"%s\"",
1628 line_num, file_name)));
1629 *err_msg =
"multiple values specified for netmask";
1640 errmsg(
"invalid IP mask \"%s\": %s",
1642 errcontext(
"line %d of configuration file \"%s\"",
1643 line_num, file_name)));
1644 *err_msg =
psprintf(
"invalid IP mask \"%s\": %s",
1660 errmsg(
"IP address and mask do not match"),
1661 errcontext(
"line %d of configuration file \"%s\"",
1662 line_num, file_name)));
1663 *err_msg =
"IP address and mask do not match";
1676 errmsg(
"end-of-line before authentication method"),
1677 errcontext(
"line %d of configuration file \"%s\"",
1678 line_num, file_name)));
1679 *err_msg =
"end-of-line before authentication method";
1687 errmsg(
"multiple values specified for authentication type"),
1688 errhint(
"Specify exactly one authentication type per line."),
1689 errcontext(
"line %d of configuration file \"%s\"",
1690 line_num, file_name)));
1691 *err_msg =
"multiple values specified for authentication type";
1721 else if (
strcmp(
token->string,
"scram-sha-256") == 0)
1755 errmsg(
"invalid authentication method \"%s\"",
1757 errcontext(
"line %d of configuration file \"%s\"",
1758 line_num, file_name)));
1759 *err_msg =
psprintf(
"invalid authentication method \"%s\"",
1768 errmsg(
"invalid authentication method \"%s\": not supported by this build",
1770 errcontext(
"line %d of configuration file \"%s\"",
1771 line_num, file_name)));
1772 *err_msg =
psprintf(
"invalid authentication method \"%s\": not supported by this build",
1791 errmsg(
"gssapi authentication is not supported on local sockets"),
1792 errcontext(
"line %d of configuration file \"%s\"",
1793 line_num, file_name)));
1794 *err_msg =
"gssapi authentication is not supported on local sockets";
1803 errmsg(
"peer authentication is only supported on local sockets"),
1804 errcontext(
"line %d of configuration file \"%s\"",
1805 line_num, file_name)));
1806 *err_msg =
"peer authentication is only supported on local sockets";
1821 errmsg(
"cert authentication is only supported on hostssl connections"),
1822 errcontext(
"line %d of configuration file \"%s\"",
1823 line_num, file_name)));
1824 *err_msg =
"cert authentication is only supported on hostssl connections";
1871 errmsg(
"authentication option not in name=value format: %s",
token->string),
1872 errcontext(
"line %d of configuration file \"%s\"",
1873 line_num, file_name)));
1874 *err_msg =
psprintf(
"authentication option not in name=value format: %s",
1893#ifndef HAVE_LDAP_INITIALIZE
1915 errmsg(
"cannot mix options for simple bind and search+bind modes"),
1916 errcontext(
"line %d of configuration file \"%s\"",
1917 line_num, file_name)));
1918 *err_msg =
"cannot mix options for simple bind and search+bind modes";
1926 errmsg(
"authentication method \"ldap\" requires argument \"ldapbasedn\", \"ldapprefix\", or \"ldapsuffix\" to be set"),
1927 errcontext(
"line %d of configuration file \"%s\"",
1928 line_num, file_name)));
1929 *err_msg =
"authentication method \"ldap\" requires argument \"ldapbasedn\", \"ldapprefix\", or \"ldapsuffix\" to be set";
1942 errmsg(
"cannot use ldapsearchattribute together with ldapsearchfilter"),
1943 errcontext(
"line %d of configuration file \"%s\"",
1944 line_num, file_name)));
1945 *err_msg =
"cannot use ldapsearchattribute together with ldapsearchfilter";
1959 errmsg(
"list of RADIUS servers cannot be empty"),
1960 errcontext(
"line %d of configuration file \"%s\"",
1961 line_num, file_name)));
1962 *err_msg =
"list of RADIUS servers cannot be empty";
1970 errmsg(
"list of RADIUS secrets cannot be empty"),
1971 errcontext(
"line %d of configuration file \"%s\"",
1972 line_num, file_name)));
1973 *err_msg =
"list of RADIUS secrets cannot be empty";
1987 errmsg(
"the number of RADIUS secrets (%d) must be 1 or the same as the number of RADIUS servers (%d)",
1990 errcontext(
"line %d of configuration file \"%s\"",
1991 line_num, file_name)));
1992 *err_msg =
psprintf(
"the number of RADIUS secrets (%d) must be 1 or the same as the number of RADIUS servers (%d)",
2003 errmsg(
"the number of RADIUS ports (%d) must be 1 or the same as the number of RADIUS servers (%d)",
2006 errcontext(
"line %d of configuration file \"%s\"",
2007 line_num, file_name)));
2008 *err_msg =
psprintf(
"the number of RADIUS ports (%d) must be 1 or the same as the number of RADIUS servers (%d)",
2019 errmsg(
"the number of RADIUS identifiers (%d) must be 1 or the same as the number of RADIUS servers (%d)",
2022 errcontext(
"line %d of configuration file \"%s\"",
2023 line_num, file_name)));
2024 *err_msg =
psprintf(
"the number of RADIUS identifiers (%d) must be 1 or the same as the number of RADIUS servers (%d)",
2064 errmsg(
"%s cannot be used in combination with %s",
2065 "map",
"delegate_ident_mapping"),
2066 errcontext(
"line %d of configuration file \"%s\"",
2067 line_num, file_name));
2068 *err_msg =
"map cannot be used in combination with delegate_ident_mapping";
2085 int elevel,
char **err_msg)
2087 int line_num =
hbaline->linenumber;
2088 char *file_name =
hbaline->sourcefile;
2111 errmsg(
"clientcert can only be configured for \"hostssl\" rows"),
2112 errcontext(
"line %d of configuration file \"%s\"",
2113 line_num, file_name)));
2114 *err_msg =
"clientcert can only be configured for \"hostssl\" rows";
2128 errmsg(
"clientcert only accepts \"verify-full\" when using \"cert\" authentication"),
2129 errcontext(
"line %d of configuration file \"%s\"",
2130 line_num, file_name)));
2131 *err_msg =
"clientcert can only be set to \"verify-full\" when using \"cert\" authentication";
2141 errmsg(
"invalid value for clientcert: \"%s\"",
val),
2142 errcontext(
"line %d of configuration file \"%s\"",
2143 line_num, file_name)));
2153 errmsg(
"clientname can only be configured for \"hostssl\" rows"),
2154 errcontext(
"line %d of configuration file \"%s\"",
2155 line_num, file_name)));
2156 *err_msg =
"clientname can only be configured for \"hostssl\" rows";
2172 errmsg(
"invalid value for clientname: \"%s\"",
val),
2173 errcontext(
"line %d of configuration file \"%s\"",
2174 line_num, file_name)));
2183 else if (
strcmp(
name,
"pam_use_hostname") == 0)
2187 hbaline->pam_use_hostname =
true;
2189 hbaline->pam_use_hostname =
false;
2193#ifdef LDAP_API_FEATURE_X_OPENLDAP
2199#ifdef LDAP_API_FEATURE_X_OPENLDAP
2206 *err_msg =
psprintf(
"could not parse LDAP URL \"%s\": %s",
2216 errmsg(
"unsupported LDAP URL scheme: %s",
urldata->lud_scheme)));
2217 *err_msg =
psprintf(
"unsupported LDAP URL scheme: %s",
2240 errmsg(
"LDAP URLs not supported on this platform")));
2241 *err_msg =
"LDAP URLs not supported on this platform";
2258 errmsg(
"invalid ldapscheme value: \"%s\"",
val),
2259 errcontext(
"line %d of configuration file \"%s\"",
2260 line_num, file_name)));
2276 errmsg(
"invalid LDAP port number: \"%s\"",
val),
2277 errcontext(
"line %d of configuration file \"%s\"",
2278 line_num, file_name)));
2279 *err_msg =
psprintf(
"invalid LDAP port number: \"%s\"",
val);
2288 else if (
strcmp(
name,
"ldapbindpasswd") == 0)
2293 else if (
strcmp(
name,
"ldapsearchattribute") == 0)
2298 else if (
strcmp(
name,
"ldapsearchfilter") == 0)
2331 hbaline->include_realm =
true;
2333 hbaline->include_realm =
false;
2342 hbaline->compat_realm =
false;
2351 hbaline->upn_username =
false;
2369 errmsg(
"could not parse RADIUS server list \"%s\"",
2371 errcontext(
"line %d of configuration file \"%s\"",
2372 line_num, file_name)));
2388 errmsg(
"could not translate RADIUS server name \"%s\" to address: %s",
2390 errcontext(
"line %d of configuration file \"%s\"",
2391 line_num, file_name)));
2417 errmsg(
"could not parse RADIUS port list \"%s\"",
2419 errcontext(
"line %d of configuration file \"%s\"",
2420 line_num, file_name)));
2421 *err_msg =
psprintf(
"invalid RADIUS port number: \"%s\"",
val);
2431 errmsg(
"invalid RADIUS port number: \"%s\"",
val),
2432 errcontext(
"line %d of configuration file \"%s\"",
2433 line_num, file_name)));
2453 errmsg(
"could not parse RADIUS secret list \"%s\"",
2455 errcontext(
"line %d of configuration file \"%s\"",
2456 line_num, file_name)));
2463 else if (
strcmp(
name,
"radiusidentifiers") == 0)
2475 errmsg(
"could not parse RADIUS identifiers list \"%s\"",
2477 errcontext(
"line %d of configuration file \"%s\"",
2478 line_num, file_name)));
2500 else if (
strcmp(
name,
"delegate_ident_mapping") == 0)
2504 hbaline->oauth_skip_usermap =
true;
2506 hbaline->oauth_skip_usermap =
false;
2512 errmsg(
"unrecognized authentication option name: \"%s\"",
2514 errcontext(
"line %d of configuration file \"%s\"",
2515 line_num, file_name)));
2516 *err_msg =
psprintf(
"unrecognized authentication option name: \"%s\"",
2553 if (
port->ssl_in_use)
2571 else if (!(
port->gss &&
port->gss->enc) &&
2664 "hba parser context",
2704 errmsg(
"configuration file \"%s\" contains no entries",
2751 char *file_name =
tok_line->file_name;
2752 char **err_msg = &
tok_line->err_msg;
2857 errmsg(
"regular expression match for \"%s\" failed: %s",
2884 errmsg(
"regular expression \"%s\" has no subexpressions as requested by backreference in \"%s\"",
2982 const char *pg_user,
3002 (
errmsg(
"provided user name (%s) and authenticated user name (%s) do not match",
3022 (
errmsg(
"no match in usermap \"%s\" for user \"%s\" authenticated as \"%s\"",
3060 "ident parser context",
bool is_member_of_role_nosuper(Oid member, Oid role)
Oid get_role_oid(const char *rolname, bool missing_ok)
bool check_oauth_validator(HbaLine *hbaline, int elevel, char **err_msg)
#define IS_HIGHBIT_SET(ch)
#define Assert(condition)
#define MemSet(start, val, len)
#define StaticAssertDecl(condition, errmessage)
#define OidIsValid(objectId)
char * AbsoluteConfigLocation(const char *location, const char *calling_file)
char ** GetConfFilesInDir(const char *includedir, const char *calling_file, int elevel, int *num_filenames, char **err_msg)
#define CONF_FILE_MAX_DEPTH
#define CONF_FILE_START_DEPTH
int errcode_for_file_access(void)
ErrorContextCallback * error_context_stack
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
FILE * AllocateFile(const char *name, const char *mode)
#define palloc0_object(type)
static AuthToken * make_auth_token(const char *token, bool quoted)
#define MANDATORY_AUTH_ARG(argvar, argname, authname)
static bool is_member(Oid userid, const char *role)
static bool check_role(const char *role, Oid roleid, List *tokens, bool case_insensitive)
static bool check_hostname(Port *port, const char *hostname)
static bool pg_isblank(const char c)
HbaLine * parse_hba_line(TokenizedAuthLine *tok_line, int elevel)
static bool hostname_match(const char *pattern, const char *actual_hostname)
static bool check_ip(SockAddr *raddr, struct sockaddr *addr, struct sockaddr *mask)
#define token_is_member_check(t)
#define IDENT_FIELD_ABSENT(field)
#define token_is_keyword(t, k)
static bool ipv4eq(struct sockaddr_in *a, struct sockaddr_in *b)
static List * next_field_expand(const char *filename, char **lineptr, int elevel, int depth, char **err_msg)
static MemoryContext parsed_ident_context
#define token_matches_insensitive(t, k)
static bool parse_hba_auth_opt(char *name, char *val, HbaLine *hbaline, int elevel, char **err_msg)
static bool check_same_host_or_net(SockAddr *raddr, IPCompareMethod method)
static int regcomp_auth_token(AuthToken *token, char *filename, int line_num, char **err_msg, int elevel)
static MemoryContext tokenize_context
static int regexec_auth_token(const char *match, AuthToken *token, size_t nmatch, regmatch_t pmatch[])
static void tokenize_include_file(const char *outer_filename, const char *inc_filename, List **tok_lines, int elevel, int depth, bool missing_ok, char **err_msg)
static void tokenize_error_callback(void *arg)
static void check_network_callback(struct sockaddr *addr, struct sockaddr *netmask, void *cb_data)
#define token_has_regexp(t)
static MemoryContext parsed_hba_context
static AuthToken * copy_auth_token(AuthToken *in)
#define IDENT_MULTI_VALUE(tokens)
IdentLine * parse_ident_line(TokenizedAuthLine *tok_line, int elevel)
int check_usermap(const char *usermap_name, const char *pg_user, const char *system_user, bool case_insensitive)
void free_auth_file(FILE *file, int depth)
static bool ipv6eq(struct sockaddr_in6 *a, struct sockaddr_in6 *b)
static List * tokenize_expand_file(List *tokens, const char *outer_filename, const char *inc_filename, int elevel, int depth, char **err_msg)
static void free_auth_token(AuthToken *token)
static List * parsed_ident_lines
static const char *const UserAuthName[]
#define token_matches(t, k)
static bool next_token(char **lineptr, StringInfo buf, bool *initial_quote, bool *terminating_comma)
static List * parsed_hba_lines
#define INVALID_AUTH_OPTION(optname, validmethods)
void hba_getauthmethod(Port *port)
static void check_hba(Port *port)
void tokenize_auth_file(const char *filename, FILE *file, List **tok_lines, int elevel, int depth)
static void check_ident_usermap(IdentLine *identLine, const char *usermap_name, const char *pg_user, const char *system_user, bool case_insensitive, bool *found_p, bool *error_p)
static bool check_db(const char *dbname, const char *role, Oid roleid, List *tokens)
const char * hba_authname(UserAuth auth_method)
#define REQUIRE_AUTH_OPTION(methodval, optname, validmethods)
FILE * open_auth_file(const char *filename, int elevel, int depth, char **err_msg)
int pg_sockaddr_cidr_mask(struct sockaddr_storage *mask, char *numbits, int family)
int pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data)
int pg_range_sockaddr(const struct sockaddr_storage *addr, const struct sockaddr_storage *netaddr, const struct sockaddr_storage *netmask)
void pg_freeaddrinfo_all(int hint_ai_family, struct addrinfo *ai)
int pg_getnameinfo_all(const struct sockaddr_storage *addr, int salen, char *node, int nodelen, char *service, int servicelen, int flags)
int pg_getaddrinfo_all(const char *hostname, const char *servname, const struct addrinfo *hintp, struct addrinfo **result)
List * lappend(List *list, void *datum)
void list_free(List *list)
int pg_mb2wchar_with_len(const char *from, pg_wchar *to, int len)
char * pstrdup(const char *in)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
MemoryContext PostmasterContext
void MemoryContextDelete(MemoryContext context)
#define AllocSetContextCreate
#define ALLOCSET_START_SMALL_SIZES
#define ALLOCSET_SMALL_SIZES
Datum system_user(PG_FUNCTION_ARGS)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
bool pg_get_line_append(FILE *stream, StringInfo buf, PromptInterruptContext *prompt_ctx)
static int list_length(const List *l)
#define linitial_node(type, l)
#define lsecond_node(type, l)
static ListCell * list_head(const List *l)
static ListCell * lnext(const List *l, const ListCell *c)
static char buf[DEFAULT_XLOG_SEG_SIZE]
int pg_strcasecmp(const char *s1, const char *s2)
char * psprintf(const char *fmt,...)
int pg_regcomp(regex_t *re, const chr *string, size_t len, int flags, Oid collation)
size_t pg_regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
int pg_regexec(regex_t *re, const chr *string, size_t len, size_t search_start, rm_detail_t *details, size_t nmatch, regmatch_t pmatch[], int flags)
void pg_regfree(regex_t *re)
const char * gai_strerror(int errcode)
int pg_strip_crlf(char *str)
void resetStringInfo(StringInfo str)
void appendStringInfoString(StringInfo str, const char *s)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
struct ErrorContextCallback * previous
struct sockaddr_storage mask
struct sockaddr_storage addr
IPCompareMethod ip_cmp_method
struct sockaddr_storage addr
bool SplitGUCList(char *rawstring, char separator, List **namelist)