Post-PG 10 beta1 pgindent run
authorBruce Momjian <bruce@momjian.us>
Wed, 17 May 2017 20:31:56 +0000 (16:31 -0400)
committerBruce Momjian <bruce@momjian.us>
Wed, 17 May 2017 20:31:56 +0000 (16:31 -0400)
perltidy run not included.

310 files changed:
contrib/bloom/blinsert.c
contrib/bloom/blutils.c
contrib/btree_gin/btree_gin.c
contrib/btree_gist/btree_cash.c
contrib/btree_gist/btree_date.c
contrib/btree_gist/btree_enum.c
contrib/btree_gist/btree_float4.c
contrib/btree_gist/btree_float8.c
contrib/btree_gist/btree_inet.c
contrib/btree_gist/btree_int2.c
contrib/btree_gist/btree_int4.c
contrib/btree_gist/btree_int8.c
contrib/btree_gist/btree_interval.c
contrib/btree_gist/btree_oid.c
contrib/btree_gist/btree_time.c
contrib/btree_gist/btree_ts.c
contrib/btree_gist/btree_utils_num.h
contrib/btree_gist/btree_utils_var.c
contrib/btree_gist/btree_utils_var.h
contrib/btree_gist/btree_uuid.c
contrib/dblink/dblink.c
contrib/oid2name/oid2name.c
contrib/pageinspect/brinfuncs.c
contrib/pageinspect/hashfuncs.c
contrib/pageinspect/rawpage.c
contrib/pg_standby/pg_standby.c
contrib/pg_visibility/pg_visibility.c
contrib/pgcrypto/openssl.c
contrib/pgcrypto/pgcrypto.c
contrib/pgrowlocks/pgrowlocks.c
contrib/pgstattuple/pgstatapprox.c
contrib/pgstattuple/pgstatindex.c
contrib/postgres_fdw/deparse.c
contrib/postgres_fdw/postgres_fdw.c
contrib/postgres_fdw/postgres_fdw.h
src/backend/access/brin/brin.c
src/backend/access/brin/brin_revmap.c
src/backend/access/brin/brin_xlog.c
src/backend/access/common/printsimple.c
src/backend/access/gin/ginvacuum.c
src/backend/access/hash/hash.c
src/backend/access/hash/hash_xlog.c
src/backend/access/hash/hashinsert.c
src/backend/access/hash/hashpage.c
src/backend/access/hash/hashutil.c
src/backend/access/heap/heapam.c
src/backend/access/nbtree/nbtree.c
src/backend/access/rmgrdesc/brindesc.c
src/backend/access/rmgrdesc/clogdesc.c
src/backend/access/rmgrdesc/gindesc.c
src/backend/access/spgist/spginsert.c
src/backend/access/transam/clog.c
src/backend/access/transam/commit_ts.c
src/backend/access/transam/subtrans.c
src/backend/access/transam/twophase.c
src/backend/access/transam/varsup.c
src/backend/access/transam/xact.c
src/backend/access/transam/xlog.c
src/backend/access/transam/xlogfuncs.c
src/backend/access/transam/xloginsert.c
src/backend/access/transam/xlogreader.c
src/backend/access/transam/xlogutils.c
src/backend/catalog/dependency.c
src/backend/catalog/heap.c
src/backend/catalog/objectaddress.c
src/backend/catalog/pg_collation.c
src/backend/catalog/pg_depend.c
src/backend/catalog/pg_inherits.c
src/backend/catalog/pg_namespace.c
src/backend/catalog/pg_publication.c
src/backend/catalog/pg_subscription.c
src/backend/commands/alter.c
src/backend/commands/analyze.c
src/backend/commands/collationcmds.c
src/backend/commands/copy.c
src/backend/commands/dbcommands.c
src/backend/commands/define.c
src/backend/commands/dropcmds.c
src/backend/commands/event_trigger.c
src/backend/commands/foreigncmds.c
src/backend/commands/publicationcmds.c
src/backend/commands/sequence.c
src/backend/commands/statscmds.c
src/backend/commands/subscriptioncmds.c
src/backend/commands/tablecmds.c
src/backend/commands/trigger.c
src/backend/commands/tsearchcmds.c
src/backend/commands/user.c
src/backend/commands/vacuumlazy.c
src/backend/commands/view.c
src/backend/executor/execAmi.c
src/backend/executor/execGrouping.c
src/backend/executor/execMain.c
src/backend/executor/execParallel.c
src/backend/executor/execProcnode.c
src/backend/executor/execReplication.c
src/backend/executor/execUtils.c
src/backend/executor/nodeAgg.c
src/backend/executor/nodeAppend.c
src/backend/executor/nodeBitmapHeapscan.c
src/backend/executor/nodeGather.c
src/backend/executor/nodeGatherMerge.c
src/backend/executor/nodeMergeAppend.c
src/backend/executor/nodeModifyTable.c
src/backend/executor/nodeProjectSet.c
src/backend/executor/nodeSetOp.c
src/backend/executor/nodeTableFuncscan.c
src/backend/executor/spi.c
src/backend/lib/rbtree.c
src/backend/libpq/auth.c
src/backend/libpq/crypt.c
src/backend/libpq/hba.c
src/backend/libpq/pqcomm.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/nodeFuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/tidbitmap.c
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/path/costsize.c
src/backend/optimizer/path/indxpath.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/setrefs.c
src/backend/optimizer/prep/prepunion.c
src/backend/optimizer/util/pathnode.c
src/backend/optimizer/util/plancat.c
src/backend/optimizer/util/relnode.c
src/backend/parser/analyze.c
src/backend/parser/parse_clause.c
src/backend/parser/parse_expr.c
src/backend/parser/parse_relation.c
src/backend/parser/parse_utilcmd.c
src/backend/port/posix_sema.c
src/backend/postmaster/bgworker.c
src/backend/postmaster/bgwriter.c
src/backend/postmaster/checkpointer.c
src/backend/postmaster/pgstat.c
src/backend/postmaster/postmaster.c
src/backend/postmaster/syslogger.c
src/backend/replication/basebackup.c
src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
src/backend/replication/logical/launcher.c
src/backend/replication/logical/logical.c
src/backend/replication/logical/logicalfuncs.c
src/backend/replication/logical/proto.c
src/backend/replication/logical/relation.c
src/backend/replication/logical/snapbuild.c
src/backend/replication/logical/tablesync.c
src/backend/replication/logical/worker.c
src/backend/replication/pgoutput/pgoutput.c
src/backend/replication/slot.c
src/backend/replication/slotfuncs.c
src/backend/replication/syncrep.c
src/backend/replication/walreceiver.c
src/backend/replication/walsender.c
src/backend/rewrite/rewriteDefine.c
src/backend/rewrite/rewriteHandler.c
src/backend/statistics/dependencies.c
src/backend/statistics/extended_stats.c
src/backend/statistics/mvdistinct.c
src/backend/storage/file/fd.c
src/backend/storage/lmgr/condition_variable.c
src/backend/storage/lmgr/lwlock.c
src/backend/storage/smgr/md.c
src/backend/tcop/utility.c
src/backend/tsearch/to_tsany.c
src/backend/tsearch/wparser.c
src/backend/utils/adt/cash.c
src/backend/utils/adt/dbsize.c
src/backend/utils/adt/formatting.c
src/backend/utils/adt/genfile.c
src/backend/utils/adt/json.c
src/backend/utils/adt/jsonb.c
src/backend/utils/adt/jsonfuncs.c
src/backend/utils/adt/like.c
src/backend/utils/adt/mac.c
src/backend/utils/adt/mac8.c
src/backend/utils/adt/pg_locale.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/txid.c
src/backend/utils/adt/varlena.c
src/backend/utils/adt/xml.c
src/backend/utils/cache/inval.c
src/backend/utils/cache/lsyscache.c
src/backend/utils/cache/plancache.c
src/backend/utils/cache/relcache.c
src/backend/utils/cache/syscache.c
src/backend/utils/fmgr/dfmgr.c
src/backend/utils/fmgr/fmgr.c
src/backend/utils/mb/conv.c
src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c
src/backend/utils/mb/conversion_procs/utf8_and_win/utf8_and_win.c
src/backend/utils/mb/encnames.c
src/backend/utils/misc/backend_random.c
src/backend/utils/misc/guc.c
src/backend/utils/sort/tuplesort.c
src/backend/utils/time/snapmgr.c
src/bin/initdb/findtimezone.c
src/bin/initdb/initdb.c
src/bin/pg_archivecleanup/pg_archivecleanup.c
src/bin/pg_basebackup/pg_basebackup.c
src/bin/pg_basebackup/pg_receivewal.c
src/bin/pg_basebackup/receivelog.c
src/bin/pg_basebackup/walmethods.c
src/bin/pg_basebackup/walmethods.h
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_dump/pg_backup.h
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.h
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.h
src/bin/pg_dump/pg_dumpall.c
src/bin/pg_resetwal/pg_resetwal.c
src/bin/pg_test_timing/pg_test_timing.c
src/bin/pg_upgrade/exec.c
src/bin/pg_upgrade/info.c
src/bin/pg_upgrade/option.c
src/bin/pg_waldump/pg_waldump.c
src/bin/psql/conditional.h
src/bin/psql/describe.c
src/bin/psql/describe.h
src/bin/psql/tab-complete.c
src/common/file_utils.c
src/common/saslprep.c
src/common/scram-common.c
src/common/sha2_openssl.c
src/common/unicode_norm.c
src/include/access/brin.h
src/include/access/brin_tuple.h
src/include/access/brin_xlog.h
src/include/access/clog.h
src/include/access/hash.h
src/include/access/hash_xlog.h
src/include/access/relscan.h
src/include/access/twophase.h
src/include/access/xact.h
src/include/access/xlog.h
src/include/access/xlogreader.h
src/include/access/xlogutils.h
src/include/c.h
src/include/catalog/dependency.h
src/include/catalog/pg_authid.h
src/include/catalog/pg_collation.h
src/include/catalog/pg_operator.h
src/include/catalog/pg_policy.h
src/include/catalog/pg_proc.h
src/include/catalog/pg_publication.h
src/include/catalog/pg_publication_rel.h
src/include/catalog/pg_sequence.h
src/include/catalog/pg_statistic_ext.h
src/include/catalog/pg_subscription.h
src/include/catalog/pg_subscription_rel.h
src/include/commands/createas.h
src/include/commands/explain.h
src/include/commands/subscriptioncmds.h
src/include/common/file_utils.h
src/include/common/scram-common.h
src/include/executor/executor.h
src/include/executor/nodeGatherMerge.h
src/include/executor/spi.h
src/include/executor/tablefunc.h
src/include/lib/simplehash.h
src/include/libpq/hba.h
src/include/mb/pg_wchar.h
src/include/nodes/execnodes.h
src/include/nodes/makefuncs.h
src/include/nodes/parsenodes.h
src/include/nodes/plannodes.h
src/include/nodes/relation.h
src/include/optimizer/cost.h
src/include/optimizer/pathnode.h
src/include/optimizer/paths.h
src/include/parser/parse_func.h
src/include/parser/parse_node.h
src/include/parser/parse_oper.h
src/include/replication/logical.h
src/include/replication/logicallauncher.h
src/include/replication/logicalproto.h
src/include/replication/logicalrelation.h
src/include/replication/pgoutput.h
src/include/replication/snapbuild.h
src/include/replication/syncrep.h
src/include/replication/walreceiver.h
src/include/replication/worker_internal.h
src/include/statistics/extended_stats_internal.h
src/include/storage/condition_variable.h
src/include/storage/proc.h
src/include/storage/procarray.h
src/include/tcop/utility.h
src/include/utils/jsonapi.h
src/include/utils/lsyscache.h
src/include/utils/pg_locale.h
src/include/utils/plancache.h
src/include/utils/queryenvironment.h
src/include/utils/regproc.h
src/include/utils/rel.h
src/include/utils/varlena.h
src/interfaces/libpq/fe-auth-scram.c
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-secure-openssl.c
src/interfaces/libpq/libpq-fe.h
src/pl/plperl/plperl.c
src/pl/plpgsql/src/plpgsql.h
src/pl/plpython/plpy_exec.c
src/pl/plpython/plpy_typeio.c
src/pl/tcl/pltcl.c
src/port/dirmod.c
src/test/regress/regress.c
src/tools/testint128.c

index 913f1f8a51870667a26c7339dd5b5af255375b52..0d506e3c1ad6afa79133e02804aabfe1fa45c6b9 100644 (file)
@@ -165,11 +165,11 @@ blbuildempty(Relation index)
        BloomFillMetapage(index, metapage);
 
        /*
-        * Write the page and log it.  It might seem that an immediate sync
-        * would be sufficient to guarantee that the file exists on disk, but
-        * recovery itself might remove it while replaying, for example, an
-        * XLOG_DBASE_CREATE or XLOG_TBLSPC_CREATE record.  Therefore, we
-        * need this even when wal_level=minimal.
+        * Write the page and log it.  It might seem that an immediate sync would
+        * be sufficient to guarantee that the file exists on disk, but recovery
+        * itself might remove it while replaying, for example, an
+        * XLOG_DBASE_CREATE or XLOG_TBLSPC_CREATE record.  Therefore, we need
+        * this even when wal_level=minimal.
         */
        PageSetChecksumInplace(metapage, BLOOM_METAPAGE_BLKNO);
        smgrwrite(index->rd_smgr, INIT_FORKNUM, BLOOM_METAPAGE_BLKNO,
index f2eda67e0aeb87c5e61cdb93617e3d86938276b6..00a65875b03a711f8320b18deb09c7466bd56f18 100644 (file)
@@ -75,7 +75,7 @@ _PG_init(void)
                bl_relopt_tab[i + 1].optname = MemoryContextStrdup(TopMemoryContext,
                                                                                                                   buf);
                bl_relopt_tab[i + 1].opttype = RELOPT_TYPE_INT;
-               bl_relopt_tab[i + 1].offset = offsetof(BloomOptions, bitSize[0]) + sizeof(int) * i;
+               bl_relopt_tab[i + 1].offset = offsetof(BloomOptions, bitSize[0]) +sizeof(int) * i;
        }
 }
 
index 7191fbf54f7dc8eed034f5be987391320c292ce8..6f0c752b2e89e0a7d8229b17c5246f0207846840 100644 (file)
@@ -112,13 +112,13 @@ gin_btree_compare_prefix(FunctionCallInfo fcinfo)
                                cmp;
 
        cmp = DatumGetInt32(CallerFInfoFunctionCall2(
-                                                       data->typecmp,
-                                                       fcinfo->flinfo,
-                                                       PG_GET_COLLATION(),
-                                                       (data->strategy == BTLessStrategyNumber ||
-                                                        data->strategy == BTLessEqualStrategyNumber)
-                                                       ? data->datum : a,
-                                                       b));
+                                                                                                data->typecmp,
+                                                                                                fcinfo->flinfo,
+                                                                                                PG_GET_COLLATION(),
+                                                                  (data->strategy == BTLessStrategyNumber ||
+                                                                data->strategy == BTLessEqualStrategyNumber)
+                                                                                                ? data->datum : a,
+                                                                                                b));
 
        switch (data->strategy)
        {
@@ -438,16 +438,16 @@ GIN_SUPPORT(numeric, true, leftmostvalue_numeric, gin_numeric_cmp)
  */
 
 
-#define ENUM_IS_LEFTMOST(x)    ((x) == InvalidOid)
+#define ENUM_IS_LEFTMOST(x) ((x) == InvalidOid)
 
 PG_FUNCTION_INFO_V1(gin_enum_cmp);
 
 Datum
 gin_enum_cmp(PG_FUNCTION_ARGS)
 {
-       Oid             a = PG_GETARG_OID(0);
-       Oid             b = PG_GETARG_OID(1);
-       int             res = 0;
+       Oid                     a = PG_GETARG_OID(0);
+       Oid                     b = PG_GETARG_OID(1);
+       int                     res = 0;
 
        if (ENUM_IS_LEFTMOST(a))
        {
@@ -460,11 +460,11 @@ gin_enum_cmp(PG_FUNCTION_ARGS)
        else
        {
                res = DatumGetInt32(CallerFInfoFunctionCall2(
-                                                               enum_cmp,
-                                                               fcinfo->flinfo,
-                                                               PG_GET_COLLATION(),
-                                                               ObjectIdGetDatum(a),
-                                                               ObjectIdGetDatum(b)));
+                                                                                                        enum_cmp,
+                                                                                                        fcinfo->flinfo,
+                                                                                                        PG_GET_COLLATION(),
+                                                                                                        ObjectIdGetDatum(a),
+                                                                                                        ObjectIdGetDatum(b)));
        }
 
        PG_RETURN_INT32(res);
index ca0c86b5d82df8c42b4aef6c9bc94d67dbd390f4..1116ca084f3ab544985dd33ee1e7dbd8c2b225aa 100644 (file)
@@ -170,7 +170,7 @@ gbt_cash_distance(PG_FUNCTION_ARGS)
        key.upper = (GBT_NUMKEY *) &kkk->upper;
 
        PG_RETURN_FLOAT8(
-                       gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
+                                        gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
                );
 }
 
index c9daf340976285f664020b5b7bb5d5006c5816d9..28c7c2ac8611bc216f06f42e6bfcd5df7ac3aa55 100644 (file)
@@ -182,7 +182,7 @@ gbt_date_distance(PG_FUNCTION_ARGS)
        key.upper = (GBT_NUMKEY *) &kkk->upper;
 
        PG_RETURN_FLOAT8(
-                       gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
+                                        gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
                );
 }
 
index 5e46e782befe90de308d196a5587b50519d3502a..8bbadfe860c1a976bf8d5ed73d400bc3125857ae 100644 (file)
@@ -32,14 +32,14 @@ static bool
 gbt_enumgt(const void *a, const void *b, FmgrInfo *flinfo)
 {
        return DatumGetBool(
-               CallerFInfoFunctionCall2(enum_gt, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b)))
+                                               CallerFInfoFunctionCall2(enum_gt, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b)))
                );
 }
 static bool
 gbt_enumge(const void *a, const void *b, FmgrInfo *flinfo)
 {
        return DatumGetBool(
-               CallerFInfoFunctionCall2(enum_ge, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b)))
+                                               CallerFInfoFunctionCall2(enum_ge, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b)))
                );
 }
 static bool
@@ -74,12 +74,12 @@ gbt_enumkey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
                        return 0;
 
                return DatumGetInt32(
-                       CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid, ObjectIdGetDatum(ia->upper), ObjectIdGetDatum(ib->upper))
+                                                        CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid, ObjectIdGetDatum(ia->upper), ObjectIdGetDatum(ib->upper))
                        );
        }
 
        return DatumGetInt32(
-               CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid, ObjectIdGetDatum(ia->lower), ObjectIdGetDatum(ib->lower))
+                                                CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid, ObjectIdGetDatum(ia->lower), ObjectIdGetDatum(ib->lower))
                );
 }
 
@@ -94,7 +94,7 @@ static const gbtree_ninfo tinfo =
        gbt_enumle,
        gbt_enumlt,
        gbt_enumkey_cmp,
-       NULL /* no KNN support at least for now */
+       NULL                                            /* no KNN support at least for now */
 };
 
 
index 46b3edbab3b7497b938531bcd4d77c903dcfdca6..fe6993c226cda3fa78556ca48bd588252d000321 100644 (file)
@@ -163,7 +163,7 @@ gbt_float4_distance(PG_FUNCTION_ARGS)
        key.upper = (GBT_NUMKEY *) &kkk->upper;
 
        PG_RETURN_FLOAT8(
-                       gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
+                                        gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
                );
 }
 
index 7d653075c571db1a8722fb836cce13dcd8608612..13153d811fdfeccb986bc18bd0a777a22c074bc9 100644 (file)
@@ -170,7 +170,7 @@ gbt_float8_distance(PG_FUNCTION_ARGS)
        key.upper = (GBT_NUMKEY *) &kkk->upper;
 
        PG_RETURN_FLOAT8(
-                       gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
+                                        gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
                );
 }
 
index 7c95ee6814525d2fd69db4bdea84d010c5884495..e1561b37b73d7f9f007ef8cbdd4dc5f5396aa92d 100644 (file)
@@ -133,7 +133,7 @@ gbt_inet_consistent(PG_FUNCTION_ARGS)
        key.upper = (GBT_NUMKEY *) &kkk->upper;
 
        PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query,
-                                                                         &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
+                                          &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
 }
 
 
index 3dae5e7c61dc8a3223e47d7f2266ae44bc532898..0a4498a693a028167e98444dd785073b61215a77 100644 (file)
@@ -170,7 +170,7 @@ gbt_int2_distance(PG_FUNCTION_ARGS)
        key.upper = (GBT_NUMKEY *) &kkk->upper;
 
        PG_RETURN_FLOAT8(
-                       gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
+                                        gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
                );
 }
 
index 213bfa3323f82b5329989cbb86e21d8ec627e50f..b29cbc81a3e66ee7475054f8342965d4d3627529 100644 (file)
@@ -171,7 +171,7 @@ gbt_int4_distance(PG_FUNCTION_ARGS)
        key.upper = (GBT_NUMKEY *) &kkk->upper;
 
        PG_RETURN_FLOAT8(
-                       gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
+                                        gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
                );
 }
 
index 62b079bba698816b1970a358d050c0c723a7b5aa..df1f5338c845023e2d50f30c0d63179a0cb46cf2 100644 (file)
@@ -171,7 +171,7 @@ gbt_int8_distance(PG_FUNCTION_ARGS)
        key.upper = (GBT_NUMKEY *) &kkk->upper;
 
        PG_RETURN_FLOAT8(
-                       gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
+                                        gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
                );
 }
 
index f41f471bf6e20bd86b9dcc2b3f4cd09956be650c..e4dd9e4238a0e7ab04a4604875e49433c161d7c7 100644 (file)
@@ -245,7 +245,7 @@ gbt_intv_distance(PG_FUNCTION_ARGS)
        key.upper = (GBT_NUMKEY *) &kkk->upper;
 
        PG_RETURN_FLOAT8(
-                        gbt_num_distance(&key, (void *) query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
+                                        gbt_num_distance(&key, (void *) query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
                );
 }
 
index e588faa15a33740bde8e7f9f3f667ac6a396a237..e0d6f2adf18236ea5ae100abfd15858ec2c0217f 100644 (file)
@@ -171,7 +171,7 @@ gbt_oid_distance(PG_FUNCTION_ARGS)
        key.upper = (GBT_NUMKEY *) &kkk->upper;
 
        PG_RETURN_FLOAT8(
-                       gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
+                                        gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
                );
 }
 
index a4a1ad5aebc17317dbadb6726ef960fb471d76db..5eec8323f553ad133d9435bb75ca756db5c50a0e 100644 (file)
@@ -235,7 +235,7 @@ gbt_time_distance(PG_FUNCTION_ARGS)
        key.upper = (GBT_NUMKEY *) &kkk->upper;
 
        PG_RETURN_FLOAT8(
-                       gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
+                                        gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
                );
 }
 
index 13bc39424b256c01f85ec3621715b927da769bfa..592466c948add31978d0abf47b3347645fee0909 100644 (file)
@@ -283,7 +283,7 @@ gbt_ts_distance(PG_FUNCTION_ARGS)
        key.upper = (GBT_NUMKEY *) &kkk->upper;
 
        PG_RETURN_FLOAT8(
-                       gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
+                                        gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
                );
 }
 
@@ -328,7 +328,7 @@ gbt_tstz_distance(PG_FUNCTION_ARGS)
        qqq = tstz_to_ts_gmt(query);
 
        PG_RETURN_FLOAT8(
-                         gbt_num_distance(&key, (void *) &qqq, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
+                                        gbt_num_distance(&key, (void *) &qqq, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
                );
 }
 
index 17561fa9e4ef888a8e459a0c0330e0044a7e8c5f..8aab19396c494075162cf296922143b306a95c6b 100644 (file)
@@ -42,13 +42,13 @@ typedef struct
 
        /* Methods */
 
-       bool            (*f_gt) (const void *, const void *, FmgrInfo *);       /* greater than */
-       bool            (*f_ge) (const void *, const void *, FmgrInfo *);       /* greater or equal */
-       bool            (*f_eq) (const void *, const void *, FmgrInfo *);       /* equal */
-       bool            (*f_le) (const void *, const void *, FmgrInfo *);       /* less or equal */
-       bool            (*f_lt) (const void *, const void *, FmgrInfo *);       /* less than */
-       int                     (*f_cmp) (const void *, const void *, FmgrInfo *);      /* key compare function */
-       float8          (*f_dist) (const void *, const void *, FmgrInfo *); /* key distance function */
+       bool            (*f_gt) (const void *, const void *, FmgrInfo *);               /* greater than */
+       bool            (*f_ge) (const void *, const void *, FmgrInfo *);               /* greater or equal */
+       bool            (*f_eq) (const void *, const void *, FmgrInfo *);               /* equal */
+       bool            (*f_le) (const void *, const void *, FmgrInfo *);               /* less or equal */
+       bool            (*f_lt) (const void *, const void *, FmgrInfo *);               /* less than */
+       int                     (*f_cmp) (const void *, const void *, FmgrInfo *);              /* key compare function */
+       float8          (*f_dist) (const void *, const void *, FmgrInfo *);             /* key distance function */
 } gbtree_ninfo;
 
 
index e0b4b377796a5b3a74a2f48f57744065c7941936..3648adccef7b6b5552bf1b9f6190491e30cd31f9 100644 (file)
@@ -25,7 +25,7 @@ typedef struct
 {
        const gbtree_vinfo *tinfo;
        Oid                     collation;
-       FmgrInfo *flinfo;
+       FmgrInfo   *flinfo;
 } gbt_vsrt_arg;
 
 
@@ -402,8 +402,8 @@ gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n,
                *res = 0.0;
        else if (!(((*tinfo->f_cmp) (nk.lower, ok.lower, collation, flinfo) >= 0 ||
                                gbt_bytea_pf_match(ok.lower, nk.lower, tinfo)) &&
-                          ((*tinfo->f_cmp) (nk.upper, ok.upper, collation, flinfo) <= 0 ||
-                               gbt_bytea_pf_match(ok.upper, nk.upper, tinfo))))
+                        ((*tinfo->f_cmp) (nk.upper, ok.upper, collation, flinfo) <= 0 ||
+                         gbt_bytea_pf_match(ok.upper, nk.upper, tinfo))))
        {
                Datum           d = PointerGetDatum(0);
                double          dres;
index fbc76ce738564369c7217f4d3d1d9347f776ae94..04a356276bf23b73331f059c3a76e7c393b2fe68 100644 (file)
@@ -34,12 +34,12 @@ typedef struct
 
        /* Methods */
 
-       bool            (*f_gt) (const void *, const void *, Oid, FmgrInfo *);          /* greater than */
-       bool            (*f_ge) (const void *, const void *, Oid, FmgrInfo *);          /* greater equal */
-       bool            (*f_eq) (const void *, const void *, Oid, FmgrInfo *);          /* equal */
-       bool            (*f_le) (const void *, const void *, Oid, FmgrInfo *);          /* less equal */
-       bool            (*f_lt) (const void *, const void *, Oid, FmgrInfo *);          /* less than */
-       int32           (*f_cmp) (const void *, const void *, Oid, FmgrInfo *);         /* compare */
+       bool            (*f_gt) (const void *, const void *, Oid, FmgrInfo *);  /* greater than */
+       bool            (*f_ge) (const void *, const void *, Oid, FmgrInfo *);  /* greater equal */
+       bool            (*f_eq) (const void *, const void *, Oid, FmgrInfo *);  /* equal */
+       bool            (*f_le) (const void *, const void *, Oid, FmgrInfo *);  /* less equal */
+       bool            (*f_lt) (const void *, const void *, Oid, FmgrInfo *);  /* less than */
+       int32           (*f_cmp) (const void *, const void *, Oid, FmgrInfo *); /* compare */
        GBT_VARKEY *(*f_l2n) (GBT_VARKEY *, FmgrInfo *flinfo);          /* convert leaf to node */
 } gbtree_vinfo;
 
index 5ed80925d3e3ad979293b54c260219aa955af072..e67b8cc989894266dd44505d94181afd47e800b1 100644 (file)
@@ -150,7 +150,7 @@ gbt_uuid_consistent(PG_FUNCTION_ARGS)
 
        PG_RETURN_BOOL(
                                   gbt_num_consistent(&key, (void *) query, &strategy,
-                                                                         GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
+                                                                       GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
                );
 }
 
index 44b67daedba699a82de7f23f3670b78f9e852d4c..a6a3c09ff8e5c2499b26e636b58a4ac9b10e1583 100644 (file)
@@ -113,7 +113,7 @@ static char *generate_relation_name(Relation rel);
 static void dblink_connstr_check(const char *connstr);
 static void dblink_security_check(PGconn *conn, remoteConn *rconn);
 static void dblink_res_error(PGconn *conn, const char *conname, PGresult *res,
-                                                        const char *dblink_context_msg, bool fail);
+                                const char *dblink_context_msg, bool fail);
 static char *get_connect_string(const char *servername);
 static char *escape_param_str(const char *from);
 static void validate_pkattnums(Relation rel,
@@ -152,16 +152,19 @@ xpstrdup(const char *in)
        return pstrdup(in);
 }
 
-static void pg_attribute_noreturn()
+static void
+pg_attribute_noreturn()
 dblink_res_internalerror(PGconn *conn, PGresult *res, const char *p2)
 {
        char       *msg = pchomp(PQerrorMessage(conn));
+
        if (res)
                PQclear(res);
        elog(ERROR, "%s: %s", p2, msg);
 }
 
-static void pg_attribute_noreturn()
+static void
+pg_attribute_noreturn()
 dblink_conn_not_avail(const char *conname)
 {
        if (conname)
@@ -176,7 +179,7 @@ dblink_conn_not_avail(const char *conname)
 
 static void
 dblink_get_conn(char *conname_or_str,
-                               PGconn * volatile *conn_p, char **conname_p, volatile bool *freeconn_p)
+         PGconn *volatile * conn_p, char **conname_p, volatile bool *freeconn_p)
 {
        remoteConn *rconn = getConnectionByName(conname_or_str);
        PGconn     *conn;
@@ -201,11 +204,12 @@ dblink_get_conn(char *conname_or_str,
                if (PQstatus(conn) == CONNECTION_BAD)
                {
                        char       *msg = pchomp(PQerrorMessage(conn));
+
                        PQfinish(conn);
                        ereport(ERROR,
-                                       (errcode(ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION),
-                                        errmsg("could not establish connection"),
-                                        errdetail_internal("%s", msg)));
+                          (errcode(ERRCODE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION),
+                               errmsg("could not establish connection"),
+                               errdetail_internal("%s", msg)));
                }
                dblink_security_check(conn, rconn);
                if (PQclientEncoding(conn) != GetDatabaseEncoding())
@@ -223,11 +227,12 @@ static PGconn *
 dblink_get_named_conn(const char *conname)
 {
        remoteConn *rconn = getConnectionByName(conname);
+
        if (rconn)
                return rconn->conn;
 
        dblink_conn_not_avail(conname);
-       return NULL;            /* keep compiler quiet */
+       return NULL;                            /* keep compiler quiet */
 }
 
 static void
@@ -2699,9 +2704,9 @@ dblink_res_error(PGconn *conn, const char *conname, PGresult *res,
        message_context = xpstrdup(pg_diag_context);
 
        /*
-        * If we don't get a message from the PGresult, try the PGconn.  This
-        * is needed because for connection-level failures, PQexec may just
-        * return NULL, not a PGresult at all.
+        * If we don't get a message from the PGresult, try the PGconn.  This is
+        * needed because for connection-level failures, PQexec may just return
+        * NULL, not a PGresult at all.
         */
        if (message_primary == NULL)
                message_primary = pchomp(PQerrorMessage(conn));
@@ -2732,7 +2737,7 @@ get_connect_string(const char *servername)
        ForeignServer *foreign_server = NULL;
        UserMapping *user_mapping;
        ListCell   *cell;
-       StringInfoData  buf;
+       StringInfoData buf;
        ForeignDataWrapper *fdw;
        AclResult       aclresult;
        char       *srvname;
@@ -2820,7 +2825,7 @@ static char *
 escape_param_str(const char *str)
 {
        const char *cp;
-       StringInfoData  buf;
+       StringInfoData buf;
 
        initStringInfo(&buf);
 
index ec93e4b8d0a9498bc58c2aa5855cadaf0ac5d293..aab71aed2faa889523c4555fa1cfcd99e67c45fa 100644 (file)
@@ -507,7 +507,7 @@ sql_exec_searchtables(PGconn *conn, struct options * opts)
        todo = psprintf(
                                        "SELECT pg_catalog.pg_relation_filenode(c.oid) as \"Filenode\", relname as \"Table Name\" %s\n"
                                        "FROM pg_catalog.pg_class c\n"
-                     LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n"
+                "      LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n"
                                        "       LEFT JOIN pg_catalog.pg_database d ON d.datname = pg_catalog.current_database(),\n"
                                        "       pg_catalog.pg_tablespace t\n"
                                        "WHERE relkind IN (" CppAsString2(RELKIND_RELATION) ","
index dc9cc2d09aa3c67b2e1b2c7d544b1de91c2b136c..d52807dcdd6ab8964f16656dcc493d7009e88950 100644 (file)
@@ -226,8 +226,8 @@ brin_page_items(PG_FUNCTION_ARGS)
                        if (ItemIdIsUsed(itemId))
                        {
                                dtup = brin_deform_tuple(bdesc,
-                                                                       (BrinTuple *) PageGetItem(page, itemId),
-                                                                       NULL);
+                                                                        (BrinTuple *) PageGetItem(page, itemId),
+                                                                                NULL);
                                attno = 1;
                                unusedItem = false;
                        }
index 6e52969fd3447f7674fe93aaa523ab1547ab2348..228a147c9e81efc38ce3c8ba9da79a65a26fb799 100644 (file)
@@ -34,10 +34,10 @@ PG_FUNCTION_INFO_V1(hash_metapage_info);
  */
 typedef struct HashPageStat
 {
-       int             live_items;
-       int             dead_items;
-       int             page_size;
-       int             free_size;
+       int                     live_items;
+       int                     dead_items;
+       int                     page_size;
+       int                     free_size;
 
        /* opaque data */
        BlockNumber hasho_prevblkno;
@@ -45,7 +45,7 @@ typedef struct HashPageStat
        Bucket          hasho_bucket;
        uint16          hasho_flag;
        uint16          hasho_page_id;
-}      HashPageStat;
+} HashPageStat;
 
 
 /*
@@ -99,7 +99,7 @@ verify_hash_page(bytea *raw_page, int flags)
                        case LH_BUCKET_PAGE | LH_OVERFLOW_PAGE:
                                ereport(ERROR,
                                                (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-                                                errmsg("page is not a hash bucket or overflow page")));
+                                         errmsg("page is not a hash bucket or overflow page")));
                        case LH_OVERFLOW_PAGE:
                                ereport(ERROR,
                                                (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
@@ -107,7 +107,7 @@ verify_hash_page(bytea *raw_page, int flags)
                        default:
                                elog(ERROR,
                                         "hash page of type %08x not in mask %08x",
-                                       pagetype, flags);
+                                        pagetype, flags);
                }
        }
 
@@ -143,7 +143,7 @@ verify_hash_page(bytea *raw_page, int flags)
  * -------------------------------------------------
  */
 static void
-GetHashPageStatistics(Page page, HashPageStat * stat)
+GetHashPageStatistics(Page page, HashPageStat *stat)
 {
        OffsetNumber maxoff = PageGetMaxOffsetNumber(page);
        HashPageOpaque opaque = (HashPageOpaque) PageGetSpecialPointer(page);
@@ -515,8 +515,8 @@ hash_metapage_info(PG_FUNCTION_ARGS)
                                j;
        Datum           values[16];
        bool            nulls[16];
-       Datum       spares[HASH_MAX_SPLITPOINTS];
-       Datum       mapp[HASH_MAX_BITMAPS];
+       Datum           spares[HASH_MAX_SPLITPOINTS];
+       Datum           mapp[HASH_MAX_BITMAPS];
 
        if (!superuser())
                ereport(ERROR,
index 631e435a939c2a56c30ea3d7ac28bd623e69c681..f273dfa7cb2f5e877c64f22c4e1559a440cb087e 100644 (file)
@@ -311,9 +311,9 @@ page_checksum(PG_FUNCTION_ARGS)
        if (raw_page_size != BLCKSZ)
                ereport(ERROR,
                                (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-                                errmsg("incorrect size of input page (%d bytes)", raw_page_size)));
+                 errmsg("incorrect size of input page (%d bytes)", raw_page_size)));
 
        page = (PageHeader) VARDATA(raw_page);
 
-       PG_RETURN_INT16(pg_checksum_page((char *)page, blkno));
+       PG_RETURN_INT16(pg_checksum_page((char *) page, blkno));
 }
index 5703032397915ab11bd758a65c75393339fbae08..c37eaa395dae51c6a7917ed92e6509571417cf8b 100644 (file)
@@ -57,7 +57,7 @@ char     *xlogFilePath;               /* where we are going to restore to */
 char      *nextWALFileName;    /* the file we need to get from archive */
 char      *restartWALFileName; /* the file from which we can restart restore */
 char      *priorWALFileName;   /* the file we need to get from archive */
-char           WALFilePath[MAXPGPATH * 2];             /* the file path including archive */
+char           WALFilePath[MAXPGPATH * 2]; /* the file path including archive */
 char           restoreCommand[MAXPGPATH];      /* run this to restore */
 char           exclusiveCleanupFileName[MAXFNAMELEN];          /* the file we need to
                                                                                                                 * get from archive */
index ee3936e09a9ae4046e8e153b0f166e60a176b410..480f917d0871d528a599937f8dda0da35ebcaf30 100644 (file)
@@ -774,6 +774,6 @@ check_relation_relkind(Relation rel)
                rel->rd_rel->relkind != RELKIND_TOASTVALUE)
                ereport(ERROR,
                                (errcode(ERRCODE_WRONG_OBJECT_TYPE),
-                                errmsg("\"%s\" is not a table, materialized view, or TOAST table",
-                                               RelationGetRelationName(rel))));
+                  errmsg("\"%s\" is not a table, materialized view, or TOAST table",
+                                 RelationGetRelationName(rel))));
 }
index 8063f34227043f0022283327a407671582347074..f71a933407d600f0fa81d37b20d5dfc437cdef7e 100644 (file)
@@ -238,7 +238,7 @@ px_find_digest(const char *name, PX_MD **res)
  * prototype for the EVP functions that return an algorithm, e.g.
  * EVP_aes_128_cbc().
  */
-typedef const EVP_CIPHER *(*ossl_EVP_cipher_func)(void);
+typedef const EVP_CIPHER *(*ossl_EVP_cipher_func) (void);
 
 /*
  * ossl_cipher contains the static information about each cipher.
@@ -706,13 +706,15 @@ static const struct ossl_cipher ossl_cast_cbc = {
 
 static const struct ossl_cipher ossl_aes_ecb = {
        ossl_aes_ecb_init,
-       NULL, /* EVP_aes_XXX_ecb(), determined in init function */
+       NULL,                                           /* EVP_aes_XXX_ecb(), determined in init
+                                                                * function */
        128 / 8, 256 / 8
 };
 
 static const struct ossl_cipher ossl_aes_cbc = {
        ossl_aes_cbc_init,
-       NULL, /* EVP_aes_XXX_cbc(), determined in init function */
+       NULL,                                           /* EVP_aes_XXX_cbc(), determined in init
+                                                                * function */
        128 / 8, 256 / 8
 };
 
index ccfdc20ed72c8cfd73475c2456ca5e869e6c4ac5..4e3516a86adfff3ae4e856ecdca74d6731a69fdc 100644 (file)
@@ -454,8 +454,8 @@ pg_random_uuid(PG_FUNCTION_ARGS)
        uint8      *buf = (uint8 *) palloc(UUID_LEN);
 
        /*
-        * Generate random bits. pg_backend_random() will do here, we don't
-        * promis UUIDs to be cryptographically random, when built with
+        * Generate random bits. pg_backend_random() will do here, we don't promis
+        * UUIDs to be cryptographically random, when built with
         * --disable-strong-random.
         */
        if (!pg_backend_random((char *) buf, UUID_LEN))
index 8dd561c02ad437692e720efdbb093e936148999e..00e2015c5c956b691417238686f4037692161678 100644 (file)
@@ -99,7 +99,10 @@ pgrowlocks(PG_FUNCTION_ARGS)
                relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname));
                rel = heap_openrv(relrv, AccessShareLock);
 
-               /* check permissions: must have SELECT on table or be in pg_stat_scan_tables */
+               /*
+                * check permissions: must have SELECT on table or be in
+                * pg_stat_scan_tables
+                */
                aclresult = pg_class_aclcheck(RelationGetRelid(rel), GetUserId(),
                                                                          ACL_SELECT);
                if (aclresult != ACLCHECK_OK)
index 46c167a96a5e67d6bb39140dbff42126b80fbe2d..9facf6513784625be428c3bb4faf1cbadd00ea76 100644 (file)
@@ -31,7 +31,7 @@
 PG_FUNCTION_INFO_V1(pgstattuple_approx);
 PG_FUNCTION_INFO_V1(pgstattuple_approx_v1_5);
 
-Datum pgstattuple_approx_internal(Oid relid, FunctionCallInfo fcinfo);
+Datum          pgstattuple_approx_internal(Oid relid, FunctionCallInfo fcinfo);
 
 typedef struct output_type
 {
index 15aedec1bfd4f939952822970567357275b7e01f..03b387f6b6bf3fc20bfc3700108dc1a26702c7bd 100644 (file)
@@ -64,7 +64,7 @@ PG_FUNCTION_INFO_V1(pg_relpages_v1_5);
 PG_FUNCTION_INFO_V1(pg_relpagesbyid_v1_5);
 PG_FUNCTION_INFO_V1(pgstatginindex_v1_5);
 
-Datum pgstatginindex_internal(Oid relid, FunctionCallInfo fcinfo);
+Datum          pgstatginindex_internal(Oid relid, FunctionCallInfo fcinfo);
 
 #define IS_INDEX(r) ((r)->rd_rel->relkind == RELKIND_INDEX)
 #define IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID)
@@ -113,17 +113,17 @@ typedef struct GinIndexStat
  */
 typedef struct HashIndexStat
 {
-       int32   version;
-       int32   space_per_page;
+       int32           version;
+       int32           space_per_page;
 
-       BlockNumber     bucket_pages;
+       BlockNumber bucket_pages;
        BlockNumber overflow_pages;
        BlockNumber bitmap_pages;
        BlockNumber unused_pages;
 
-       int64   live_items;
-       int64   dead_items;
-       uint64  free_space;
+       int64           live_items;
+       int64           dead_items;
+       uint64          free_space;
 } HashIndexStat;
 
 static Datum pgstatindex_impl(Relation rel, FunctionCallInfo fcinfo);
@@ -581,8 +581,8 @@ Datum
 pgstathashindex(PG_FUNCTION_ARGS)
 {
        Oid                     relid = PG_GETARG_OID(0);
-       BlockNumber     nblocks;
-       BlockNumber     blkno;
+       BlockNumber nblocks;
+       BlockNumber blkno;
        Relation        rel;
        HashIndexStat stats;
        BufferAccessStrategy bstrategy;
@@ -591,7 +591,7 @@ pgstathashindex(PG_FUNCTION_ARGS)
        Datum           values[8];
        bool            nulls[8];
        Buffer          metabuf;
-       HashMetaPage    metap;
+       HashMetaPage metap;
        float8          free_percent;
        uint64          total_space;
 
@@ -648,13 +648,13 @@ pgstathashindex(PG_FUNCTION_ARGS)
                                 MAXALIGN(sizeof(HashPageOpaqueData)))
                        ereport(ERROR,
                                        (errcode(ERRCODE_INDEX_CORRUPTED),
-                                        errmsg("index \"%s\" contains corrupted page at block %u",
-                                                       RelationGetRelationName(rel),
-                                                       BufferGetBlockNumber(buf))));
+                                  errmsg("index \"%s\" contains corrupted page at block %u",
+                                                 RelationGetRelationName(rel),
+                                                 BufferGetBlockNumber(buf))));
                else
                {
-                       HashPageOpaque  opaque;
-                       int             pagetype;
+                       HashPageOpaque opaque;
+                       int                     pagetype;
 
                        opaque = (HashPageOpaque) PageGetSpecialPointer(page);
                        pagetype = opaque->hasho_flag & LH_PAGE_TYPE;
@@ -676,9 +676,9 @@ pgstathashindex(PG_FUNCTION_ARGS)
                        else
                                ereport(ERROR,
                                                (errcode(ERRCODE_INDEX_CORRUPTED),
-                                       errmsg("unexpected page type 0x%04X in HASH index \"%s\" block %u",
+                                                errmsg("unexpected page type 0x%04X in HASH index \"%s\" block %u",
                                                        opaque->hasho_flag, RelationGetRelationName(rel),
-                                                       BufferGetBlockNumber(buf))));
+                                                               BufferGetBlockNumber(buf))));
                }
                UnlockReleaseBuffer(buf);
        }
@@ -735,12 +735,12 @@ static void
 GetHashPageStats(Page page, HashIndexStat *stats)
 {
        OffsetNumber maxoff = PageGetMaxOffsetNumber(page);
-       int off;
+       int                     off;
 
        /* count live and dead tuples, and free space */
        for (off = FirstOffsetNumber; off <= maxoff; off++)
        {
-               ItemId      id = PageGetItemId(page, off);
+               ItemId          id = PageGetItemId(page, off);
 
                if (!ItemIdIsDead(id))
                        stats->live_items++;
index 1d5aa837635e84005b3b900a2fe3422b2e69ab10..482a3dd3016dbc2afc0c99a83205a48134dc7358 100644 (file)
@@ -171,8 +171,8 @@ static void deparseFromExprForRel(StringInfo buf, PlannerInfo *root,
                                        RelOptInfo *joinrel, bool use_alias, List **params_list);
 static void deparseFromExpr(List *quals, deparse_expr_cxt *context);
 static void deparseRangeTblRef(StringInfo buf, PlannerInfo *root,
-                                                          RelOptInfo *foreignrel, bool make_subquery,
-                                                          List **params_list);
+                                  RelOptInfo *foreignrel, bool make_subquery,
+                                  List **params_list);
 static void deparseAggref(Aggref *node, deparse_expr_cxt *context);
 static void appendGroupByClause(List *tlist, deparse_expr_cxt *context);
 static void appendAggOrderBy(List *orderList, List *targetList,
@@ -185,9 +185,9 @@ static Node *deparseSortGroupClause(Index ref, List *tlist,
  * Helper functions
  */
 static bool is_subquery_var(Var *node, RelOptInfo *foreignrel,
-                                                       int *relno, int *colno);
+                               int *relno, int *colno);
 static void get_relation_column_alias_ids(Var *node, RelOptInfo *foreignrel,
-                                                                                 int *relno, int *colno);
+                                                         int *relno, int *colno);
 
 
 /*
@@ -1017,8 +1017,8 @@ deparseSelectSql(List *tlist, bool is_subquery, List **retrieved_attrs,
        {
                /*
                 * For a relation that is deparsed as a subquery, emit expressions
-                * specified in the relation's reltarget.  Note that since this is
-                * for the subquery, no need to care about *retrieved_attrs.
+                * specified in the relation's reltarget.  Note that since this is for
+                * the subquery, no need to care about *retrieved_attrs.
                 */
                deparseSubqueryTargetList(context);
        }
@@ -2189,8 +2189,8 @@ deparseVar(Var *node, deparse_expr_cxt *context)
 
        /*
         * If the Var belongs to the foreign relation that is deparsed as a
-        * subquery, use the relation and column alias to the Var provided
-        * by the subquery, instead of the remote name.
+        * subquery, use the relation and column alias to the Var provided by the
+        * subquery, instead of the remote name.
         */
        if (is_subquery_var(node, context->scanrel, &relno, &colno))
        {
index 18b4b01cfa429b99b897aff76fd487fb193c8c21..080cb0a0742b364bbf36dc987cf328b1c3b05aca 100644 (file)
@@ -417,8 +417,8 @@ static void add_foreign_grouping_paths(PlannerInfo *root,
 static void apply_server_options(PgFdwRelationInfo *fpinfo);
 static void apply_table_options(PgFdwRelationInfo *fpinfo);
 static void merge_fdw_options(PgFdwRelationInfo *fpinfo,
-                                                         const PgFdwRelationInfo *fpinfo_o,
-                                                         const PgFdwRelationInfo *fpinfo_i);
+                                 const PgFdwRelationInfo *fpinfo_o,
+                                 const PgFdwRelationInfo *fpinfo_i);
 
 
 /*
@@ -4170,8 +4170,8 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
        fpinfo->jointype = jointype;
 
        /*
-        * By default, both the input relations are not required to be deparsed
-        * as subqueries, but there might be some relations covered by the input
+        * By default, both the input relations are not required to be deparsed as
+        * subqueries, but there might be some relations covered by the input
         * relations that are required to be deparsed as subqueries, so save the
         * relids of those relations for later use by the deparser.
         */
@@ -4227,8 +4227,8 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
                case JOIN_FULL:
 
                        /*
-                        * In this case, if any of the input relations has conditions,
-                        * we need to deparse that relation as a subquery so that the
+                        * In this case, if any of the input relations has conditions, we
+                        * need to deparse that relation as a subquery so that the
                         * conditions can be evaluated before the join.  Remember it in
                         * the fpinfo of this relation so that the deparser can take
                         * appropriate action.  Also, save the relids of base relations
@@ -4305,7 +4305,7 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
         * Note that since this joinrel is at the end of the join_rel_list list
         * when we are called, we can get the position by list_length.
         */
-       Assert(fpinfo->relation_index == 0);    /* shouldn't be set yet */
+       Assert(fpinfo->relation_index == 0);            /* shouldn't be set yet */
        fpinfo->relation_index =
                list_length(root->parse->rtable) + list_length(root->join_rel_list);
 
@@ -4354,7 +4354,7 @@ add_paths_with_pathkeys_for_rel(PlannerInfo *root, RelOptInfo *rel,
 static void
 apply_server_options(PgFdwRelationInfo *fpinfo)
 {
-       ListCell *lc;
+       ListCell   *lc;
 
        foreach(lc, fpinfo->server->options)
        {
@@ -4382,7 +4382,7 @@ apply_server_options(PgFdwRelationInfo *fpinfo)
 static void
 apply_table_options(PgFdwRelationInfo *fpinfo)
 {
-       ListCell *lc;
+       ListCell   *lc;
 
        foreach(lc, fpinfo->table->options)
        {
@@ -4439,7 +4439,7 @@ merge_fdw_options(PgFdwRelationInfo *fpinfo,
                 * best.
                 */
                fpinfo->use_remote_estimate = fpinfo_o->use_remote_estimate ||
-                                                                         fpinfo_i->use_remote_estimate;
+                       fpinfo_i->use_remote_estimate;
 
                /*
                 * Set fetch size to maximum of the joining sides, since we are
@@ -4869,7 +4869,7 @@ add_foreign_grouping_paths(PlannerInfo *root, RelOptInfo *input_rel,
        fpinfo->table = ifpinfo->table;
        fpinfo->server = ifpinfo->server;
        fpinfo->user = ifpinfo->user;
-       merge_fdw_options(fpinfo, ifpinfo , NULL);
+       merge_fdw_options(fpinfo, ifpinfo, NULL);
 
        /* Assess if it is safe to push down aggregation and grouping. */
        if (!foreign_grouping_ok(root, grouped_rel))
index 2bae799ccfe6c59a6c26852b8221475ddf6b20f1..25c950dd768f0974c3b405933218f2b641f3188c 100644 (file)
@@ -96,9 +96,9 @@ typedef struct PgFdwRelationInfo
        List       *grouped_tlist;
 
        /* Subquery information */
-       bool            make_outerrel_subquery; /* do we deparse outerrel as a
+       bool            make_outerrel_subquery; /* do we deparse outerrel as a
                                                                                 * subquery? */
-       bool            make_innerrel_subquery; /* do we deparse innerrel as a
+       bool            make_innerrel_subquery; /* do we deparse innerrel as a
                                                                                 * subquery? */
        Relids          lower_subquery_rels;    /* all relids appearing in lower
                                                                                 * subqueries */
index 2594407754696bf2f839d88474d94242ed32c541..442a46140db6e24e6c948d2a3777541d87a05438 100644 (file)
@@ -364,7 +364,7 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
        MemoryContext oldcxt;
        MemoryContext perRangeCxt;
        BrinMemTuple *dtup;
-       BrinTuple    *btup = NULL;
+       BrinTuple  *btup = NULL;
        Size            btupsz = 0;
 
        opaque = (BrinOpaque *) scan->opaque;
@@ -920,13 +920,13 @@ brin_summarize_range(PG_FUNCTION_ARGS)
 Datum
 brin_desummarize_range(PG_FUNCTION_ARGS)
 {
-       Oid             indexoid = PG_GETARG_OID(0);
-       int64   heapBlk64 = PG_GETARG_INT64(1);
+       Oid                     indexoid = PG_GETARG_OID(0);
+       int64           heapBlk64 = PG_GETARG_INT64(1);
        BlockNumber heapBlk;
-       Oid             heapoid;
-       Relation heapRel;
-       Relation indexRel;
-       bool    done;
+       Oid                     heapoid;
+       Relation        heapRel;
+       Relation        indexRel;
+       bool            done;
 
        if (heapBlk64 > MaxBlockNumber || heapBlk64 < 0)
        {
@@ -977,7 +977,8 @@ brin_desummarize_range(PG_FUNCTION_ARGS)
                                                RelationGetRelationName(indexRel))));
 
        /* the revmap does the hard work */
-       do {
+       do
+       {
                done = brinRevmapDesummarizeRange(indexRel, heapBlk);
        }
        while (!done);
index 9ed279bf42fa2b8ac1f4fee151f63ef766c3d5ff..fc8b10ab396709f684d56e02da9de5ea0dc26f39 100644 (file)
@@ -318,11 +318,11 @@ bool
 brinRevmapDesummarizeRange(Relation idxrel, BlockNumber heapBlk)
 {
        BrinRevmap *revmap;
-       BlockNumber     pagesPerRange;
+       BlockNumber pagesPerRange;
        RevmapContents *contents;
        ItemPointerData *iptr;
-       ItemPointerData invalidIptr;
-       BlockNumber     revmapBlk;
+       ItemPointerData invalidIptr;
+       BlockNumber revmapBlk;
        Buffer          revmapBuf;
        Buffer          regBuf;
        Page            revmapPg;
@@ -415,7 +415,7 @@ brinRevmapDesummarizeRange(Relation idxrel, BlockNumber heapBlk)
        if (RelationNeedsWAL(idxrel))
        {
                xl_brin_desummarize xlrec;
-               XLogRecPtr              recptr;
+               XLogRecPtr      recptr;
 
                xlrec.pagesPerRange = revmap->rm_pagesPerRange;
                xlrec.heapBlk = heapBlk;
index 8f5b5ceb3f29d4ddf96b795fc479f433c8b9084b..dff7198a39e6116bad787b7204dfa49cfc0ef7b2 100644 (file)
@@ -268,7 +268,7 @@ brin_xlog_desummarize_page(XLogReaderState *record)
        action = XLogReadBufferForRedo(record, 0, &buffer);
        if (action == BLK_NEEDS_REDO)
        {
-               ItemPointerData iptr;
+               ItemPointerData iptr;
 
                ItemPointerSetInvalid(&iptr);
                brinSetHeapBlockItemptr(buffer, xlrec->pagesPerRange, xlrec->heapBlk, iptr);
@@ -283,7 +283,7 @@ brin_xlog_desummarize_page(XLogReaderState *record)
        action = XLogReadBufferForRedo(record, 1, &buffer);
        if (action == BLK_NEEDS_REDO)
        {
-               Page    regPg = BufferGetPage(buffer);
+               Page            regPg = BufferGetPage(buffer);
 
                PageIndexTupleDeleteNoCompact(regPg, xlrec->regOffset);
 
index 5fe1c72da8385690b4f8a222319133d4730eb09d..851c3bf4debc775ab6f1db0e757950c50e35f7c2 100644 (file)
@@ -102,8 +102,8 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
 
                        case INT4OID:
                                {
-                                       int32   num = DatumGetInt32(value);
-                                       char    str[12];        /* sign, 10 digits and '\0' */
+                                       int32           num = DatumGetInt32(value);
+                                       char            str[12];                /* sign, 10 digits and '\0' */
 
                                        pg_ltoa(num, str);
                                        pq_sendcountedtext(&buf, str, strlen(str), false);
@@ -112,8 +112,8 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
 
                        case INT8OID:
                                {
-                                       int64   num = DatumGetInt64(value);
-                                       char    str[23];        /* sign, 21 digits and '\0' */
+                                       int64           num = DatumGetInt64(value);
+                                       char            str[23];                /* sign, 21 digits and '\0' */
 
                                        pg_lltoa(num, str);
                                        pq_sendcountedtext(&buf, str, strlen(str), false);
index 26c077a7bb9f025cc2b00f5c55006d895cd754f5..27e502a36064619e29f2ad3ce4f3f529bf6a7757 100644 (file)
@@ -140,9 +140,9 @@ ginDeletePage(GinVacuumState *gvs, BlockNumber deleteBlkno, BlockNumber leftBlkn
         * exclusive cleanup lock. This guarantees that no insertions currently
         * happen in this subtree. Caller also acquire Exclusive lock on deletable
         * page and is acquiring and releasing exclusive lock on left page before.
-        * Left page was locked and released. Then parent and this page are locked.
-        * We acquire left page lock here only to mark page dirty after changing
-        * right pointer.
+        * Left page was locked and released. Then parent and this page are
+        * locked. We acquire left page lock here only to mark page dirty after
+        * changing right pointer.
         */
        lBuffer = ReadBufferExtended(gvs->index, MAIN_FORKNUM, leftBlkno,
                                                                 RBM_NORMAL, gvs->strategy);
@@ -258,7 +258,7 @@ ginScanToDelete(GinVacuumState *gvs, BlockNumber blkno, bool isRoot,
        buffer = ReadBufferExtended(gvs->index, MAIN_FORKNUM, blkno,
                                                                RBM_NORMAL, gvs->strategy);
 
-       if(!isRoot)
+       if (!isRoot)
                LockBuffer(buffer, GIN_EXCLUSIVE);
 
        page = BufferGetPage(buffer);
@@ -295,8 +295,8 @@ ginScanToDelete(GinVacuumState *gvs, BlockNumber blkno, bool isRoot,
                }
        }
 
-       if(!isRoot)
-                       LockBuffer(buffer, GIN_UNLOCK);
+       if (!isRoot)
+               LockBuffer(buffer, GIN_UNLOCK);
 
        ReleaseBuffer(buffer);
 
@@ -326,7 +326,7 @@ ginVacuumPostingTreeLeaves(GinVacuumState *gvs, BlockNumber blkno, bool isRoot)
                                                                RBM_NORMAL, gvs->strategy);
        page = BufferGetPage(buffer);
 
-       ginTraverseLock(buffer,false);
+       ginTraverseLock(buffer, false);
 
        Assert(GinPageIsData(page));
 
@@ -347,15 +347,15 @@ ginVacuumPostingTreeLeaves(GinVacuumState *gvs, BlockNumber blkno, bool isRoot)
        }
        else
        {
-               OffsetNumber    i;
-               bool                    hasEmptyChild = FALSE;
-               bool                    hasNonEmptyChild = FALSE;
-               OffsetNumber    maxoff = GinPageGetOpaque(page)->maxoff;
-               BlockNumber*    children = palloc(sizeof(BlockNumber) * (maxoff + 1));
+               OffsetNumber i;
+               bool            hasEmptyChild = FALSE;
+               bool            hasNonEmptyChild = FALSE;
+               OffsetNumber maxoff = GinPageGetOpaque(page)->maxoff;
+               BlockNumber *children = palloc(sizeof(BlockNumber) * (maxoff + 1));
 
                /*
-                * Read all children BlockNumbers.
-                * Not sure it is safe if there are many concurrent vacuums.
+                * Read all children BlockNumbers. Not sure it is safe if there are
+                * many concurrent vacuums.
                 */
 
                for (i = FirstOffsetNumber; i <= maxoff; i++)
@@ -380,26 +380,26 @@ ginVacuumPostingTreeLeaves(GinVacuumState *gvs, BlockNumber blkno, bool isRoot)
                vacuum_delay_point();
 
                /*
-                * All subtree is empty - just return TRUE to indicate that parent must
-                * do a cleanup. Unless we are ROOT an there is way to go upper.
+                * All subtree is empty - just return TRUE to indicate that parent
+                * must do a cleanup. Unless we are ROOT an there is way to go upper.
                 */
 
-               if(hasEmptyChild && !hasNonEmptyChild && !isRoot)
+               if (hasEmptyChild && !hasNonEmptyChild && !isRoot)
                        return TRUE;
 
-               if(hasEmptyChild)
+               if (hasEmptyChild)
                {
                        DataPageDeleteStack root,
                                           *ptr,
                                           *tmp;
 
                        buffer = ReadBufferExtended(gvs->index, MAIN_FORKNUM, blkno,
-                                                                                       RBM_NORMAL, gvs->strategy);
+                                                                               RBM_NORMAL, gvs->strategy);
                        LockBufferForCleanup(buffer);
 
                        memset(&root, 0, sizeof(DataPageDeleteStack));
-                               root.leftBlkno = InvalidBlockNumber;
-                               root.isRoot = TRUE;
+                       root.leftBlkno = InvalidBlockNumber;
+                       root.isRoot = TRUE;
 
                        ginScanToDelete(gvs, blkno, TRUE, &root, InvalidOffsetNumber);
 
index df54638f3e06f4b1e51aef9046028bd872355224..d0b0547491f7c34df3dca328eef3e1eb2851c3d0 100644 (file)
@@ -333,12 +333,12 @@ hashgettuple(IndexScanDesc scan, ScanDirection dir)
                if (scan->kill_prior_tuple)
                {
                        /*
-                        * Yes, so remember it for later. (We'll deal with all such
-                        * tuples at once right after leaving the index page or at
-                        * end of scan.) In case if caller reverses the indexscan
-                        * direction it is quite possible that the same item might
-                        * get entered multiple times. But, we don't detect that;
-                        * instead, we just forget any excess entries.
+                        * Yes, so remember it for later. (We'll deal with all such tuples
+                        * at once right after leaving the index page or at end of scan.)
+                        * In case if caller reverses the indexscan direction it is quite
+                        * possible that the same item might get entered multiple times.
+                        * But, we don't detect that; instead, we just forget any excess
+                        * entries.
                         */
                        if (so->killedItems == NULL)
                                so->killedItems = palloc(MaxIndexTuplesPerPage *
@@ -348,7 +348,7 @@ hashgettuple(IndexScanDesc scan, ScanDirection dir)
                        {
                                so->killedItems[so->numKilled].heapTid = so->hashso_heappos;
                                so->killedItems[so->numKilled].indexOffset =
-                                                       ItemPointerGetOffsetNumber(&(so->hashso_curpos));
+                                       ItemPointerGetOffsetNumber(&(so->hashso_curpos));
                                so->numKilled++;
                        }
                }
@@ -477,9 +477,8 @@ hashrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
        Relation        rel = scan->indexRelation;
 
        /*
-        * Before leaving current page, deal with any killed items.
-        * Also, ensure that we acquire lock on current page before
-        * calling _hash_kill_items.
+        * Before leaving current page, deal with any killed items. Also, ensure
+        * that we acquire lock on current page before calling _hash_kill_items.
         */
        if (so->numKilled > 0)
        {
@@ -516,9 +515,8 @@ hashendscan(IndexScanDesc scan)
        Relation        rel = scan->indexRelation;
 
        /*
-        * Before leaving current page, deal with any killed items.
-        * Also, ensure that we acquire lock on current page before
-        * calling _hash_kill_items.
+        * Before leaving current page, deal with any killed items. Also, ensure
+        * that we acquire lock on current page before calling _hash_kill_items.
         */
        if (so->numKilled > 0)
        {
@@ -889,8 +887,8 @@ hashbucketcleanup(Relation rel, Bucket cur_bucket, Buffer bucket_buf,
 
                        /*
                         * Let us mark the page as clean if vacuum removes the DEAD tuples
-                        * from an index page. We do this by clearing LH_PAGE_HAS_DEAD_TUPLES
-                        * flag.
+                        * from an index page. We do this by clearing
+                        * LH_PAGE_HAS_DEAD_TUPLES flag.
                         */
                        if (tuples_removed && *tuples_removed > 0 &&
                                H_HAS_DEAD_TUPLES(opaque))
index d1c0e6904fcd58a8d0febf63ab70f6f6bf86faad..0ea11b2e7422b20cc5a8d6ff3d3c3cc66937b94a 100644 (file)
@@ -950,22 +950,22 @@ hash_xlog_update_meta_page(XLogReaderState *record)
 static TransactionId
 hash_xlog_vacuum_get_latestRemovedXid(XLogReaderState *record)
 {
-       xl_hash_vacuum_one_page *xlrec;
-       OffsetNumber    *unused;
+       xl_hash_vacuum_one_page *xlrec;
+       OffsetNumber *unused;
        Buffer          ibuffer,
                                hbuffer;
        Page            ipage,
                                hpage;
-       RelFileNode     rnode;
-       BlockNumber     blkno;
+       RelFileNode rnode;
+       BlockNumber blkno;
        ItemId          iitemid,
                                hitemid;
        IndexTuple      itup;
-       HeapTupleHeader htuphdr;
-       BlockNumber     hblkno;
-       OffsetNumber    hoffnum;
-       TransactionId   latestRemovedXid = InvalidTransactionId;
-       int             i;
+       HeapTupleHeader htuphdr;
+       BlockNumber hblkno;
+       OffsetNumber hoffnum;
+       TransactionId latestRemovedXid = InvalidTransactionId;
+       int                     i;
 
        xlrec = (xl_hash_vacuum_one_page *) XLogRecGetData(record);
 
@@ -984,9 +984,9 @@ hash_xlog_vacuum_get_latestRemovedXid(XLogReaderState *record)
                return latestRemovedXid;
 
        /*
-        * Check if WAL replay has reached a consistent database state. If not,
-        * we must PANIC. See the definition of btree_xlog_delete_get_latestRemovedXid
-        * for more details.
+        * Check if WAL replay has reached a consistent database state. If not, we
+        * must PANIC. See the definition of
+        * btree_xlog_delete_get_latestRemovedXid for more details.
         */
        if (!reachedConsistency)
                elog(PANIC, "hash_xlog_vacuum_get_latestRemovedXid: cannot operate with inconsistent data");
@@ -1098,11 +1098,11 @@ hash_xlog_vacuum_get_latestRemovedXid(XLogReaderState *record)
 static void
 hash_xlog_vacuum_one_page(XLogReaderState *record)
 {
-       XLogRecPtr lsn = record->EndRecPtr;
+       XLogRecPtr      lsn = record->EndRecPtr;
        xl_hash_vacuum_one_page *xldata;
-       Buffer buffer;
-       Buffer metabuf;
-       Page page;
+       Buffer          buffer;
+       Buffer          metabuf;
+       Page            page;
        XLogRedoAction action;
        HashPageOpaque pageopaque;
 
@@ -1123,7 +1123,7 @@ hash_xlog_vacuum_one_page(XLogReaderState *record)
        if (InHotStandby)
        {
                TransactionId latestRemovedXid =
-                                       hash_xlog_vacuum_get_latestRemovedXid(record);
+               hash_xlog_vacuum_get_latestRemovedXid(record);
                RelFileNode rnode;
 
                XLogRecGetBlockTag(record, 0, &rnode, NULL, NULL);
@@ -1146,8 +1146,8 @@ hash_xlog_vacuum_one_page(XLogReaderState *record)
                }
 
                /*
-                * Mark the page as not containing any LP_DEAD items. See comments
-                * in _hash_vacuum_one_page() for details.
+                * Mark the page as not containing any LP_DEAD items. See comments in
+                * _hash_vacuum_one_page() for details.
                 */
                pageopaque = (HashPageOpaque) PageGetSpecialPointer(page);
                pageopaque->hasho_flag &= ~LH_PAGE_HAS_DEAD_TUPLES;
@@ -1160,7 +1160,7 @@ hash_xlog_vacuum_one_page(XLogReaderState *record)
 
        if (XLogReadBufferForRedo(record, 1, &metabuf) == BLK_NEEDS_REDO)
        {
-               Page metapage;
+               Page            metapage;
                HashMetaPage metap;
 
                metapage = BufferGetPage(metabuf);
index 8699b5bc30b46bb41569c24d6b30d4a764bb5fdc..01c8d8006c0322bb371b6fc1b16c8655968a675a 100644 (file)
@@ -24,7 +24,7 @@
 #include "storage/buf_internals.h"
 
 static void _hash_vacuum_one_page(Relation rel, Buffer metabuf, Buffer buf,
-                                                                 RelFileNode hnode);
+                                         RelFileNode hnode);
 
 /*
  *     _hash_doinsert() -- Handle insertion of a single index tuple.
@@ -63,8 +63,8 @@ restart_insert:
 
        /*
         * Read the metapage.  We don't lock it yet; HashMaxItemSize() will
-        * examine pd_pagesize_version, but that can't change so we can examine
-        * it without a lock.
+        * examine pd_pagesize_version, but that can't change so we can examine it
+        * without a lock.
         */
        metabuf = _hash_getbuf(rel, HASH_METAPAGE, HASH_NOLOCK, LH_META_PAGE);
        metapage = BufferGetPage(metabuf);
@@ -126,10 +126,9 @@ restart_insert:
                BlockNumber nextblkno;
 
                /*
-                * Check if current page has any DEAD tuples. If yes,
-                * delete these tuples and see if we can get a space for
-                * the new item to be inserted before moving to the next
-                * page in the bucket chain.
+                * Check if current page has any DEAD tuples. If yes, delete these
+                * tuples and see if we can get a space for the new item to be
+                * inserted before moving to the next page in the bucket chain.
                 */
                if (H_HAS_DEAD_TUPLES(pageopaque))
                {
@@ -139,7 +138,7 @@ restart_insert:
                                _hash_vacuum_one_page(rel, metabuf, buf, heapRel->rd_node);
 
                                if (PageGetFreeSpace(page) >= itemsz)
-                                       break;                          /* OK, now we have enough space */
+                                       break;          /* OK, now we have enough space */
                        }
                }
 
@@ -337,13 +336,13 @@ static void
 _hash_vacuum_one_page(Relation rel, Buffer metabuf, Buffer buf,
                                          RelFileNode hnode)
 {
-       OffsetNumber    deletable[MaxOffsetNumber];
-       int ndeletable = 0;
+       OffsetNumber deletable[MaxOffsetNumber];
+       int                     ndeletable = 0;
        OffsetNumber offnum,
-                                maxoff;
-       Page    page = BufferGetPage(buf);
-       HashPageOpaque  pageopaque;
-       HashMetaPage    metap;
+                               maxoff;
+       Page            page = BufferGetPage(buf);
+       HashPageOpaque pageopaque;
+       HashMetaPage metap;
 
        /* Scan each tuple in page to see if it is marked as LP_DEAD */
        maxoff = PageGetMaxOffsetNumber(page);
@@ -351,7 +350,7 @@ _hash_vacuum_one_page(Relation rel, Buffer metabuf, Buffer buf,
                 offnum <= maxoff;
                 offnum = OffsetNumberNext(offnum))
        {
-               ItemId  itemId = PageGetItemId(page, offnum);
+               ItemId          itemId = PageGetItemId(page, offnum);
 
                if (ItemIdIsDead(itemId))
                        deletable[ndeletable++] = offnum;
@@ -360,8 +359,7 @@ _hash_vacuum_one_page(Relation rel, Buffer metabuf, Buffer buf,
        if (ndeletable > 0)
        {
                /*
-                * Write-lock the meta page so that we can decrement
-                * tuple count.
+                * Write-lock the meta page so that we can decrement tuple count.
                 */
                LockBuffer(metabuf, BUFFER_LOCK_EXCLUSIVE);
 
@@ -374,8 +372,8 @@ _hash_vacuum_one_page(Relation rel, Buffer metabuf, Buffer buf,
                 * Mark the page as not containing any LP_DEAD items. This is not
                 * certainly true (there might be some that have recently been marked,
                 * but weren't included in our target-item list), but it will almost
-                * always be true and it doesn't seem worth an additional page scan
-                * to check it. Remember that LH_PAGE_HAS_DEAD_TUPLES is only a hint
+                * always be true and it doesn't seem worth an additional page scan to
+                * check it. Remember that LH_PAGE_HAS_DEAD_TUPLES is only a hint
                 * anyway.
                 */
                pageopaque = (HashPageOpaque) PageGetSpecialPointer(page);
@@ -390,7 +388,7 @@ _hash_vacuum_one_page(Relation rel, Buffer metabuf, Buffer buf,
                /* XLOG stuff */
                if (RelationNeedsWAL(rel))
                {
-                       xl_hash_vacuum_one_page xlrec;
+                       xl_hash_vacuum_one_page xlrec;
                        XLogRecPtr      recptr;
 
                        xlrec.hnode = hnode;
@@ -401,12 +399,12 @@ _hash_vacuum_one_page(Relation rel, Buffer metabuf, Buffer buf,
                        XLogRegisterData((char *) &xlrec, SizeOfHashVacuumOnePage);
 
                        /*
-                        * We need the target-offsets array whether or not we store the whole
-                        * buffer, to allow us to find the latestRemovedXid on a standby
-                        * server.
+                        * We need the target-offsets array whether or not we store the
+                        * whole buffer, to allow us to find the latestRemovedXid on a
+                        * standby server.
                         */
                        XLogRegisterData((char *) deletable,
-                                               ndeletable * sizeof(OffsetNumber));
+                                                        ndeletable * sizeof(OffsetNumber));
 
                        XLogRegisterBuffer(1, metabuf, REGBUF_STANDARD);
 
@@ -417,9 +415,10 @@ _hash_vacuum_one_page(Relation rel, Buffer metabuf, Buffer buf,
                }
 
                END_CRIT_SECTION();
+
                /*
-                * Releasing write lock on meta page as we have updated
-                * the tuple count.
+                * Releasing write lock on meta page as we have updated the tuple
+                * count.
                 */
                LockBuffer(metabuf, BUFFER_LOCK_UNLOCK);
        }
index bf1ffff4e8c31382b00cb21db0d142545a1b74de..4544889294a80c37ba8d2758f3d154693092ad1f 100644 (file)
@@ -177,8 +177,8 @@ _hash_initbuf(Buffer buf, uint32 max_bucket, uint32 num_bucket, uint32 flag,
        pageopaque = (HashPageOpaque) PageGetSpecialPointer(page);
 
        /*
-        * Set hasho_prevblkno with current hashm_maxbucket. This value will
-        * be used to validate cached HashMetaPageData. See
+        * Set hasho_prevblkno with current hashm_maxbucket. This value will be
+        * used to validate cached HashMetaPageData. See
         * _hash_getbucketbuf_from_hashkey().
         */
        pageopaque->hasho_prevblkno = max_bucket;
@@ -509,8 +509,8 @@ _hash_init_metabuffer(Buffer buf, double num_tuples, RegProcedure procid,
         * Choose the number of initial bucket pages to match the fill factor
         * given the estimated number of tuples.  We round up the result to the
         * total number of buckets which has to be allocated before using its
-        * _hashm_spare element. However always force at least 2 bucket pages.
-        * The upper limit is determined by considerations explained in
+        * _hashm_spare element. However always force at least 2 bucket pages. The
+        * upper limit is determined by considerations explained in
         * _hash_expandtable().
         */
        dnumbuckets = num_tuples / ffactor;
@@ -568,8 +568,8 @@ _hash_init_metabuffer(Buffer buf, double num_tuples, RegProcedure procid,
        metap->hashm_maxbucket = num_buckets - 1;
 
        /*
-        * Set highmask as next immediate ((2 ^ x) - 1), which should be sufficient
-        * to cover num_buckets.
+        * Set highmask as next immediate ((2 ^ x) - 1), which should be
+        * sufficient to cover num_buckets.
         */
        metap->hashm_highmask = (1 << (_hash_log2(num_buckets + 1))) - 1;
        metap->hashm_lowmask = (metap->hashm_highmask >> 1);
@@ -748,8 +748,8 @@ restart_expand:
        {
                /*
                 * Copy bucket mapping info now; refer to the comment in code below
-                * where we copy this information before calling _hash_splitbucket
-                * to see why this is okay.
+                * where we copy this information before calling _hash_splitbucket to
+                * see why this is okay.
                 */
                maxbucket = metap->hashm_maxbucket;
                highmask = metap->hashm_highmask;
@@ -792,8 +792,7 @@ restart_expand:
                 * We treat allocation of buckets as a separate WAL-logged action.
                 * Even if we fail after this operation, won't leak bucket pages;
                 * rather, the next split will consume this space. In any case, even
-                * without failure we don't use all the space in one split
-                * operation.
+                * without failure we don't use all the space in one split operation.
                 */
                buckets_to_add = _hash_get_totalbuckets(spare_ndx) - new_bucket;
                if (!_hash_alloc_buckets(rel, start_nblkno, buckets_to_add))
@@ -870,10 +869,9 @@ restart_expand:
 
        /*
         * Mark the old bucket to indicate that split is in progress.  (At
-        * operation end, we will clear the split-in-progress flag.)  Also,
-        * for a primary bucket page, hasho_prevblkno stores the number of
-        * buckets that existed as of the last split, so we must update that
-        * value here.
+        * operation end, we will clear the split-in-progress flag.)  Also, for a
+        * primary bucket page, hasho_prevblkno stores the number of buckets that
+        * existed as of the last split, so we must update that value here.
         */
        oopaque->hasho_flag |= LH_BUCKET_BEING_SPLIT;
        oopaque->hasho_prevblkno = maxbucket;
@@ -1008,8 +1006,8 @@ _hash_alloc_buckets(Relation rel, BlockNumber firstblock, uint32 nblocks)
 
        /*
         * Initialize the page.  Just zeroing the page won't work; see
-        * _hash_freeovflpage for similar usage.  We take care to make the
-        * special space valid for the benefit of tools such as pageinspect.
+        * _hash_freeovflpage for similar usage.  We take care to make the special
+        * space valid for the benefit of tools such as pageinspect.
         */
        _hash_pageinit(page, BLCKSZ);
 
@@ -1462,11 +1460,11 @@ log_split_page(Relation rel, Buffer buf)
  *     _hash_getcachedmetap() -- Returns cached metapage data.
  *
  *     If metabuf is not InvalidBuffer, caller must hold a pin, but no lock, on
- *  the metapage.  If not set, we'll set it before returning if we have to
- *  refresh the cache, and return with a pin but no lock on it; caller is
- *  responsible for releasing the pin.
+ *     the metapage.  If not set, we'll set it before returning if we have to
+ *     refresh the cache, and return with a pin but no lock on it; caller is
+ *     responsible for releasing the pin.
  *
- *  We refresh the cache if it's not initialized yet or force_refresh is true.
+ *     We refresh the cache if it's not initialized yet or force_refresh is true.
  */
 HashMetaPage
 _hash_getcachedmetap(Relation rel, Buffer *metabuf, bool force_refresh)
@@ -1476,13 +1474,13 @@ _hash_getcachedmetap(Relation rel, Buffer *metabuf, bool force_refresh)
        Assert(metabuf);
        if (force_refresh || rel->rd_amcache == NULL)
        {
-               char   *cache = NULL;
+               char       *cache = NULL;
 
                /*
-                * It's important that we don't set rd_amcache to an invalid
-                * value.  Either MemoryContextAlloc or _hash_getbuf could fail,
-                * so don't install a pointer to the newly-allocated storage in the
-                * actual relcache entry until both have succeeeded.
+                * It's important that we don't set rd_amcache to an invalid value.
+                * Either MemoryContextAlloc or _hash_getbuf could fail, so don't
+                * install a pointer to the newly-allocated storage in the actual
+                * relcache entry until both have succeeeded.
                 */
                if (rel->rd_amcache == NULL)
                        cache = MemoryContextAlloc(rel->rd_indexcxt,
@@ -1517,7 +1515,7 @@ _hash_getcachedmetap(Relation rel, Buffer *metabuf, bool force_refresh)
  *     us an opportunity to use the previously saved metapage contents to reach
  *     the target bucket buffer, instead of reading from the metapage every time.
  *     This saves one buffer access every time we want to reach the target bucket
- *  buffer, which is very helpful savings in bufmgr traffic and contention.
+ *     buffer, which is very helpful savings in bufmgr traffic and contention.
  *
  *     The access type parameter (HASH_READ or HASH_WRITE) indicates whether the
  *     bucket buffer has to be locked for reading or writing.
index 9f832f2544fcfadfe8b3d768ee4391793369b032..c513c3b842ed6ddaff13118ef5015c2a2e866309 100644 (file)
@@ -528,20 +528,21 @@ _hash_get_newbucket_from_oldbucket(Relation rel, Bucket old_bucket,
 void
 _hash_kill_items(IndexScanDesc scan)
 {
-       HashScanOpaque  so = (HashScanOpaque) scan->opaque;
-       Page    page;
-       HashPageOpaque  opaque;
-       OffsetNumber    offnum, maxoff;
-       int     numKilled = so->numKilled;
-       int             i;
-       bool    killedsomething = false;
+       HashScanOpaque so = (HashScanOpaque) scan->opaque;
+       Page            page;
+       HashPageOpaque opaque;
+       OffsetNumber offnum,
+                               maxoff;
+       int                     numKilled = so->numKilled;
+       int                     i;
+       bool            killedsomething = false;
 
        Assert(so->numKilled > 0);
        Assert(so->killedItems != NULL);
 
        /*
-        * Always reset the scan state, so we don't look for same
-        * items on other pages.
+        * Always reset the scan state, so we don't look for same items on other
+        * pages.
         */
        so->numKilled = 0;
 
@@ -555,7 +556,7 @@ _hash_kill_items(IndexScanDesc scan)
 
                while (offnum <= maxoff)
                {
-                       ItemId  iid = PageGetItemId(page, offnum);
+                       ItemId          iid = PageGetItemId(page, offnum);
                        IndexTuple      ituple = (IndexTuple) PageGetItem(page, iid);
 
                        if (ItemPointerEquals(&ituple->t_tid, &so->killedItems[i].heapTid))
@@ -563,15 +564,15 @@ _hash_kill_items(IndexScanDesc scan)
                                /* found the item */
                                ItemIdMarkDead(iid);
                                killedsomething = true;
-                               break;          /* out of inner search loop */
+                               break;                  /* out of inner search loop */
                        }
                        offnum = OffsetNumberNext(offnum);
                }
        }
 
        /*
-        * Since this can be redone later if needed, mark as dirty hint.
-        * Whenever we mark anything LP_DEAD, we also set the page's
+        * Since this can be redone later if needed, mark as dirty hint. Whenever
+        * we mark anything LP_DEAD, we also set the page's
         * LH_PAGE_HAS_DEAD_TUPLES flag, which is likewise just a hint.
         */
        if (killedsomething)
index 0c3e2b065a0f23d845f67af6d6f7dc284bb5616b..e890e08c9ab4d835c50b4ee45660c2dbf99d98b3 100644 (file)
@@ -3518,10 +3518,10 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
         *
         * For HOT considerations, this is wasted effort if we fail to update or
         * have to put the new tuple on a different page.  But we must compute the
-        * list before obtaining buffer lock --- in the worst case, if we are doing
-        * an update on one of the relevant system catalogs, we could deadlock if
-        * we try to fetch the list later.  In any case, the relcache caches the
-        * data so this is usually pretty cheap.
+        * list before obtaining buffer lock --- in the worst case, if we are
+        * doing an update on one of the relevant system catalogs, we could
+        * deadlock if we try to fetch the list later.  In any case, the relcache
+        * caches the data so this is usually pretty cheap.
         *
         * We also need columns used by the replica identity and columns that are
         * considered the "key" of rows in the table.
@@ -3540,15 +3540,16 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
        page = BufferGetPage(buffer);
 
        interesting_attrs = NULL;
+
        /*
         * If the page is already full, there is hardly any chance of doing a HOT
         * update on this page. It might be wasteful effort to look for index
-        * column updates only to later reject HOT updates for lack of space in the
-        * same page. So we be conservative and only fetch hot_attrs if the page is
-        * not already full. Since we are already holding a pin on the buffer,
-        * there is no chance that the buffer can get cleaned up concurrently and
-        * even if that was possible, in the worst case we lose a chance to do a
-        * HOT update.
+        * column updates only to later reject HOT updates for lack of space in
+        * the same page. So we be conservative and only fetch hot_attrs if the
+        * page is not already full. Since we are already holding a pin on the
+        * buffer, there is no chance that the buffer can get cleaned up
+        * concurrently and even if that was possible, in the worst case we lose a
+        * chance to do a HOT update.
         */
        if (!PageIsFull(page))
        {
@@ -4176,7 +4177,7 @@ l2:
         * logged.
         */
        old_key_tuple = ExtractReplicaIdentity(relation, &oldtup,
-                                                                                  bms_overlap(modified_attrs, id_attrs),
+                                                                          bms_overlap(modified_attrs, id_attrs),
                                                                                   &old_key_copied);
 
        /* NO EREPORT(ERROR) from here till changes are logged */
@@ -4422,17 +4423,17 @@ static Bitmapset *
 HeapDetermineModifiedColumns(Relation relation, Bitmapset *interesting_cols,
                                                         HeapTuple oldtup, HeapTuple newtup)
 {
-       int             attnum;
-       Bitmapset *modified = NULL;
+       int                     attnum;
+       Bitmapset  *modified = NULL;
 
        while ((attnum = bms_first_member(interesting_cols)) >= 0)
        {
                attnum += FirstLowInvalidHeapAttributeNumber;
 
                if (!heap_tuple_attr_equals(RelationGetDescr(relation),
-                                                                  attnum, oldtup, newtup))
+                                                                       attnum, oldtup, newtup))
                        modified = bms_add_member(modified,
-                                                                         attnum - FirstLowInvalidHeapAttributeNumber);
+                                                               attnum - FirstLowInvalidHeapAttributeNumber);
        }
 
        return modified;
index 775f2ff1f8c343232681aab6a79f7364e09a1684..116f5f32f6ea8f509772f19f180b1ee8e424f5f7 100644 (file)
@@ -100,7 +100,7 @@ typedef struct BTParallelScanDescData
                                                                                 * scan */
        slock_t         btps_mutex;             /* protects above variables */
        ConditionVariable btps_cv;      /* used to synchronize parallel scan */
-} BTParallelScanDescData;
+}      BTParallelScanDescData;
 
 typedef struct BTParallelScanDescData *BTParallelScanDesc;
 
@@ -289,11 +289,11 @@ btbuildempty(Relation index)
        _bt_initmetapage(metapage, P_NONE, 0);
 
        /*
-        * Write the page and log it.  It might seem that an immediate sync
-        * would be sufficient to guarantee that the file exists on disk, but
-        * recovery itself might remove it while replaying, for example, an
-        * XLOG_DBASE_CREATE or XLOG_TBLSPC_CREATE record.  Therefore, we
-        * need this even when wal_level=minimal.
+        * Write the page and log it.  It might seem that an immediate sync would
+        * be sufficient to guarantee that the file exists on disk, but recovery
+        * itself might remove it while replaying, for example, an
+        * XLOG_DBASE_CREATE or XLOG_TBLSPC_CREATE record.  Therefore, we need
+        * this even when wal_level=minimal.
         */
        PageSetChecksumInplace(metapage, BTREE_METAPAGE);
        smgrwrite(index->rd_smgr, INIT_FORKNUM, BTREE_METAPAGE,
index 8eb5275a8b4833b26aee0d963f54887edeced780..637ebf30f8594382991bc4887429801f07042952 100644 (file)
@@ -66,7 +66,7 @@ brin_desc(StringInfo buf, XLogReaderState *record)
                xl_brin_desummarize *xlrec = (xl_brin_desummarize *) rec;
 
                appendStringInfo(buf, "pagesPerRange %u, heapBlk %u, page offset %u",
-                                                xlrec->pagesPerRange, xlrec->heapBlk, xlrec->regOffset);
+                                        xlrec->pagesPerRange, xlrec->heapBlk, xlrec->regOffset);
        }
 }
 
index ef268c5ab3003657c555d31c4e6e4b32d57b0a43..9181154ffd81c1d4e5f77bd35416e092155d3c6f 100644 (file)
@@ -36,7 +36,7 @@ clog_desc(StringInfo buf, XLogReaderState *record)
 
                memcpy(&xlrec, rec, sizeof(xl_clog_truncate));
                appendStringInfo(buf, "page %d; oldestXact %u",
-                       xlrec.pageno, xlrec.oldestXact);
+                                                xlrec.pageno, xlrec.oldestXact);
        }
 }
 
index b22fdd48f3e55deede5770459649bba475a272b8..df51f3ce1f50f37e5f3d91f8edc43219e13b3152 100644 (file)
@@ -117,18 +117,18 @@ gin_desc(StringInfo buf, XLogReaderState *record)
 
                                        if (!(xlrec->flags & GIN_INSERT_ISDATA))
                                                appendStringInfo(buf, " isdelete: %c",
-                                                (((ginxlogInsertEntry *) payload)->isDelete) ? 'T' : 'F');
+                                                                                (((ginxlogInsertEntry *) payload)->isDelete) ? 'T' : 'F');
                                        else if (xlrec->flags & GIN_INSERT_ISLEAF)
                                                desc_recompress_leaf(buf, (ginxlogRecompressDataLeaf *) payload);
                                        else
                                        {
                                                ginxlogInsertDataInternal *insertData =
-                                                       (ginxlogInsertDataInternal *) payload;
+                                               (ginxlogInsertDataInternal *) payload;
 
                                                appendStringInfo(buf, " pitem: %u-%u/%u",
-                                                                                PostingItemGetBlockNumber(&insertData->newitem),
-                                                                                ItemPointerGetBlockNumber(&insertData->newitem.key),
-                                                                                ItemPointerGetOffsetNumber(&insertData->newitem.key));
+                                                        PostingItemGetBlockNumber(&insertData->newitem),
+                                                ItemPointerGetBlockNumber(&insertData->newitem.key),
+                                               ItemPointerGetOffsetNumber(&insertData->newitem.key));
                                        }
                                }
                        }
@@ -159,7 +159,7 @@ gin_desc(StringInfo buf, XLogReaderState *record)
                                else
                                {
                                        ginxlogVacuumDataLeafPage *xlrec =
-                                               (ginxlogVacuumDataLeafPage *) XLogRecGetBlockData(record, 0, NULL);
+                                       (ginxlogVacuumDataLeafPage *) XLogRecGetBlockData(record, 0, NULL);
 
                                        desc_recompress_leaf(buf, &xlrec->data);
                                }
index 00a0ab4438647164b4b2df5fbbdced2f46d3c371..9a3725991648d2b6b29e54d1b14ddbb2c2af9bf8 100644 (file)
@@ -164,10 +164,10 @@ spgbuildempty(Relation index)
 
        /*
         * Write the page and log it unconditionally.  This is important
-        * particularly for indexes created on tablespaces and databases
-        * whose creation happened after the last redo pointer as recovery
-        * removes any of their existing content when the corresponding
-        * create records are replayed.
+        * particularly for indexes created on tablespaces and databases whose
+        * creation happened after the last redo pointer as recovery removes any
+        * of their existing content when the corresponding create records are
+        * replayed.
         */
        PageSetChecksumInplace(page, SPGIST_METAPAGE_BLKNO);
        smgrwrite(index->rd_smgr, INIT_FORKNUM, SPGIST_METAPAGE_BLKNO,
index 7a007a6ba50349395ef6643d4c78dbf549a02812..bece57589e80ebceaacca0db0f8775a9ed3ba8f6 100644 (file)
@@ -84,7 +84,7 @@ static int    ZeroCLOGPage(int pageno, bool writeXlog);
 static bool CLOGPagePrecedes(int page1, int page2);
 static void WriteZeroPageXlogRec(int pageno);
 static void WriteTruncateXlogRec(int pageno, TransactionId oldestXact,
-                                                                Oid oldestXidDb);
+                                        Oid oldestXidDb);
 static void TransactionIdSetPageStatus(TransactionId xid, int nsubxids,
                                                   TransactionId *subxids, XidStatus status,
                                                   XLogRecPtr lsn, int pageno);
@@ -680,13 +680,13 @@ TruncateCLOG(TransactionId oldestXact, Oid oldestxid_datoid)
 
        /* vac_truncate_clog already advanced oldestXid */
        Assert(TransactionIdPrecedesOrEquals(oldestXact,
-                  ShmemVariableCache->oldestXid));
+                                                                                ShmemVariableCache->oldestXid));
 
        /*
-        * Write XLOG record and flush XLOG to disk. We record the oldest xid we're
-        * keeping information about here so we can ensure that it's always ahead
-        * of clog truncation in case we crash, and so a standby finds out the new
-        * valid xid before the next checkpoint.
+        * Write XLOG record and flush XLOG to disk. We record the oldest xid
+        * we're keeping information about here so we can ensure that it's always
+        * ahead of clog truncation in case we crash, and so a standby finds out
+        * the new valid xid before the next checkpoint.
         */
        WriteTruncateXlogRec(cutoffPage, oldestXact, oldestxid_datoid);
 
index 03ffa20908404481f4b19d55cd909d58a01d0c9d..7646c23c4e7fa6e24a75cddb8263b95bf46bdd20 100644 (file)
@@ -748,8 +748,8 @@ ShutdownCommitTs(void)
        SimpleLruFlush(CommitTsCtl, false);
 
        /*
-        * fsync pg_commit_ts to ensure that any files flushed previously are durably
-        * on disk.
+        * fsync pg_commit_ts to ensure that any files flushed previously are
+        * durably on disk.
         */
        fsync_fname("pg_commit_ts", true);
 }
@@ -764,8 +764,8 @@ CheckPointCommitTs(void)
        SimpleLruFlush(CommitTsCtl, true);
 
        /*
-        * fsync pg_commit_ts to ensure that any files flushed previously are durably
-        * on disk.
+        * fsync pg_commit_ts to ensure that any files flushed previously are
+        * durably on disk.
         */
        fsync_fname("pg_commit_ts", true);
 }
index cc68484a5d633db18db3e4b8f30380a7662af673..cef03f83e03f3be28d02945c152971b1527ab4b1 100644 (file)
@@ -87,9 +87,9 @@ SubTransSetParent(TransactionId xid, TransactionId parent)
        ptr += entryno;
 
        /*
-        * It's possible we'll try to set the parent xid multiple times
-        * but we shouldn't ever be changing the xid from one valid xid
-        * to another valid xid, which would corrupt the data structure.
+        * It's possible we'll try to set the parent xid multiple times but we
+        * shouldn't ever be changing the xid from one valid xid to another valid
+        * xid, which would corrupt the data structure.
         */
        if (*ptr != parent)
        {
@@ -162,13 +162,13 @@ SubTransGetTopmostTransaction(TransactionId xid)
                parentXid = SubTransGetParent(parentXid);
 
                /*
-                * By convention the parent xid gets allocated first, so should
-                * always precede the child xid. Anything else points to a corrupted
-                * data structure that could lead to an infinite loop, so exit.
+                * By convention the parent xid gets allocated first, so should always
+                * precede the child xid. Anything else points to a corrupted data
+                * structure that could lead to an infinite loop, so exit.
                 */
                if (!TransactionIdPrecedes(parentXid, previousXid))
                        elog(ERROR, "pg_subtrans contains invalid entry: xid %u points to parent xid %u",
-                                                       previousXid, parentXid);
+                                previousXid, parentXid);
        }
 
        Assert(TransactionIdIsValid(previousXid));
index 7bf2555af2266bcc216fe848eb94af3c97bd763e..c50f9c4bf6537d882cfe8ea877770eaa0200cde2 100644 (file)
@@ -166,7 +166,7 @@ typedef struct GlobalTransactionData
         */
        XLogRecPtr      prepare_start_lsn;              /* XLOG offset of prepare record start */
        XLogRecPtr      prepare_end_lsn;        /* XLOG offset of prepare record end */
-       TransactionId   xid;                    /* The GXACT id */
+       TransactionId xid;                      /* The GXACT id */
 
        Oid                     owner;                  /* ID of user that executed the xact */
        BackendId       locking_backend;        /* backend currently working on the xact */
@@ -220,11 +220,11 @@ static void RemoveGXact(GlobalTransaction gxact);
 
 static void XlogReadTwoPhaseData(XLogRecPtr lsn, char **buf, int *len);
 static char *ProcessTwoPhaseBuffer(TransactionId xid,
-                                                       XLogRecPtr      prepare_start_lsn,
-                                                       bool fromdisk, bool setParent, bool setNextXid);
+                                         XLogRecPtr prepare_start_lsn,
+                                         bool fromdisk, bool setParent, bool setNextXid);
 static void MarkAsPreparingGuts(GlobalTransaction gxact, TransactionId xid,
-                               const char *gid, TimestampTz prepared_at, Oid owner,
-                               Oid databaseid);
+                                       const char *gid, TimestampTz prepared_at, Oid owner,
+                                       Oid databaseid);
 static void RemoveTwoPhaseFile(TransactionId xid, bool giveWarning);
 static void RecreateTwoPhaseFile(TransactionId xid, void *content, int len);
 
@@ -1304,7 +1304,7 @@ XlogReadTwoPhaseData(XLogRecPtr lsn, char **buf, int *len)
                ereport(ERROR,
                                (errcode(ERRCODE_OUT_OF_MEMORY),
                                 errmsg("out of memory"),
-                  errdetail("Failed while allocating a WAL reading processor.")));
+                        errdetail("Failed while allocating a WAL reading processor.")));
 
        record = XLogReadRecord(xlogreader, lsn, &errormsg);
        if (record == NULL)
@@ -1318,9 +1318,9 @@ XlogReadTwoPhaseData(XLogRecPtr lsn, char **buf, int *len)
                (XLogRecGetInfo(xlogreader) & XLOG_XACT_OPMASK) != XLOG_XACT_PREPARE)
                ereport(ERROR,
                                (errcode_for_file_access(),
-                                errmsg("expected two-phase state data is not present in WAL at %X/%X",
-                                               (uint32) (lsn >> 32),
-                                               (uint32) lsn)));
+               errmsg("expected two-phase state data is not present in WAL at %X/%X",
+                          (uint32) (lsn >> 32),
+                          (uint32) lsn)));
 
        if (len != NULL)
                *len = XLogRecGetDataLen(xlogreader);
@@ -1675,7 +1675,10 @@ CheckPointTwoPhase(XLogRecPtr redo_horizon)
        LWLockAcquire(TwoPhaseStateLock, LW_SHARED);
        for (i = 0; i < TwoPhaseState->numPrepXacts; i++)
        {
-               /* Note that we are using gxact not pgxact so this works in recovery also */
+               /*
+                * Note that we are using gxact not pgxact so this works in recovery
+                * also
+                */
                GlobalTransaction gxact = TwoPhaseState->prepXacts[i];
 
                if ((gxact->valid || gxact->inredo) &&
@@ -1727,8 +1730,8 @@ CheckPointTwoPhase(XLogRecPtr redo_horizon)
 void
 restoreTwoPhaseData(void)
 {
-       DIR                        *cldir;
-       struct dirent  *clde;
+       DIR                *cldir;
+       struct dirent *clde;
 
        cldir = AllocateDir(TWOPHASE_DIR);
        while ((clde = ReadDir(cldir, TWOPHASE_DIR)) != NULL)
@@ -1801,8 +1804,8 @@ PrescanPreparedTransactions(TransactionId **xids_p, int *nxids_p)
                xid = gxact->xid;
 
                buf = ProcessTwoPhaseBuffer(xid,
-                               gxact->prepare_start_lsn,
-                               gxact->ondisk, false, true);
+                                                                       gxact->prepare_start_lsn,
+                                                                       gxact->ondisk, false, true);
 
                if (buf == NULL)
                        continue;
@@ -1876,8 +1879,8 @@ StandbyRecoverPreparedTransactions(void)
                xid = gxact->xid;
 
                buf = ProcessTwoPhaseBuffer(xid,
-                               gxact->prepare_start_lsn,
-                               gxact->ondisk, false, false);
+                                                                       gxact->prepare_start_lsn,
+                                                                       gxact->ondisk, false, false);
                if (buf != NULL)
                        pfree(buf);
        }
@@ -1920,17 +1923,17 @@ RecoverPreparedTransactions(void)
                xid = gxact->xid;
 
                /*
-                * Reconstruct subtrans state for the transaction --- needed
-                * because pg_subtrans is not preserved over a restart.  Note that
-                * we are linking all the subtransactions directly to the
-                * top-level XID; there may originally have been a more complex
-                * hierarchy, but there's no need to restore that exactly.
-                * It's possible that SubTransSetParent has been set before, if
-                * the prepared transaction generated xid assignment records.
+                * Reconstruct subtrans state for the transaction --- needed because
+                * pg_subtrans is not preserved over a restart.  Note that we are
+                * linking all the subtransactions directly to the top-level XID;
+                * there may originally have been a more complex hierarchy, but
+                * there's no need to restore that exactly. It's possible that
+                * SubTransSetParent has been set before, if the prepared transaction
+                * generated xid assignment records.
                 */
                buf = ProcessTwoPhaseBuffer(xid,
-                               gxact->prepare_start_lsn,
-                               gxact->ondisk, true, false);
+                                                                       gxact->prepare_start_lsn,
+                                                                       gxact->ondisk, true, false);
                if (buf == NULL)
                        continue;
 
@@ -1949,9 +1952,8 @@ RecoverPreparedTransactions(void)
                bufptr += MAXALIGN(hdr->ninvalmsgs * sizeof(SharedInvalidationMessage));
 
                /*
-                * Recreate its GXACT and dummy PGPROC. But, check whether
-                * it was added in redo and already has a shmem entry for
-                * it.
+                * Recreate its GXACT and dummy PGPROC. But, check whether it was
+                * added in redo and already has a shmem entry for it.
                 */
                LWLockAcquire(TwoPhaseStateLock, LW_EXCLUSIVE);
                MarkAsPreparingGuts(gxact, xid, gid,
@@ -1980,9 +1982,8 @@ RecoverPreparedTransactions(void)
                        StandbyReleaseLockTree(xid, hdr->nsubxacts, subxids);
 
                /*
-                * We're done with recovering this transaction. Clear
-                * MyLockedGxact, like we do in PrepareTransaction() during normal
-                * operation.
+                * We're done with recovering this transaction. Clear MyLockedGxact,
+                * like we do in PrepareTransaction() during normal operation.
                 */
                PostPrepare_Twophase();
 
@@ -2049,8 +2050,8 @@ ProcessTwoPhaseBuffer(TransactionId xid,
                else
                {
                        ereport(WARNING,
-                                       (errmsg("removing future two-phase state from memory for \"%u\"",
-                                                       xid)));
+                       (errmsg("removing future two-phase state from memory for \"%u\"",
+                                       xid)));
                        PrepareRedoRemove(xid, true);
                }
                return NULL;
@@ -2063,8 +2064,8 @@ ProcessTwoPhaseBuffer(TransactionId xid,
                if (buf == NULL)
                {
                        ereport(WARNING,
-                                       (errmsg("removing corrupt two-phase state file for \"%u\"",
-                                                       xid)));
+                                 (errmsg("removing corrupt two-phase state file for \"%u\"",
+                                                 xid)));
                        RemoveTwoPhaseFile(xid, true);
                        return NULL;
                }
@@ -2082,15 +2083,15 @@ ProcessTwoPhaseBuffer(TransactionId xid,
                if (fromdisk)
                {
                        ereport(WARNING,
-                                       (errmsg("removing corrupt two-phase state file for \"%u\"",
-                                                       xid)));
+                                 (errmsg("removing corrupt two-phase state file for \"%u\"",
+                                                 xid)));
                        RemoveTwoPhaseFile(xid, true);
                }
                else
                {
                        ereport(WARNING,
-                                       (errmsg("removing corrupt two-phase state from memory for \"%u\"",
-                                                       xid)));
+                       (errmsg("removing corrupt two-phase state from memory for \"%u\"",
+                                       xid)));
                        PrepareRedoRemove(xid, true);
                }
                pfree(buf);
@@ -2098,8 +2099,8 @@ ProcessTwoPhaseBuffer(TransactionId xid,
        }
 
        /*
-        * Examine subtransaction XIDs ... they should all follow main
-        * XID, and they may force us to advance nextXid.
+        * Examine subtransaction XIDs ... they should all follow main XID, and
+        * they may force us to advance nextXid.
         */
        subxids = (TransactionId *) (buf +
                                                                 MAXALIGN(sizeof(TwoPhaseFileHeader)) +
@@ -2122,7 +2123,7 @@ ProcessTwoPhaseBuffer(TransactionId xid,
                         */
                        LWLockAcquire(XidGenLock, LW_EXCLUSIVE);
                        if (TransactionIdFollowsOrEquals(subxid,
-                                                                                ShmemVariableCache->nextXid))
+                                                                                        ShmemVariableCache->nextXid))
                        {
                                ShmemVariableCache->nextXid = subxid;
                                TransactionIdAdvance(ShmemVariableCache->nextXid);
@@ -2175,14 +2176,15 @@ RecordTransactionCommitPrepared(TransactionId xid,
        MyPgXact->delayChkpt = true;
 
        /*
-        * Emit the XLOG commit record. Note that we mark 2PC commits as potentially
-        * having AccessExclusiveLocks since we don't know whether or not they do.
+        * Emit the XLOG commit record. Note that we mark 2PC commits as
+        * potentially having AccessExclusiveLocks since we don't know whether or
+        * not they do.
         */
        recptr = XactLogCommitRecord(committs,
                                                                 nchildren, children, nrels, rels,
                                                                 ninvalmsgs, invalmsgs,
                                                                 initfileinval, false,
-                                                MyXactFlags | XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK,
+                                               MyXactFlags | XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK,
                                                                 xid);
 
 
@@ -2260,13 +2262,14 @@ RecordTransactionAbortPrepared(TransactionId xid,
        START_CRIT_SECTION();
 
        /*
-        * Emit the XLOG commit record. Note that we mark 2PC aborts as potentially
-        * having AccessExclusiveLocks since we don't know whether or not they do.
+        * Emit the XLOG commit record. Note that we mark 2PC aborts as
+        * potentially having AccessExclusiveLocks since we don't know whether or
+        * not they do.
         */
        recptr = XactLogAbortRecord(GetCurrentTimestamp(),
                                                                nchildren, children,
                                                                nrels, rels,
-                                                MyXactFlags | XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK,
+                                               MyXactFlags | XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK,
                                                                xid);
 
        /* Always flush, since we're about to remove the 2PC state file */
@@ -2301,8 +2304,8 @@ void
 PrepareRedoAdd(char *buf, XLogRecPtr start_lsn, XLogRecPtr end_lsn)
 {
        TwoPhaseFileHeader *hdr = (TwoPhaseFileHeader *) buf;
-       char                      *bufptr;
-       const char                *gid;
+       char       *bufptr;
+       const char *gid;
        GlobalTransaction gxact;
 
        Assert(RecoveryInProgress());
@@ -2315,8 +2318,8 @@ PrepareRedoAdd(char *buf, XLogRecPtr start_lsn, XLogRecPtr end_lsn)
         *
         * This creates a gxact struct and puts it into the active array.
         *
-        * In redo, this struct is mainly used to track PREPARE/COMMIT entries
-        * in shared memory. Hence, we only fill up the bare minimum contents here.
+        * In redo, this struct is mainly used to track PREPARE/COMMIT entries in
+        * shared memory. Hence, we only fill up the bare minimum contents here.
         * The gxact also gets marked with gxact->inredo set to true to indicate
         * that it got added in the redo phase
         */
@@ -2340,7 +2343,7 @@ PrepareRedoAdd(char *buf, XLogRecPtr start_lsn, XLogRecPtr end_lsn)
        gxact->locking_backend = InvalidBackendId;
        gxact->valid = false;
        gxact->ondisk = XLogRecPtrIsInvalid(start_lsn);
-       gxact->inredo = true; /* yes, added in redo */
+       gxact->inredo = true;           /* yes, added in redo */
        strcpy(gxact->gid, gid);
 
        /* And insert it into the active array */
index 5efbfbd3d61b856e14301831345fe29be4541e20..b02dd6fbd25a8dfdd30b2c6578ec24617ef7958b 100644 (file)
@@ -272,7 +272,7 @@ AdvanceOldestClogXid(TransactionId oldest_datfrozenxid)
 {
        LWLockAcquire(CLogTruncationLock, LW_EXCLUSIVE);
        if (TransactionIdPrecedes(ShmemVariableCache->oldestClogXid,
-               oldest_datfrozenxid))
+                                                         oldest_datfrozenxid))
        {
                ShmemVariableCache->oldestClogXid = oldest_datfrozenxid;
        }
index a3ff1b22f07ef47ce6bee3d199153ccb027c02d8..7e8c598f2adc191a34f2bb5424a3a480cc342888 100644 (file)
@@ -115,7 +115,7 @@ TransactionId *ParallelCurrentXids;
  * globally accessible, so can be set from anywhere in the code that requires
  * recording flags.
  */
-int  MyXactFlags;
+int                    MyXactFlags;
 
 /*
  *     transaction states - transaction state from server perspective
@@ -2641,7 +2641,8 @@ CleanupTransaction(void)
         * do abort cleanup processing
         */
        AtCleanup_Portals();            /* now safe to release portal memory */
-       AtEOXact_Snapshot(false, true); /* and release the transaction's snapshots */
+       AtEOXact_Snapshot(false, true);         /* and release the transaction's
+                                                                                * snapshots */
 
        CurrentResourceOwner = NULL;    /* and resource owner */
        if (TopTransactionResourceOwner)
@@ -5646,8 +5647,8 @@ xact_redo(XLogReaderState *record)
        else if (info == XLOG_XACT_PREPARE)
        {
                /*
-                * Store xid and start/end pointers of the WAL record in
-                * TwoPhaseState gxact entry.
+                * Store xid and start/end pointers of the WAL record in TwoPhaseState
+                * gxact entry.
                 */
                PrepareRedoAdd(XLogRecGetData(record),
                                           record->ReadRecPtr,
index b98e37e1d38aed68037736cf9285331bd6548da0..399822d3fead60e0302169ac007ff8bc042a8fd6 100644 (file)
@@ -550,13 +550,12 @@ typedef struct XLogCtlInsert
        bool            fullPageWrites;
 
        /*
-        * exclusiveBackupState indicates the state of an exclusive backup
-        * (see comments of ExclusiveBackupState for more details).
-        * nonExclusiveBackups is a counter indicating the number of streaming
-        * base backups currently in progress. forcePageWrites is set to true
-        * when either of these is non-zero. lastBackupStart is the latest
-        * checkpoint redo location used as a starting point for an online
-        * backup.
+        * exclusiveBackupState indicates the state of an exclusive backup (see
+        * comments of ExclusiveBackupState for more details). nonExclusiveBackups
+        * is a counter indicating the number of streaming base backups currently
+        * in progress. forcePageWrites is set to true when either of these is
+        * non-zero. lastBackupStart is the latest checkpoint redo location used
+        * as a starting point for an online backup.
         */
        ExclusiveBackupState exclusiveBackupState;
        int                     nonExclusiveBackups;
@@ -1082,7 +1081,7 @@ XLogInsertRecord(XLogRecData *rdata,
                 */
                if ((flags & XLOG_MARK_UNIMPORTANT) == 0)
                {
-                       int lockno = holdingAllLocks ? 0 : MyLockNo;
+                       int                     lockno = holdingAllLocks ? 0 : MyLockNo;
 
                        WALInsertLocks[lockno].l.lastImportantAt = StartPos;
                }
@@ -1405,7 +1404,8 @@ checkXLogConsistency(XLogReaderState *record)
 
                /*
                 * If the block LSN is already ahead of this WAL record, we can't
-                * expect contents to match.  This can happen if recovery is restarted.
+                * expect contents to match.  This can happen if recovery is
+                * restarted.
                 */
                if (PageGetLSN(replay_image_masked) > record->EndRecPtr)
                        continue;
@@ -4975,15 +4975,15 @@ BootStrapXLOG(void)
        sysidentifier |= getpid() & 0xFFF;
 
        /*
-        * Generate a random nonce. This is used for authentication requests
-        * that will fail because the user does not exist. The nonce is used to
-        * create a genuine-looking password challenge for the non-existent user,
-        * in lieu of an actual stored password.
+        * Generate a random nonce. This is used for authentication requests that
+        * will fail because the user does not exist. The nonce is used to create
+        * a genuine-looking password challenge for the non-existent user, in lieu
+        * of an actual stored password.
         */
        if (!pg_backend_random(mock_auth_nonce, MOCK_AUTH_NONCE_LEN))
                ereport(PANIC,
-                       (errcode(ERRCODE_INTERNAL_ERROR),
-                        errmsg("could not generate secret authorization token")));
+                               (errcode(ERRCODE_INTERNAL_ERROR),
+                                errmsg("could not generate secret authorization token")));
 
        /* First timeline ID is always 1 */
        ThisTimeLineID = 1;
@@ -5298,7 +5298,7 @@ readRecoveryCommandFile(void)
                                DatumGetLSN(DirectFunctionCall3(pg_lsn_in,
                                                                                                CStringGetDatum(item->value),
                                                                                                ObjectIdGetDatum(InvalidOid),
-                                                                                                               Int32GetDatum(-1)));
+                                                                                               Int32GetDatum(-1)));
                        ereport(DEBUG2,
                                        (errmsg_internal("recovery_target_lsn = '%X/%X'",
                                                                         (uint32) (recoveryTargetLSN >> 32),
@@ -5643,9 +5643,9 @@ recoveryStopsBefore(XLogReaderState *record)
                recoveryStopTime = 0;
                recoveryStopName[0] = '\0';
                ereport(LOG,
-                               (errmsg("recovery stopping before WAL location (LSN) \"%X/%X\"",
-                                               (uint32) (recoveryStopLSN >> 32),
-                                               (uint32) recoveryStopLSN)));
+                        (errmsg("recovery stopping before WAL location (LSN) \"%X/%X\"",
+                                        (uint32) (recoveryStopLSN >> 32),
+                                        (uint32) recoveryStopLSN)));
                return true;
        }
 
@@ -5800,9 +5800,9 @@ recoveryStopsAfter(XLogReaderState *record)
                recoveryStopTime = 0;
                recoveryStopName[0] = '\0';
                ereport(LOG,
-                               (errmsg("recovery stopping after WAL location (LSN) \"%X/%X\"",
-                                               (uint32) (recoveryStopLSN >> 32),
-                                               (uint32) recoveryStopLSN)));
+                         (errmsg("recovery stopping after WAL location (LSN) \"%X/%X\"",
+                                         (uint32) (recoveryStopLSN >> 32),
+                                         (uint32) recoveryStopLSN)));
                return true;
        }
 
@@ -6348,12 +6348,12 @@ StartupXLOG(void)
                ereport(ERROR,
                                (errcode(ERRCODE_OUT_OF_MEMORY),
                                 errmsg("out of memory"),
-                  errdetail("Failed while allocating a WAL reading processor.")));
+                        errdetail("Failed while allocating a WAL reading processor.")));
        xlogreader->system_identifier = ControlFile->system_identifier;
 
        /*
-        * Allocate pages dedicated to WAL consistency checks, those had better
-        * be aligned.
+        * Allocate pages dedicated to WAL consistency checks, those had better be
+        * aligned.
         */
        replay_image_masked = (char *) palloc(BLCKSZ);
        master_image_masked = (char *) palloc(BLCKSZ);
@@ -6687,21 +6687,21 @@ StartupXLOG(void)
 
        /*
         * Copy any missing timeline history files between 'now' and the recovery
-        * target timeline from archive to pg_wal. While we don't need those
-        * files ourselves - the history file of the recovery target timeline
-        * covers all the previous timelines in the history too - a cascading
-        * standby server might be interested in them. Or, if you archive the WAL
-        * from this server to a different archive than the master, it'd be good
-        * for all the history files to get archived there after failover, so that
-        * you can use one of the old timelines as a PITR target. Timeline history
-        * files are small, so it's better to copy them unnecessarily than not
-        * copy them and regret later.
+        * target timeline from archive to pg_wal. While we don't need those files
+        * ourselves - the history file of the recovery target timeline covers all
+        * the previous timelines in the history too - a cascading standby server
+        * might be interested in them. Or, if you archive the WAL from this
+        * server to a different archive than the master, it'd be good for all the
+        * history files to get archived there after failover, so that you can use
+        * one of the old timelines as a PITR target. Timeline history files are
+        * small, so it's better to copy them unnecessarily than not copy them and
+        * regret later.
         */
        restoreTimeLineHistoryFiles(ThisTimeLineID, recoveryTargetTLI);
 
        /*
-        * Before running in recovery, scan pg_twophase and fill in its status
-        * to be able to work on entries generated by redo.  Doing a scan before
+        * Before running in recovery, scan pg_twophase and fill in its status to
+        * be able to work on entries generated by redo.  Doing a scan before
         * taking any recovery action has the merit to discard any 2PC files that
         * are newer than the first record to replay, saving from any conflicts at
         * replay.  This avoids as well any subsequent scans when doing recovery
@@ -7426,7 +7426,7 @@ StartupXLOG(void)
                        snprintf(reason, sizeof(reason),
                                         "%s LSN %X/%X\n",
                                         recoveryStopAfter ? "after" : "before",
-                                        (uint32 ) (recoveryStopLSN >> 32),
+                                        (uint32) (recoveryStopLSN >> 32),
                                         (uint32) recoveryStopLSN);
                else if (recoveryTarget == RECOVERY_TARGET_NAME)
                        snprintf(reason, sizeof(reason),
@@ -9645,6 +9645,7 @@ xlog_redo(XLogReaderState *record)
 
                MultiXactAdvanceOldest(checkPoint.oldestMulti,
                                                           checkPoint.oldestMultiDB);
+
                /*
                 * No need to set oldestClogXid here as well; it'll be set when we
                 * redo an xl_clog_truncate if it changed since initialization.
@@ -10238,8 +10239,8 @@ do_pg_start_backup(const char *backupidstr, bool fast, TimeLineID *starttli_p,
        if (exclusive)
        {
                /*
-                * At first, mark that we're now starting an exclusive backup,
-                * to ensure that there are no other sessions currently running
+                * At first, mark that we're now starting an exclusive backup, to
+                * ensure that there are no other sessions currently running
                 * pg_start_backup() or pg_stop_backup().
                 */
                if (XLogCtl->Insert.exclusiveBackupState != EXCLUSIVE_BACKUP_NONE)
@@ -10505,8 +10506,9 @@ do_pg_start_backup(const char *backupidstr, bool fast, TimeLineID *starttli_p,
                {
                        /*
                         * Check for existing backup label --- implies a backup is already
-                        * running.  (XXX given that we checked exclusiveBackupState above,
-                        * maybe it would be OK to just unlink any such label file?)
+                        * running.  (XXX given that we checked exclusiveBackupState
+                        * above, maybe it would be OK to just unlink any such label
+                        * file?)
                         */
                        if (stat(BACKUP_LABEL_FILE, &stat_buf) != 0)
                        {
@@ -10727,8 +10729,8 @@ do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p)
        if (exclusive)
        {
                /*
-                * At first, mark that we're now stopping an exclusive backup,
-                * to ensure that there are no other sessions currently running
+                * At first, mark that we're now stopping an exclusive backup, to
+                * ensure that there are no other sessions currently running
                 * pg_start_backup() or pg_stop_backup().
                 */
                WALInsertLockAcquireExclusive();
@@ -10790,8 +10792,8 @@ do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p)
                        durable_unlink(BACKUP_LABEL_FILE, ERROR);
 
                        /*
-                        * Remove tablespace_map file if present, it is created only if there
-                        * are tablespaces.
+                        * Remove tablespace_map file if present, it is created only if
+                        * there are tablespaces.
                         */
                        durable_unlink(TABLESPACE_MAP, DEBUG1);
                }
@@ -10978,9 +10980,9 @@ do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p)
         * archived before returning. If archiving isn't enabled, the required WAL
         * needs to be transported via streaming replication (hopefully with
         * wal_keep_segments set high enough), or some more exotic mechanism like
-        * polling and copying files from pg_wal with script. We have no
-        * knowledge of those mechanisms, so it's up to the user to ensure that he
-        * gets all the required WAL.
+        * polling and copying files from pg_wal with script. We have no knowledge
+        * of those mechanisms, so it's up to the user to ensure that he gets all
+        * the required WAL.
         *
         * We wait until both the last WAL file filled during backup and the
         * history file have been archived, and assume that the alphabetic sorting
@@ -10990,8 +10992,8 @@ do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p)
         * We wait forever, since archive_command is supposed to work and we
         * assume the admin wanted his backup to work completely. If you don't
         * wish to wait, then either waitforarchive should be passed in as false,
-        * or you can set statement_timeout.  Also, some notices are
-        * issued to clue in anyone who might be doing this interactively.
+        * or you can set statement_timeout.  Also, some notices are issued to
+        * clue in anyone who might be doing this interactively.
         */
        if (waitforarchive && XLogArchivingActive())
        {
@@ -11717,8 +11719,8 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
                                         * little chance that the problem will just go away, but
                                         * PANIC is not good for availability either, especially
                                         * in hot standby mode. So, we treat that the same as
-                                        * disconnection, and retry from archive/pg_wal again.
-                                        * The WAL in the archive should be identical to what was
+                                        * disconnection, and retry from archive/pg_wal again. The
+                                        * WAL in the archive should be identical to what was
                                         * streamed, so it's unlikely that it helps, but one can
                                         * hope...
                                         */
@@ -11881,9 +11883,9 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
                                                 * not open already.  Also read the timeline history
                                                 * file if we haven't initialized timeline history
                                                 * yet; it should be streamed over and present in
-                                                * pg_wal by now.  Use XLOG_FROM_STREAM so that
-                                                * source info is set correctly and XLogReceiptTime
-                                                * isn't changed.
+                                                * pg_wal by now.  Use XLOG_FROM_STREAM so that source
+                                                * info is set correctly and XLogReceiptTime isn't
+                                                * changed.
                                                 */
                                                if (readFile < 0)
                                                {
index 8568c8abd64e70ee103ed77ef81a94404849a1f0..b3223d691da398659c922884062e92ac0e240758 100644 (file)
@@ -156,7 +156,8 @@ pg_stop_backup(PG_FUNCTION_ARGS)
         * Exclusive backups were typically started in a different connection, so
         * don't try to verify that status of backup is set to
         * SESSION_BACKUP_EXCLUSIVE in this function. Actual verification that an
-        * exclusive backup is in fact running is handled inside do_pg_stop_backup.
+        * exclusive backup is in fact running is handled inside
+        * do_pg_stop_backup.
         */
        stoppoint = do_pg_stop_backup(NULL, true, NULL);
 
@@ -527,7 +528,7 @@ pg_walfile_name(PG_FUNCTION_ARGS)
                ereport(ERROR,
                                (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
                                 errmsg("recovery is in progress"),
-                errhint("pg_walfile_name() cannot be executed during recovery.")));
+                 errhint("pg_walfile_name() cannot be executed during recovery.")));
 
        XLByteToPrevSeg(locationpoint, xlogsegno);
        XLogFileName(xlogfilename, ThisTimeLineID, xlogsegno);
index a3bd0b7f51a064557230f12338b2c73fc49cacb0..6a02738479c886d466b4d6ee0522ec81b0ded101 100644 (file)
@@ -388,10 +388,10 @@ XLogRegisterBufData(uint8 block_id, char *data, int len)
  *
  * The flags that can be used here are:
  * - XLOG_INCLUDE_ORIGIN, to determine if the replication origin should be
- *   included in the record.
+ *      included in the record.
  * - XLOG_MARK_UNIMPORTANT, to signal that the record is not important for
- *   durability, which allows to avoid triggering WAL archiving and other
- *   background activity.
+ *      durability, which allows to avoid triggering WAL archiving and other
+ *      background activity.
  */
 void
 XLogSetRecordFlags(uint8 flags)
@@ -507,10 +507,10 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
        hdr_rdt.data = hdr_scratch;
 
        /*
-        * Enforce consistency checks for this record if user is looking for
-        * it. Do this before at the beginning of this routine to give the
-        * possibility for callers of XLogInsert() to pass XLR_CHECK_CONSISTENCY
-        * directly for a record.
+        * Enforce consistency checks for this record if user is looking for it.
+        * Do this before at the beginning of this routine to give the possibility
+        * for callers of XLogInsert() to pass XLR_CHECK_CONSISTENCY directly for
+        * a record.
         */
        if (wal_consistency_checking[rmid])
                info |= XLR_CHECK_CONSISTENCY;
@@ -576,9 +576,8 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
                        bkpb.fork_flags |= BKPBLOCK_WILL_INIT;
 
                /*
-                * If needs_backup is true or WAL checking is enabled for
-                * current resource manager, log a full-page write for the current
-                * block.
+                * If needs_backup is true or WAL checking is enabled for current
+                * resource manager, log a full-page write for the current block.
                 */
                include_image = needs_backup || (info & XLR_CHECK_CONSISTENCY) != 0;
 
@@ -645,8 +644,8 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
                        bimg.bimg_info = (cbimg.hole_length == 0) ? 0 : BKPIMAGE_HAS_HOLE;
 
                        /*
-                        * If WAL consistency checking is enabled for the resource manager of
-                        * this WAL record, a full-page image is included in the record
+                        * If WAL consistency checking is enabled for the resource manager
+                        * of this WAL record, a full-page image is included in the record
                         * for the block modified. During redo, the full-page is replayed
                         * only if BKPIMAGE_APPLY is set.
                         */
index f077662946f4f7a0e6ebf44dfc9a747d65c95706..c3b1371764b634445c9b231035ea783edac6f453 100644 (file)
@@ -892,8 +892,8 @@ XLogFindNextRecord(XLogReaderState *state, XLogRecPtr RecPtr)
                 * that, except when caller has explicitly specified the offset that
                 * falls somewhere there or when we are skipping multi-page
                 * continuation record. It doesn't matter though because
-                * ReadPageInternal() is prepared to handle that and will read at least
-                * short page-header worth of data
+                * ReadPageInternal() is prepared to handle that and will read at
+                * least short page-header worth of data
                 */
                targetRecOff = tmpRecPtr % XLOG_BLCKSZ;
 
index d7f2e55b0909887bbb30ebbc606ad261b2237488..7430a1f77b456f58f8319e459d8580764aa901a2 100644 (file)
@@ -805,22 +805,23 @@ XLogReadDetermineTimeline(XLogReaderState *state, XLogRecPtr wantPage, uint32 wa
        Assert(state->readLen == 0 || state->readLen <= XLOG_BLCKSZ);
 
        /*
-        * If the desired page is currently read in and valid, we have nothing to do.
+        * If the desired page is currently read in and valid, we have nothing to
+        * do.
         *
         * The caller should've ensured that it didn't previously advance readOff
-        * past the valid limit of this timeline, so it doesn't matter if the current
-        * TLI has since become historical.
+        * past the valid limit of this timeline, so it doesn't matter if the
+        * current TLI has since become historical.
         */
        if (lastReadPage == wantPage &&
                state->readLen != 0 &&
-               lastReadPage + state->readLen >= wantPage + Min(wantLength,XLOG_BLCKSZ-1))
+               lastReadPage + state->readLen >= wantPage + Min(wantLength, XLOG_BLCKSZ - 1))
                return;
 
        /*
         * If we're reading from the current timeline, it hasn't become historical
         * and the page we're reading is after the last page read, we can again
-        * just carry on. (Seeking backwards requires a check to make sure the older
-        * page isn't on a prior timeline).
+        * just carry on. (Seeking backwards requires a check to make sure the
+        * older page isn't on a prior timeline).
         *
         * ThisTimeLineID might've become historical since we last looked, but the
         * caller is required not to read past the flush limit it saw at the time
@@ -835,8 +836,8 @@ XLogReadDetermineTimeline(XLogReaderState *state, XLogRecPtr wantPage, uint32 wa
 
        /*
         * If we're just reading pages from a previously validated historical
-        * timeline and the timeline we're reading from is valid until the
-        * end of the current segment we can just keep reading.
+        * timeline and the timeline we're reading from is valid until the end of
+        * the current segment we can just keep reading.
         */
        if (state->currTLIValidUntil != InvalidXLogRecPtr &&
                state->currTLI != ThisTimeLineID &&
@@ -845,10 +846,10 @@ XLogReadDetermineTimeline(XLogReaderState *state, XLogRecPtr wantPage, uint32 wa
                return;
 
        /*
-        * If we reach this point we're either looking up a page for random access,
-        * the current timeline just became historical, or we're reading from a new
-        * segment containing a timeline switch. In all cases we need to determine
-        * the newest timeline on the segment.
+        * If we reach this point we're either looking up a page for random
+        * access, the current timeline just became historical, or we're reading
+        * from a new segment containing a timeline switch. In all cases we need
+        * to determine the newest timeline on the segment.
         *
         * If it's the current timeline we can just keep reading from here unless
         * we detect a timeline switch that makes the current timeline historical.
@@ -861,26 +862,29 @@ XLogReadDetermineTimeline(XLogReaderState *state, XLogRecPtr wantPage, uint32 wa
                 * We need to re-read the timeline history in case it's been changed
                 * by a promotion or replay from a cascaded replica.
                 */
-               List *timelineHistory = readTimeLineHistory(ThisTimeLineID);
+               List       *timelineHistory = readTimeLineHistory(ThisTimeLineID);
 
-               XLogRecPtr endOfSegment = (((wantPage / XLogSegSize) + 1) * XLogSegSize) - 1;
+               XLogRecPtr      endOfSegment = (((wantPage / XLogSegSize) + 1) * XLogSegSize) - 1;
 
                Assert(wantPage / XLogSegSize == endOfSegment / XLogSegSize);
 
-               /* Find the timeline of the last LSN on the segment containing wantPage. */
+               /*
+                * Find the timeline of the last LSN on the segment containing
+                * wantPage.
+                */
                state->currTLI = tliOfPointInHistory(endOfSegment, timelineHistory);
                state->currTLIValidUntil = tliSwitchPoint(state->currTLI, timelineHistory,
-                       &state->nextTLI);
+                                                                                                 &state->nextTLI);
 
                Assert(state->currTLIValidUntil == InvalidXLogRecPtr ||
-                               wantPage + wantLength < state->currTLIValidUntil);
+                          wantPage + wantLength < state->currTLIValidUntil);
 
                list_free_deep(timelineHistory);
 
                elog(DEBUG3, "switched to timeline %u valid until %X/%X",
-                               state->currTLI,
-                               (uint32)(state->currTLIValidUntil >> 32),
-                               (uint32)(state->currTLIValidUntil));
+                        state->currTLI,
+                        (uint32) (state->currTLIValidUntil >> 32),
+                        (uint32) (state->currTLIValidUntil));
        }
 }
 
@@ -929,21 +933,22 @@ read_local_xlog_page(XLogReaderState *state, XLogRecPtr targetPagePtr,
                 *
                 * We have to do it each time through the loop because if we're in
                 * recovery as a cascading standby, the current timeline might've
-                * become historical. We can't rely on RecoveryInProgress() because
-                * in a standby configuration like
+                * become historical. We can't rely on RecoveryInProgress() because in
+                * a standby configuration like
                 *
-                *    A => B => C
+                * A => B => C
                 *
                 * if we're a logical decoding session on C, and B gets promoted, our
                 * timeline will change while we remain in recovery.
                 *
                 * We can't just keep reading from the old timeline as the last WAL
-                * archive in the timeline will get renamed to .partial by StartupXLOG().
+                * archive in the timeline will get renamed to .partial by
+                * StartupXLOG().
                 *
                 * If that happens after our caller updated ThisTimeLineID but before
                 * we actually read the xlog page, we might still try to read from the
-                * old (now renamed) segment and fail. There's not much we can do about
-           &nb