aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r--src/backend/utils/adt/acl.c6
-rw-r--r--src/backend/utils/adt/dbsize.c14
-rw-r--r--src/backend/utils/adt/genfile.c13
-rw-r--r--src/backend/utils/adt/lockfuncs.c8
-rw-r--r--src/backend/utils/adt/mcxtfuncs.c14
-rw-r--r--src/backend/utils/adt/name.c2
-rw-r--r--src/backend/utils/adt/pg_locale.c10
-rw-r--r--src/backend/utils/adt/rangetypes_typanalyze.c2
-rw-r--r--src/backend/utils/adt/ri_triggers.c4
-rw-r--r--src/backend/utils/adt/rowtypes.c8
-rw-r--r--src/backend/utils/adt/ruleutils.c57
-rw-r--r--src/backend/utils/adt/selfuncs.c16
-rw-r--r--src/backend/utils/adt/timestamp.c8
-rw-r--r--src/backend/utils/adt/varlena.c2
14 files changed, 82 insertions, 82 deletions
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c
index 7861a0a613a..67f8b29434a 100644
--- a/src/backend/utils/adt/acl.c
+++ b/src/backend/utils/adt/acl.c
@@ -2453,9 +2453,9 @@ column_privilege_check(Oid tableoid, AttrNumber attnum,
return -1;
/*
- * Check for column-level privileges first. This serves in
- * part as a check on whether the column even exists, so we
- * need to do it before checking table-level privilege.
+ * Check for column-level privileges first. This serves in part as a check
+ * on whether the column even exists, so we need to do it before checking
+ * table-level privilege.
*/
aclresult = pg_attribute_aclcheck_ext(tableoid, attnum, roleid,
mode, &is_missing);
diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c
index da1a879f1f6..3c70bb59433 100644
--- a/src/backend/utils/adt/dbsize.c
+++ b/src/backend/utils/adt/dbsize.c
@@ -867,7 +867,7 @@ pg_relation_filenode(PG_FUNCTION_ARGS)
{
if (relform->relfilenode)
result = relform->relfilenode;
- else /* Consult the relation mapper */
+ else /* Consult the relation mapper */
result = RelationMapOidToFilenode(relid,
relform->relisshared);
}
@@ -946,17 +946,17 @@ pg_relation_filepath(PG_FUNCTION_ARGS)
rnode.dbNode = MyDatabaseId;
if (relform->relfilenode)
rnode.relNode = relform->relfilenode;
- else /* Consult the relation mapper */
+ else /* Consult the relation mapper */
rnode.relNode = RelationMapOidToFilenode(relid,
relform->relisshared);
}
else
{
- /* no storage, return NULL */
- rnode.relNode = InvalidOid;
- /* some compilers generate warnings without these next two lines */
- rnode.dbNode = InvalidOid;
- rnode.spcNode = InvalidOid;
+ /* no storage, return NULL */
+ rnode.relNode = InvalidOid;
+ /* some compilers generate warnings without these next two lines */
+ rnode.dbNode = InvalidOid;
+ rnode.spcNode = InvalidOid;
}
if (!OidIsValid(rnode.relNode))
diff --git a/src/backend/utils/adt/genfile.c b/src/backend/utils/adt/genfile.c
index 322152ebd97..c436d9318b6 100644
--- a/src/backend/utils/adt/genfile.c
+++ b/src/backend/utils/adt/genfile.c
@@ -160,16 +160,15 @@ read_binary_file(const char *filename, int64 seek_offset, int64 bytes_to_read,
#define MIN_READ_SIZE 4096
/*
- * If not at end of file, and sbuf.len is equal to
- * MaxAllocSize - 1, then either the file is too large, or
- * there is nothing left to read. Attempt to read one more
- * byte to see if the end of file has been reached. If not,
- * the file is too large; we'd rather give the error message
- * for that ourselves.
+ * If not at end of file, and sbuf.len is equal to MaxAllocSize -
+ * 1, then either the file is too large, or there is nothing left
+ * to read. Attempt to read one more byte to see if the end of
+ * file has been reached. If not, the file is too large; we'd
+ * rather give the error message for that ourselves.
*/
if (sbuf.len == MaxAllocSize - 1)
{
- char rbuf[1];
+ char rbuf[1];
if (fread(rbuf, 1, 1, file) != 0 || !feof(file))
ereport(ERROR,
diff --git a/src/backend/utils/adt/lockfuncs.c b/src/backend/utils/adt/lockfuncs.c
index 97f0265c12d..085fec3ea20 100644
--- a/src/backend/utils/adt/lockfuncs.c
+++ b/src/backend/utils/adt/lockfuncs.c
@@ -636,10 +636,10 @@ pg_isolation_test_session_is_blocked(PG_FUNCTION_ARGS)
* Check if any of these are in the list of interesting PIDs, that being
* the sessions that the isolation tester is running. We don't use
* "arrayoverlaps" here, because it would lead to cache lookups and one of
- * our goals is to run quickly with debug_invalidate_system_caches_always > 0. We expect
- * blocking_pids to be usually empty and otherwise a very small number in
- * isolation tester cases, so make that the outer loop of a naive search
- * for a match.
+ * our goals is to run quickly with debug_invalidate_system_caches_always
+ * > 0. We expect blocking_pids to be usually empty and otherwise a very
+ * small number in isolation tester cases, so make that the outer loop of
+ * a naive search for a match.
*/
for (i = 0; i < num_blocking_pids; i++)
for (j = 0; j < num_interesting_pids; j++)
diff --git a/src/backend/utils/adt/mcxtfuncs.c b/src/backend/utils/adt/mcxtfuncs.c
index e2b87a7ed9f..2984768d199 100644
--- a/src/backend/utils/adt/mcxtfuncs.c
+++ b/src/backend/utils/adt/mcxtfuncs.c
@@ -34,8 +34,8 @@
*/
static void
PutMemoryContextsStatsTupleStore(Tuplestorestate *tupstore,
- TupleDesc tupdesc, MemoryContext context,
- const char *parent, int level)
+ TupleDesc tupdesc, MemoryContext context,
+ const char *parent, int level)
{
#define PG_GET_BACKEND_MEMORY_CONTEXTS_COLS 9
@@ -52,8 +52,8 @@ PutMemoryContextsStatsTupleStore(Tuplestorestate *tupstore,
ident = context->ident;
/*
- * To be consistent with logging output, we label dynahash contexts
- * with just the hash table name as with MemoryContextStatsPrint().
+ * To be consistent with logging output, we label dynahash contexts with
+ * just the hash table name as with MemoryContextStatsPrint().
*/
if (ident && strcmp(name, "dynahash") == 0)
{
@@ -75,7 +75,7 @@ PutMemoryContextsStatsTupleStore(Tuplestorestate *tupstore,
if (ident)
{
- int idlen = strlen(ident);
+ int idlen = strlen(ident);
char clipped_ident[MEMORY_CONTEXT_IDENT_DISPLAY_SIZE];
/*
@@ -108,7 +108,7 @@ PutMemoryContextsStatsTupleStore(Tuplestorestate *tupstore,
for (child = context->firstchild; child != NULL; child = child->nextchild)
{
PutMemoryContextsStatsTupleStore(tupstore, tupdesc,
- child, name, level + 1);
+ child, name, level + 1);
}
}
@@ -150,7 +150,7 @@ pg_get_backend_memory_contexts(PG_FUNCTION_ARGS)
MemoryContextSwitchTo(oldcontext);
PutMemoryContextsStatsTupleStore(tupstore, tupdesc,
- TopMemoryContext, NULL, 0);
+ TopMemoryContext, NULL, 0);
/* clean up and return the tuplestore */
tuplestore_donestoring(tupstore);
diff --git a/src/backend/utils/adt/name.c b/src/backend/utils/adt/name.c
index c93be3350ea..602a724d2f8 100644
--- a/src/backend/utils/adt/name.c
+++ b/src/backend/utils/adt/name.c
@@ -234,7 +234,7 @@ namestrcpy(Name name, const char *str)
{
/* NB: We need to zero-pad the destination. */
strncpy(NameStr(*name), str, NAMEDATALEN);
- NameStr(*name)[NAMEDATALEN-1] = '\0';
+ NameStr(*name)[NAMEDATALEN - 1] = '\0';
}
/*
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index caa09d6373e..453af401cab 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -1668,16 +1668,16 @@ get_collation_actual_version(char collprovider, const char *collcollate)
}
else
#endif
- if (collprovider == COLLPROVIDER_LIBC &&
- pg_strcasecmp("C", collcollate) != 0 &&
- pg_strncasecmp("C.", collcollate, 2) != 0 &&
- pg_strcasecmp("POSIX", collcollate) != 0)
+ if (collprovider == COLLPROVIDER_LIBC &&
+ pg_strcasecmp("C", collcollate) != 0 &&
+ pg_strncasecmp("C.", collcollate, 2) != 0 &&
+ pg_strcasecmp("POSIX", collcollate) != 0)
{
#if defined(__GLIBC__)
/* Use the glibc version because we don't have anything better. */
collversion = pstrdup(gnu_get_libc_version());
#elif defined(LC_VERSION_MASK)
- locale_t loc;
+ locale_t loc;
/* Look up FreeBSD collation version. */
loc = newlocale(LC_COLLATE, collcollate, NULL);
diff --git a/src/backend/utils/adt/rangetypes_typanalyze.c b/src/backend/utils/adt/rangetypes_typanalyze.c
index 2c10f2c867c..671fe6ddb7a 100644
--- a/src/backend/utils/adt/rangetypes_typanalyze.c
+++ b/src/backend/utils/adt/rangetypes_typanalyze.c
@@ -330,7 +330,7 @@ compute_range_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc,
stats->statypid[slot_idx] = typcache->type_id;
stats->statyplen[slot_idx] = typcache->typlen;
stats->statypbyval[slot_idx] = typcache->typbyval;
- stats->statypalign[slot_idx] = typcache->typalign;
+ stats->statypalign[slot_idx] = typcache->typalign;
slot_idx++;
}
diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c
index 7c77c338cec..96269fc2adb 100644
--- a/src/backend/utils/adt/ri_triggers.c
+++ b/src/backend/utils/adt/ri_triggers.c
@@ -394,8 +394,8 @@ RI_FKey_check(TriggerData *trigdata)
* Now check that foreign key exists in PK table
*
* XXX detectNewRows must be true when a partitioned table is on the
- * referenced side. The reason is that our snapshot must be fresh
- * in order for the hack in find_inheritance_children() to work.
+ * referenced side. The reason is that our snapshot must be fresh in
+ * order for the hack in find_inheritance_children() to work.
*/
ri_PerformCheck(riinfo, &qkey, qplan,
fk_rel, pk_rel,
diff --git a/src/backend/utils/adt/rowtypes.c b/src/backend/utils/adt/rowtypes.c
index 23787a6ae7d..1a71fdbc33f 100644
--- a/src/backend/utils/adt/rowtypes.c
+++ b/src/backend/utils/adt/rowtypes.c
@@ -1802,8 +1802,8 @@ hash_record(PG_FUNCTION_ARGS)
tuple.t_data = record;
/*
- * We arrange to look up the needed hashing info just once per series
- * of calls, assuming the record type doesn't change underneath us.
+ * We arrange to look up the needed hashing info just once per series of
+ * calls, assuming the record type doesn't change underneath us.
*/
my_extra = (RecordCompareData *) fcinfo->flinfo->fn_extra;
if (my_extra == NULL ||
@@ -1923,8 +1923,8 @@ hash_record_extended(PG_FUNCTION_ARGS)
tuple.t_data = record;
/*
- * We arrange to look up the needed hashing info just once per series
- * of calls, assuming the record type doesn't change underneath us.
+ * We arrange to look up the needed hashing info just once per series of
+ * calls, assuming the record type doesn't change underneath us.
*/
my_extra = (RecordCompareData *) fcinfo->flinfo->fn_extra;
if (my_extra == NULL ||
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 881e8ec03d2..84ad62caea3 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -2980,37 +2980,38 @@ pg_get_functiondef(PG_FUNCTION_ARGS)
}
else
{
- appendStringInfoString(&buf, "AS ");
+ appendStringInfoString(&buf, "AS ");
- tmp = SysCacheGetAttr(PROCOID, proctup, Anum_pg_proc_probin, &isnull);
- if (!isnull)
- {
- simple_quote_literal(&buf, TextDatumGetCString(tmp));
- appendStringInfoString(&buf, ", "); /* assume prosrc isn't null */
- }
+ tmp = SysCacheGetAttr(PROCOID, proctup, Anum_pg_proc_probin, &isnull);
+ if (!isnull)
+ {
+ simple_quote_literal(&buf, TextDatumGetCString(tmp));
+ appendStringInfoString(&buf, ", "); /* assume prosrc isn't null */
+ }
- tmp = SysCacheGetAttr(PROCOID, proctup, Anum_pg_proc_prosrc, &isnull);
- if (isnull)
- elog(ERROR, "null prosrc");
- prosrc = TextDatumGetCString(tmp);
+ tmp = SysCacheGetAttr(PROCOID, proctup, Anum_pg_proc_prosrc, &isnull);
+ if (isnull)
+ elog(ERROR, "null prosrc");
+ prosrc = TextDatumGetCString(tmp);
- /*
- * We always use dollar quoting. Figure out a suitable delimiter.
- *
- * Since the user is likely to be editing the function body string, we
- * shouldn't use a short delimiter that he might easily create a conflict
- * with. Hence prefer "$function$"/"$procedure$", but extend if needed.
- */
- initStringInfo(&dq);
- appendStringInfoChar(&dq, '$');
- appendStringInfoString(&dq, (isfunction ? "function" : "procedure"));
- while (strstr(prosrc, dq.data) != NULL)
- appendStringInfoChar(&dq, 'x');
- appendStringInfoChar(&dq, '$');
-
- appendBinaryStringInfo(&buf, dq.data, dq.len);
- appendStringInfoString(&buf, prosrc);
- appendBinaryStringInfo(&buf, dq.data, dq.len);
+ /*
+ * We always use dollar quoting. Figure out a suitable delimiter.
+ *
+ * Since the user is likely to be editing the function body string, we
+ * shouldn't use a short delimiter that he might easily create a
+ * conflict with. Hence prefer "$function$"/"$procedure$", but extend
+ * if needed.
+ */
+ initStringInfo(&dq);
+ appendStringInfoChar(&dq, '$');
+ appendStringInfoString(&dq, (isfunction ? "function" : "procedure"));
+ while (strstr(prosrc, dq.data) != NULL)
+ appendStringInfoChar(&dq, 'x');
+ appendStringInfoChar(&dq, '$');
+
+ appendBinaryStringInfo(&buf, dq.data, dq.len);
+ appendStringInfoString(&buf, prosrc);
+ appendBinaryStringInfo(&buf, dq.data, dq.len);
}
appendStringInfoChar(&buf, '\n');
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index 3d4304cce7a..37ddda77240 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -3446,10 +3446,10 @@ estimate_num_groups(PlannerInfo *root, List *groupExprs, double input_rows,
* XXX This has the consequence that if there's a statistics on the
* expression, we don't split it into individual Vars. This affects
* our selection of statistics in estimate_multivariate_ndistinct,
- * because it's probably better to use more accurate estimate for
- * each expression and treat them as independent, than to combine
- * estimates for the extracted variables when we don't know how that
- * relates to the expressions.
+ * because it's probably better to use more accurate estimate for each
+ * expression and treat them as independent, than to combine estimates
+ * for the extracted variables when we don't know how that relates to
+ * the expressions.
*/
examine_variable(root, groupexpr, 0, &vardata);
if (HeapTupleIsValid(vardata.statsTuple) || vardata.isunique)
@@ -4039,16 +4039,16 @@ estimate_multivariate_ndistinct(PlannerInfo *root, RelOptInfo *rel,
/*
* Process a simple Var expression, by matching it to keys
- * directly. If there's a matching expression, we'll try
- * matching it later.
+ * directly. If there's a matching expression, we'll try matching
+ * it later.
*/
if (IsA(varinfo->var, Var))
{
AttrNumber attnum = ((Var *) varinfo->var)->varattno;
/*
- * Ignore expressions on system attributes. Can't rely on
- * the bms check for negative values.
+ * Ignore expressions on system attributes. Can't rely on the
+ * bms check for negative values.
*/
if (!AttrNumberIsForUserDefinedAttr(attnum))
continue;
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index 3a93e92e403..79761f809c8 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -3847,8 +3847,8 @@ timestamp_bin(PG_FUNCTION_ARGS)
tm_delta = tm_diff - tm_diff % stride_usecs;
/*
- * Make sure the returned timestamp is at the start of the bin,
- * even if the origin is in the future.
+ * Make sure the returned timestamp is at the start of the bin, even if
+ * the origin is in the future.
*/
if (origin > timestamp && stride_usecs > 1)
tm_delta -= stride_usecs;
@@ -4025,8 +4025,8 @@ timestamptz_bin(PG_FUNCTION_ARGS)
tm_delta = tm_diff - tm_diff % stride_usecs;
/*
- * Make sure the returned timestamp is at the start of the bin,
- * even if the origin is in the future.
+ * Make sure the returned timestamp is at the start of the bin, even if
+ * the origin is in the future.
*/
if (origin > timestamp && stride_usecs > 1)
tm_delta -= stride_usecs;
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c
index 0c6e5f24ba1..d2a11b1b5dd 100644
--- a/src/backend/utils/adt/varlena.c
+++ b/src/backend/utils/adt/varlena.c
@@ -307,7 +307,7 @@ byteain(PG_FUNCTION_ARGS)
size_t len = strlen(inputText);
uint64 dstlen = pg_hex_dec_len(len - 2);
- bc = dstlen + VARHDRSZ; /* maximum possible length */
+ bc = dstlen + VARHDRSZ; /* maximum possible length */
result = palloc(bc);
bc = pg_hex_decode(inputText + 2, len - 2, VARDATA(result), dstlen);