diff options
Diffstat (limited to 'src/backend/utils')
-rw-r--r-- | src/backend/utils/adt/json.c | 72 | ||||
-rw-r--r-- | src/backend/utils/cache/relcache.c | 2 | ||||
-rw-r--r-- | src/backend/utils/error/elog.c | 16 | ||||
-rw-r--r-- | src/backend/utils/misc/guc.c | 2 | ||||
-rw-r--r-- | src/backend/utils/misc/postgresql.conf.sample | 4 |
5 files changed, 47 insertions, 49 deletions
diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c index 7685410f185..d8ebf4e0029 100644 --- a/src/backend/utils/adt/json.c +++ b/src/backend/utils/adt/json.c @@ -1786,7 +1786,7 @@ escape_json(StringInfo buf, const char *str) * * Returns the type of the outermost JSON value as TEXT. Possible types are * "object", "array", "string", "number", "boolean", and "null". - * + * * Performs a single call to json_lex() to get the first token of the supplied * value. This initial token uniquely determines the value's type. As our * input must already have been validated by json_in() or json_recv(), the @@ -1796,39 +1796,39 @@ escape_json(StringInfo buf, const char *str) Datum json_typeof(PG_FUNCTION_ARGS) { - text *json = PG_GETARG_TEXT_P(0); - - JsonLexContext *lex = makeJsonLexContext(json, false); - JsonTokenType tok; - char *type; - - /* Lex exactly one token from the input and check its type. */ - json_lex(lex); - tok = lex_peek(lex); - switch (tok) - { - case JSON_TOKEN_OBJECT_START: - type = "object"; - break; - case JSON_TOKEN_ARRAY_START: - type = "array"; - break; - case JSON_TOKEN_STRING: - type = "string"; - break; - case JSON_TOKEN_NUMBER: - type = "number"; - break; - case JSON_TOKEN_TRUE: - case JSON_TOKEN_FALSE: - type = "boolean"; - break; - case JSON_TOKEN_NULL: - type = "null"; - break; - default: - elog(ERROR, "unexpected json token: %d", tok); - } - - PG_RETURN_TEXT_P(cstring_to_text(type)); + text *json = PG_GETARG_TEXT_P(0); + + JsonLexContext *lex = makeJsonLexContext(json, false); + JsonTokenType tok; + char *type; + + /* Lex exactly one token from the input and check its type. */ + json_lex(lex); + tok = lex_peek(lex); + switch (tok) + { + case JSON_TOKEN_OBJECT_START: + type = "object"; + break; + case JSON_TOKEN_ARRAY_START: + type = "array"; + break; + case JSON_TOKEN_STRING: + type = "string"; + break; + case JSON_TOKEN_NUMBER: + type = "number"; + break; + case JSON_TOKEN_TRUE: + case JSON_TOKEN_FALSE: + type = "boolean"; + break; + case JSON_TOKEN_NULL: + type = "null"; + break; + default: + elog(ERROR, "unexpected json token: %d", tok); + } + + PG_RETURN_TEXT_P(cstring_to_text(type)); } diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 9d8caffcacc..d0acca871e3 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -2667,7 +2667,7 @@ RelationBuildLocalRelation(const char *relname, /* system relations and non-table objects don't have one */ if (!IsSystemNamespace(relnamespace) && - (relkind == RELKIND_RELATION || relkind == RELKIND_MATVIEW)) + (relkind == RELKIND_RELATION || relkind == RELKIND_MATVIEW)) rel->rd_rel->relreplident = REPLICA_IDENTITY_DEFAULT; else rel->rd_rel->relreplident = REPLICA_IDENTITY_NOTHING; diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index 31667f4d677..e648792d22e 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -2142,7 +2142,6 @@ process_log_prefix_padding(const char *p, int *ppadding) return NULL; paddingsign = -1; } - /* generate an int version of the numerical string */ while (*p >= '0' && *p <= '9') @@ -2169,7 +2168,7 @@ log_line_prefix(StringInfo buf, ErrorData *edata) /* has counter been reset in current process? */ static int log_my_pid = 0; int padding; - const char *p; + const char *p; /* * This is one of the few places where we'd rather not inherit a static @@ -2284,7 +2283,7 @@ log_line_prefix(StringInfo buf, ErrorData *edata) if (padding != 0) { char strfbuf[128]; - snprintf(strfbuf, sizeof(strfbuf) - 1, "%lx.%x", + snprintf(strfbuf, sizeof(strfbuf) - 1, "%lx.%x", (long) (MyStartTime), MyProcPid); appendStringInfo(buf, "%*s", padding, strfbuf); } @@ -2352,13 +2351,13 @@ log_line_prefix(StringInfo buf, ErrorData *edata) case 'r': if (MyProcPort && MyProcPort->remote_host) { - if (padding != 0) + if (padding != 0) { if (MyProcPort->remote_port && MyProcPort->remote_port[0] != '\0') { - /* + /* * This option is slightly special as the port number - * may be appended onto the end. Here we need to build + * may be appended onto the end. Here we need to build * 1 string which contains the remote_host and optionally * the remote_port (if set) so we can properly align the * string. @@ -2371,7 +2370,6 @@ log_line_prefix(StringInfo buf, ErrorData *edata) } else appendStringInfo(buf, "%*s", padding, MyProcPort->remote_host); - } else { @@ -2379,7 +2377,7 @@ log_line_prefix(StringInfo buf, ErrorData *edata) appendStringInfoString(buf, MyProcPort->remote_host); if (MyProcPort->remote_port && MyProcPort->remote_port[0] != '\0') - appendStringInfo(buf, "(%s)", + appendStringInfo(buf, "(%s)", MyProcPort->remote_port); } @@ -2389,7 +2387,7 @@ log_line_prefix(StringInfo buf, ErrorData *edata) padding > 0 ? padding : -padding); break; case 'h': - if (MyProcPort && MyProcPort->remote_host) + if (MyProcPort && MyProcPort->remote_host) { if (padding != 0) appendStringInfo(buf, "%*s", padding, MyProcPort->remote_host); diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 538d027606b..54d8078fe7a 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -4250,7 +4250,7 @@ SelectConfigFiles(const char *userDoption, const char *progname) pg_timezone_abbrev_initialize(); set_default_effective_cache_size(); - + /* * Figure out where pg_hba.conf is, and make sure the path is absolute. */ diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index 707edf1d91d..34a2d05d39e 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -370,12 +370,12 @@ # panic #log_min_error_statement = error # values in order of decreasing detail: - # debug5 + # debug5 # debug4 # debug3 # debug2 # debug1 - # info + # info # notice # warning # error |