Run pgindent on 9.2 source tree in preparation for first 9.3
authorBruce Momjian <[email protected]>
Sun, 10 Jun 2012 19:20:04 +0000 (15:20 -0400)
committerBruce Momjian <[email protected]>
Sun, 10 Jun 2012 19:20:04 +0000 (15:20 -0400)
commit-fest.

494 files changed:
contrib/auto_explain/auto_explain.c
contrib/dblink/dblink.c
contrib/file_fdw/file_fdw.c
contrib/pg_archivecleanup/pg_archivecleanup.c
contrib/pg_stat_statements/pg_stat_statements.c
contrib/pg_test_fsync/pg_test_fsync.c
contrib/pg_test_timing/pg_test_timing.c
contrib/pg_trgm/trgm_gist.c
contrib/pg_upgrade/check.c
contrib/pg_upgrade/controldata.c
contrib/pg_upgrade/exec.c
contrib/pg_upgrade/file.c
contrib/pg_upgrade/function.c
contrib/pg_upgrade/info.c
contrib/pg_upgrade/option.c
contrib/pg_upgrade/pg_upgrade.c
contrib/pg_upgrade/pg_upgrade.h
contrib/pg_upgrade/relfilenode.c
contrib/pg_upgrade/server.c
contrib/pg_upgrade/tablespace.c
contrib/pg_upgrade/version_old_8_3.c
contrib/pgbench/pgbench.c
contrib/pgcrypto/crypt-md5.c
contrib/pgcrypto/px.h
contrib/pgstattuple/pgstatindex.c
contrib/pgstattuple/pgstattuple.c
contrib/sepgsql/database.c
contrib/sepgsql/dml.c
contrib/sepgsql/hooks.c
contrib/sepgsql/label.c
contrib/sepgsql/proc.c
contrib/sepgsql/relation.c
contrib/sepgsql/schema.c
contrib/sepgsql/sepgsql.h
contrib/sepgsql/uavc.c
contrib/spi/refint.c
contrib/vacuumlo/vacuumlo.c
contrib/xml2/xpath.c
contrib/xml2/xslt_proc.c
src/backend/access/gist/gist.c
src/backend/access/gist/gistbuild.c
src/backend/access/gist/gistbuildbuffers.c
src/backend/access/gist/gistproc.c
src/backend/access/gist/gistscan.c
src/backend/access/gist/gistsplit.c
src/backend/access/hash/hashovfl.c
src/backend/access/heap/heapam.c
src/backend/access/heap/hio.c
src/backend/access/heap/tuptoaster.c
src/backend/access/heap/visibilitymap.c
src/backend/access/index/genam.c
src/backend/access/index/indexam.c
src/backend/access/nbtree/nbtcompare.c
src/backend/access/nbtree/nbtpage.c
src/backend/access/nbtree/nbtree.c
src/backend/access/nbtree/nbtsearch.c
src/backend/access/nbtree/nbtutils.c
src/backend/access/spgist/spgdoinsert.c
src/backend/access/spgist/spginsert.c
src/backend/access/spgist/spgkdtreeproc.c
src/backend/access/spgist/spgquadtreeproc.c
src/backend/access/spgist/spgscan.c
src/backend/access/spgist/spgtextproc.c
src/backend/access/spgist/spgutils.c
src/backend/access/spgist/spgvacuum.c
src/backend/access/spgist/spgxlog.c
src/backend/access/transam/clog.c
src/backend/access/transam/slru.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/xlogutils.c
src/backend/catalog/aclchk.c
src/backend/catalog/dependency.c
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/catalog/namespace.c
src/backend/catalog/objectaddress.c
src/backend/catalog/pg_constraint.c
src/backend/catalog/pg_depend.c
src/backend/catalog/pg_proc.c
src/backend/catalog/pg_shdepend.c
src/backend/catalog/storage.c
src/backend/commands/analyze.c
src/backend/commands/cluster.c
src/backend/commands/copy.c
src/backend/commands/createas.c
src/backend/commands/dbcommands.c
src/backend/commands/dropcmds.c
src/backend/commands/explain.c
src/backend/commands/extension.c
src/backend/commands/foreigncmds.c
src/backend/commands/functioncmds.c
src/backend/commands/indexcmds.c
src/backend/commands/lockcmds.c
src/backend/commands/opclasscmds.c
src/backend/commands/prepare.c
src/backend/commands/proclang.c
src/backend/commands/seclabel.c
src/backend/commands/sequence.c
src/backend/commands/tablecmds.c
src/backend/commands/tablespace.c
src/backend/commands/trigger.c
src/backend/commands/typecmds.c
src/backend/commands/user.c
src/backend/commands/vacuum.c
src/backend/commands/vacuumlazy.c
src/backend/commands/view.c
src/backend/executor/execCurrent.c
src/backend/executor/execMain.c
src/backend/executor/execQual.c
src/backend/executor/execUtils.c
src/backend/executor/functions.c
src/backend/executor/nodeBitmapHeapscan.c
src/backend/executor/nodeIndexonlyscan.c
src/backend/executor/nodeMaterial.c
src/backend/executor/nodeMergeAppend.c
src/backend/executor/nodeMergejoin.c
src/backend/executor/nodeModifyTable.c
src/backend/executor/nodeSetOp.c
src/backend/executor/spi.c
src/backend/libpq/auth.c
src/backend/libpq/be-secure.c
src/backend/libpq/hba.c
src/backend/libpq/pqcomm.c
src/backend/nodes/bitmapset.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/list.c
src/backend/nodes/nodeFuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/print.c
src/backend/nodes/readfuncs.c
src/backend/nodes/tidbitmap.c
src/backend/optimizer/geqo/geqo_selection.c
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/path/costsize.c
src/backend/optimizer/path/equivclass.c
src/backend/optimizer/path/indxpath.c
src/backend/optimizer/path/joinpath.c
src/backend/optimizer/path/joinrels.c
src/backend/optimizer/path/orindxpath.c
src/backend/optimizer/path/pathkeys.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/initsplan.c
src/backend/optimizer/plan/planagg.c
src/backend/optimizer/plan/planmain.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/setrefs.c
src/backend/optimizer/plan/subselect.c
src/backend/optimizer/prep/prepjointree.c
src/backend/optimizer/prep/prepunion.c
src/backend/optimizer/util/clauses.c
src/backend/optimizer/util/pathnode.c
src/backend/optimizer/util/placeholder.c
src/backend/optimizer/util/plancat.c
src/backend/optimizer/util/predtest.c
src/backend/optimizer/util/relnode.c
src/backend/optimizer/util/var.c
src/backend/parser/analyze.c
src/backend/parser/parse_coerce.c
src/backend/parser/parse_expr.c
src/backend/parser/parse_func.c
src/backend/parser/parse_relation.c
src/backend/parser/parse_target.c
src/backend/parser/parse_type.c
src/backend/parser/parse_utilcmd.c
src/backend/port/darwin/system.c
src/backend/port/dynloader/aix.h
src/backend/port/dynloader/cygwin.h
src/backend/port/dynloader/freebsd.h
src/backend/port/dynloader/irix.h
src/backend/port/dynloader/linux.h
src/backend/port/dynloader/netbsd.h
src/backend/port/dynloader/openbsd.h
src/backend/port/dynloader/osf.h
src/backend/port/dynloader/sco.h
src/backend/port/dynloader/solaris.h
src/backend/port/dynloader/unixware.h
src/backend/port/dynloader/win32.h
src/backend/port/unix_latch.c
src/backend/port/win32/mingwcompat.c
src/backend/port/win32/socket.c
src/backend/port/win32/timer.c
src/backend/port/win32_latch.c
src/backend/port/win32_sema.c
src/backend/postmaster/autovacuum.c
src/backend/postmaster/bgwriter.c
src/backend/postmaster/checkpointer.c
src/backend/postmaster/pgarch.c
src/backend/postmaster/pgstat.c
src/backend/postmaster/postmaster.c
src/backend/postmaster/syslogger.c
src/backend/postmaster/walwriter.c
src/backend/regex/regc_locale.c
src/backend/regex/regc_pg_locale.c
src/backend/regex/regcomp.c
src/backend/regex/rege_dfa.c
src/backend/regex/regerror.c
src/backend/regex/regexec.c
src/backend/replication/basebackup.c
src/backend/replication/syncrep.c
src/backend/replication/walreceiver.c
src/backend/replication/walreceiverfuncs.c
src/backend/replication/walsender.c
src/backend/rewrite/rewriteDefine.c
src/backend/rewrite/rewriteSupport.c
src/backend/storage/buffer/bufmgr.c
src/backend/storage/buffer/freelist.c
src/backend/storage/file/fd.c
src/backend/storage/ipc/pmsignal.c
src/backend/storage/ipc/procarray.c
src/backend/storage/ipc/sinval.c
src/backend/storage/ipc/sinvaladt.c
src/backend/storage/ipc/standby.c
src/backend/storage/lmgr/lock.c
src/backend/storage/lmgr/lwlock.c
src/backend/storage/lmgr/predicate.c
src/backend/storage/lmgr/proc.c
src/backend/storage/lmgr/s_lock.c
src/backend/storage/smgr/md.c
src/backend/storage/smgr/smgr.c
src/backend/tcop/postgres.c
src/backend/tcop/utility.c
src/backend/tsearch/dict_thesaurus.c
src/backend/tsearch/spell.c
src/backend/tsearch/to_tsany.c
src/backend/tsearch/ts_utils.c
src/backend/utils/adt/acl.c
src/backend/utils/adt/array_selfuncs.c
src/backend/utils/adt/array_typanalyze.c
src/backend/utils/adt/cash.c
src/backend/utils/adt/date.c
src/backend/utils/adt/datetime.c
src/backend/utils/adt/dbsize.c
src/backend/utils/adt/float.c
src/backend/utils/adt/formatting.c
src/backend/utils/adt/inet_net_pton.c
src/backend/utils/adt/json.c
src/backend/utils/adt/lockfuncs.c
src/backend/utils/adt/mac.c
src/backend/utils/adt/misc.c
src/backend/utils/adt/numeric.c
src/backend/utils/adt/pg_locale.c
src/backend/utils/adt/pgstatfuncs.c
src/backend/utils/adt/rangetypes.c
src/backend/utils/adt/rangetypes_gist.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/timestamp.c
src/backend/utils/adt/tsgistidx.c
src/backend/utils/adt/tsquery_util.c
src/backend/utils/adt/tsrank.c
src/backend/utils/adt/tsvector_op.c
src/backend/utils/adt/varbit.c
src/backend/utils/adt/varchar.c
src/backend/utils/adt/varlena.c
src/backend/utils/adt/xml.c
src/backend/utils/cache/catcache.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/ts_cache.c
src/backend/utils/error/elog.c
src/backend/utils/fmgr/fmgr.c
src/backend/utils/fmgr/funcapi.c
src/backend/utils/init/miscinit.c
src/backend/utils/mb/wchar.c
src/backend/utils/misc/guc.c
src/backend/utils/mmgr/portalmem.c
src/backend/utils/sort/sortsupport.c
src/backend/utils/sort/tuplesort.c
src/backend/utils/sort/tuplestore.c
src/backend/utils/time/snapmgr.c
src/backend/utils/time/tqual.c
src/bin/initdb/findtimezone.c
src/bin/initdb/initdb.c
src/bin/pg_basebackup/pg_basebackup.c
src/bin/pg_basebackup/pg_receivexlog.c
src/bin/pg_basebackup/receivelog.c
src/bin/pg_basebackup/receivelog.h
src/bin/pg_basebackup/streamutil.c
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_dump/common.c
src/bin/pg_dump/dumputils.c
src/bin/pg_dump/dumputils.h
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_backup_custom.c
src/bin/pg_dump/pg_backup_db.c
src/bin/pg_dump/pg_backup_directory.c
src/bin/pg_dump/pg_backup_tar.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump_sort.c
src/bin/pg_dump/pg_dumpall.c
src/bin/pgevent/pgevent.c
src/bin/psql/command.c
src/bin/psql/common.c
src/bin/psql/copy.c
src/bin/psql/describe.c
src/bin/psql/help.c
src/bin/psql/input.c
src/bin/psql/print.c
src/bin/psql/print.h
src/bin/psql/startup.c
src/bin/psql/stringutils.c
src/bin/psql/tab-complete.c
src/bin/psql/variables.c
src/bin/scripts/clusterdb.c
src/bin/scripts/common.c
src/bin/scripts/common.h
src/bin/scripts/createlang.c
src/bin/scripts/dropdb.c
src/bin/scripts/droplang.c
src/bin/scripts/reindexdb.c
src/bin/scripts/vacuumdb.c
src/include/access/gist_private.h
src/include/access/heapam.h
src/include/access/htup.h
src/include/access/nbtree.h
src/include/access/slru.h
src/include/access/spgist.h
src/include/access/spgist_private.h
src/include/access/xact.h
src/include/access/xlog_internal.h
src/include/catalog/catalog.h
src/include/catalog/genbki.h
src/include/catalog/index.h
src/include/catalog/namespace.h
src/include/catalog/objectaccess.h
src/include/catalog/objectaddress.h
src/include/catalog/pg_aggregate.h
src/include/catalog/pg_attrdef.h
src/include/catalog/pg_attribute.h
src/include/catalog/pg_constraint.h
src/include/catalog/pg_control.h
src/include/catalog/pg_database.h
src/include/catalog/pg_db_role_setting.h
src/include/catalog/pg_default_acl.h
src/include/catalog/pg_description.h
src/include/catalog/pg_extension.h
src/include/catalog/pg_foreign_data_wrapper.h
src/include/catalog/pg_foreign_server.h
src/include/catalog/pg_foreign_table.h
src/include/catalog/pg_index.h
src/include/catalog/pg_language.h
src/include/catalog/pg_largeobject.h
src/include/catalog/pg_largeobject_metadata.h
src/include/catalog/pg_namespace.h
src/include/catalog/pg_opclass.h
src/include/catalog/pg_operator.h
src/include/catalog/pg_pltemplate.h
src/include/catalog/pg_proc.h
src/include/catalog/pg_range.h
src/include/catalog/pg_rewrite.h
src/include/catalog/pg_seclabel.h
src/include/catalog/pg_shdescription.h
src/include/catalog/pg_shseclabel.h
src/include/catalog/pg_statistic.h
src/include/catalog/pg_tablespace.h
src/include/catalog/pg_trigger.h
src/include/catalog/pg_ts_dict.h
src/include/catalog/pg_type.h
src/include/commands/createas.h
src/include/commands/defrem.h
src/include/commands/explain.h
src/include/commands/tablecmds.h
src/include/commands/typecmds.h
src/include/commands/vacuum.h
src/include/datatype/timestamp.h
src/include/executor/executor.h
src/include/executor/instrument.h
src/include/executor/spi_priv.h
src/include/foreign/fdwapi.h
src/include/lib/stringinfo.h
src/include/libpq/hba.h
src/include/libpq/ip.h
src/include/nodes/execnodes.h
src/include/nodes/parsenodes.h
src/include/nodes/primnodes.h
src/include/nodes/relation.h
src/include/optimizer/cost.h
src/include/optimizer/pathnode.h
src/include/optimizer/paths.h
src/include/optimizer/prep.h
src/include/optimizer/subselect.h
src/include/parser/analyze.h
src/include/pg_config_manual.h
src/include/pg_trace.h
src/include/pgstat.h
src/include/port.h
src/include/port/win32.h
src/include/postgres.h
src/include/postmaster/postmaster.h
src/include/regex/regguts.h
src/include/replication/walprotocol.h
src/include/replication/walreceiver.h
src/include/replication/walsender_private.h
src/include/rewrite/rewriteSupport.h
src/include/snowball/header.h
src/include/storage/barrier.h
src/include/storage/latch.h
src/include/storage/lock.h
src/include/storage/lwlock.h
src/include/storage/predicate.h
src/include/storage/proc.h
src/include/storage/procarray.h
src/include/storage/sinval.h
src/include/storage/smgr.h
src/include/tsearch/ts_public.h
src/include/utils/acl.h
src/include/utils/builtins.h
src/include/utils/guc.h
src/include/utils/guc_tables.h
src/include/utils/json.h
src/include/utils/lsyscache.h
src/include/utils/memutils.h
src/include/utils/pg_crc_tables.h
src/include/utils/plancache.h
src/include/utils/rangetypes.h
src/include/utils/rel.h
src/include/utils/selfuncs.h
src/include/utils/sortsupport.h
src/include/utils/timestamp.h
src/include/utils/tqual.h
src/include/utils/typcache.h
src/include/utils/xml.h
src/interfaces/ecpg/ecpglib/connect.c
src/interfaces/ecpg/ecpglib/execute.c
src/interfaces/ecpg/ecpglib/extern.h
src/interfaces/ecpg/pgtypeslib/dt.h
src/interfaces/ecpg/preproc/type.c
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-exec.c
src/interfaces/libpq/fe-protocol2.c
src/interfaces/libpq/fe-protocol3.c
src/interfaces/libpq/fe-secure.c
src/interfaces/libpq/libpq-fe.h
src/interfaces/libpq/libpq-int.h
src/interfaces/libpq/test/uri-regress.c
src/pl/plperl/plperl.c
src/pl/plperl/plperl_helpers.h
src/pl/plpgsql/src/pl_comp.c
src/pl/plpgsql/src/pl_exec.c
src/pl/plpython/plpy_cursorobject.c
src/pl/plpython/plpy_cursorobject.h
src/pl/plpython/plpy_elog.c
src/pl/plpython/plpy_elog.h
src/pl/plpython/plpy_exec.c
src/pl/plpython/plpy_exec.h
src/pl/plpython/plpy_main.c
src/pl/plpython/plpy_main.h
src/pl/plpython/plpy_planobject.h
src/pl/plpython/plpy_plpymodule.c
src/pl/plpython/plpy_plpymodule.h
src/pl/plpython/plpy_procedure.h
src/pl/plpython/plpy_resultobject.c
src/pl/plpython/plpy_resultobject.h
src/pl/plpython/plpy_spi.c
src/pl/plpython/plpy_spi.h
src/pl/plpython/plpy_subxactobject.c
src/pl/plpython/plpy_subxactobject.h
src/pl/plpython/plpy_typeio.c
src/pl/plpython/plpy_typeio.h
src/pl/plpython/plpy_util.c
src/pl/plpython/plpy_util.h
src/pl/plpython/plpython.h
src/port/erand48.c
src/port/fls.c
src/port/getaddrinfo.c
src/port/path.c
src/port/win32setlocale.c
src/test/isolation/isolationtester.c
src/test/regress/pg_regress.c
src/test/thread/thread_test.c
src/timezone/pgtz.c
src/tools/msvc/Install.pm
src/tools/msvc/MSBuildProject.pm
src/tools/msvc/Mkvcbuild.pm
src/tools/msvc/Project.pm
src/tools/msvc/Solution.pm
src/tools/msvc/VCBuildProject.pm
src/tools/msvc/VSObjectFactory.pm
src/tools/msvc/build.pl
src/tools/msvc/builddoc.pl
src/tools/msvc/config_default.pl
src/tools/msvc/gendef.pl
src/tools/msvc/install.pl
src/tools/msvc/pgbison.pl
src/tools/msvc/pgflex.pl
src/tools/msvc/vcregress.pl

index e48ea489dc5bb87f48037d058a4aae9f30a54f0d..ad333b664471aee25c15ff6dd4dcde5ac702845c 100644 (file)
@@ -23,7 +23,7 @@ static int    auto_explain_log_min_duration = -1; /* msec or -1 */
 static bool auto_explain_log_analyze = false;
 static bool auto_explain_log_verbose = false;
 static bool auto_explain_log_buffers = false;
-static bool auto_explain_log_timing  = false;
+static bool auto_explain_log_timing = false;
 static int     auto_explain_log_format = EXPLAIN_FORMAT_TEXT;
 static bool auto_explain_log_nested_statements = false;
 
index 71acb35af6ff3a7d6e5a7cd3e57688cb56a687fb..1e62d8091a9d2bdf60af6745d5a01ee14ee5cf5a 100644 (file)
@@ -1140,7 +1140,7 @@ storeHandler(PGresult *res, const PGdataValue *columns,
         * strings and add null termination.  As a micro-optimization, allocate
         * all the strings with one palloc.
         */
-       pbuflen = nfields;              /* count the null terminators themselves */
+       pbuflen = nfields;                      /* count the null terminators themselves */
        for (i = 0; i < nfields; i++)
        {
                int                     len = columns[i].len;
index 66fd0e62cc8da2b9f9b31ae4568ddf1fb3b0d3b6..e3b9223b3ee7a102efef7e1c18192eb64494864b 100644 (file)
@@ -109,17 +109,17 @@ PG_FUNCTION_INFO_V1(file_fdw_validator);
  * FDW callback routines
  */
 static void fileGetForeignRelSize(PlannerInfo *root,
-                                                                 RelOptInfo *baserel,
-                                                                 Oid foreigntableid);
+                                         RelOptInfo *baserel,
+                                         Oid foreigntableid);
 static void fileGetForeignPaths(PlannerInfo *root,
-                                                               RelOptInfo *baserel,
-                                                               Oid foreigntableid);
+                                       RelOptInfo *baserel,
+                                       Oid foreigntableid);
 static ForeignScan *fileGetForeignPlan(PlannerInfo *root,
-                                                                          RelOptInfo *baserel,
-                                                                          Oid foreigntableid,
-                                                                          ForeignPath *best_path,
-                                                                          List *tlist,
-                                                                          List *scan_clauses);
+                                  RelOptInfo *baserel,
+                                  Oid foreigntableid,
+                                  ForeignPath *best_path,
+                                  List *tlist,
+                                  List *scan_clauses);
 static void fileExplainForeignScan(ForeignScanState *node, ExplainState *es);
 static void fileBeginForeignScan(ForeignScanState *node, int eflags);
 static TupleTableSlot *fileIterateForeignScan(ForeignScanState *node);
@@ -141,7 +141,7 @@ static void estimate_size(PlannerInfo *root, RelOptInfo *baserel,
 static void estimate_costs(PlannerInfo *root, RelOptInfo *baserel,
                           FileFdwPlanState *fdw_private,
                           Cost *startup_cost, Cost *total_cost);
-static int     file_acquire_sample_rows(Relation onerel, int elevel,
+static int file_acquire_sample_rows(Relation onerel, int elevel,
                                                 HeapTuple *rows, int targrows,
                                                 double *totalrows, double *totaldeadrows);
 
@@ -180,7 +180,7 @@ file_fdw_validator(PG_FUNCTION_ARGS)
        List       *options_list = untransformRelOptions(PG_GETARG_DATUM(0));
        Oid                     catalog = PG_GETARG_OID(1);
        char       *filename = NULL;
-       DefElem    *force_not_null = NULL;
+       DefElem    *force_not_null = NULL;
        List       *other_options = NIL;
        ListCell   *cell;
 
@@ -233,7 +233,7 @@ file_fdw_validator(PG_FUNCTION_ARGS)
                                         buf.len > 0
                                         ? errhint("Valid options in this context are: %s",
                                                           buf.data)
-                                        : errhint("There are no valid options in this context.")));
+                                 : errhint("There are no valid options in this context.")));
                }
 
                /*
@@ -393,13 +393,13 @@ get_file_fdw_attribute_options(Oid relid)
                options = GetForeignColumnOptions(relid, attnum);
                foreach(lc, options)
                {
-                       DefElem    *def = (DefElem *) lfirst(lc);
+                       DefElem    *def = (DefElem *) lfirst(lc);
 
                        if (strcmp(def->defname, "force_not_null") == 0)
                        {
                                if (defGetBoolean(def))
                                {
-                                       char   *attname = pstrdup(NameStr(attr->attname));
+                                       char       *attname = pstrdup(NameStr(attr->attname));
 
                                        fnncolumns = lappend(fnncolumns, makeString(attname));
                                }
@@ -429,8 +429,8 @@ fileGetForeignRelSize(PlannerInfo *root,
        FileFdwPlanState *fdw_private;
 
        /*
-        * Fetch options.  We only need filename at this point, but we might
-        * as well get everything and not need to re-fetch it later in planning.
+        * Fetch options.  We only need filename at this point, but we might as
+        * well get everything and not need to re-fetch it later in planning.
         */
        fdw_private = (FileFdwPlanState *) palloc(sizeof(FileFdwPlanState));
        fileGetOptions(foreigntableid,
@@ -468,13 +468,14 @@ fileGetForeignPaths(PlannerInfo *root,
                                                                         baserel->rows,
                                                                         startup_cost,
                                                                         total_cost,
-                                                                        NIL, /* no pathkeys */
-                                                                        NULL, /* no outer rel either */
-                                                                        NIL)); /* no fdw_private data */
+                                                                        NIL,           /* no pathkeys */
+                                                                        NULL,          /* no outer rel either */
+                                                                        NIL));         /* no fdw_private data */
 
        /*
         * If data file was sorted, and we knew it somehow, we could insert
-        * appropriate pathkeys into the ForeignPath node to tell the planner that.
+        * appropriate pathkeys into the ForeignPath node to tell the planner
+        * that.
         */
 }
 
@@ -505,8 +506,8 @@ fileGetForeignPlan(PlannerInfo *root,
        return make_foreignscan(tlist,
                                                        scan_clauses,
                                                        scan_relid,
-                                                       NIL, /* no expressions to evaluate */
-                                                       NIL); /* no private state either */
+                                                       NIL,    /* no expressions to evaluate */
+                                                       NIL);           /* no private state either */
 }
 
 /*
@@ -665,14 +666,14 @@ fileAnalyzeForeignTable(Relation relation,
 {
        char       *filename;
        List       *options;
-       struct stat     stat_buf;
+       struct stat stat_buf;
 
        /* Fetch options of foreign table */
        fileGetOptions(RelationGetRelid(relation), &filename, &options);
 
        /*
-        * Get size of the file.  (XXX if we fail here, would it be better to
-        * just return false to skip analyzing the table?)
+        * Get size of the file.  (XXX if we fail here, would it be better to just
+        * return false to skip analyzing the table?)
         */
        if (stat(filename, &stat_buf) < 0)
                ereport(ERROR,
@@ -746,7 +747,7 @@ estimate_size(PlannerInfo *root, RelOptInfo *baserel,
                 * planner's idea of the relation width; which is bogus if not all
                 * columns are being read, not to mention that the text representation
                 * of a row probably isn't the same size as its internal
-                * representation.  Possibly we could do something better, but the
+                * representation.      Possibly we could do something better, but the
                 * real answer to anyone who complains is "ANALYZE" ...
                 */
                int                     tuple_width;
@@ -811,7 +812,7 @@ estimate_costs(PlannerInfo *root, RelOptInfo *baserel,
  * which must have at least targrows entries.
  * The actual number of rows selected is returned as the function result.
  * We also count the total number of rows in the file and return it into
- * *totalrows.  Note that *totaldeadrows is always set to 0.
+ * *totalrows. Note that *totaldeadrows is always set to 0.
  *
  * Note that the returned list of rows is not always in order by physical
  * position in the file.  Therefore, correlation estimates derived later
@@ -824,7 +825,7 @@ file_acquire_sample_rows(Relation onerel, int elevel,
                                                 double *totalrows, double *totaldeadrows)
 {
        int                     numrows = 0;
-       double          rowstoskip = -1; /* -1 means not set yet */
+       double          rowstoskip = -1;        /* -1 means not set yet */
        double          rstate;
        TupleDesc       tupDesc;
        Datum      *values;
@@ -853,8 +854,8 @@ file_acquire_sample_rows(Relation onerel, int elevel,
        cstate = BeginCopyFrom(onerel, filename, NIL, options);
 
        /*
-        * Use per-tuple memory context to prevent leak of memory used to read rows
-        * from the file with Copy routines.
+        * Use per-tuple memory context to prevent leak of memory used to read
+        * rows from the file with Copy routines.
         */
        tupcontext = AllocSetContextCreate(CurrentMemoryContext,
                                                                           "file_fdw temporary context",
@@ -912,10 +913,10 @@ file_acquire_sample_rows(Relation onerel, int elevel,
                        if (rowstoskip <= 0)
                        {
                                /*
-                                * Found a suitable tuple, so save it, replacing one
-                                * old tuple at random
+                                * Found a suitable tuple, so save it, replacing one old tuple
+                                * at random
                                 */
-                               int             k = (int) (targrows * anl_random_fract());
+                               int                     k = (int) (targrows * anl_random_fract());
 
                                Assert(k >= 0 && k < targrows);
                                heap_freetuple(rows[k]);
index 20977805c8deab6df569263894069afa4a494ca5..a226101bbc47b36e3f21a9ae374b65adbcf5b166 100644 (file)
@@ -37,7 +37,7 @@ const char *progname;
 /* Options and defaults */
 bool           debug = false;          /* are we debugging? */
 bool           dryrun = false;         /* are we performing a dry-run operation? */
-char      *additional_ext = NULL;      /* Extension to remove from filenames */
+char      *additional_ext = NULL;              /* Extension to remove from filenames */
 
 char      *archiveLocation;    /* where to find the archive? */
 char      *restartWALFileName; /* the file from which we can restart restore */
@@ -136,12 +136,13 @@ CleanupPriorWALFiles(void)
                         * they were originally written, in case this worries you.
                         */
                        if (strlen(walfile) == XLOG_DATA_FNAME_LEN &&
-                       strspn(walfile, "0123456789ABCDEF") == XLOG_DATA_FNAME_LEN &&
+                               strspn(walfile, "0123456789ABCDEF") == XLOG_DATA_FNAME_LEN &&
                                strcmp(walfile + 8, exclusiveCleanupFileName + 8) < 0)
                        {
-                               /* 
-                                * Use the original file name again now, including any extension
-                                * that might have been chopped off before testing the sequence.
+                               /*
+                                * Use the original file name again now, including any
+                                * extension that might have been chopped off before testing
+                                * the sequence.
                                 */
                                snprintf(WALFilePath, MAXPGPATH, "%s/%s",
                                                 archiveLocation, xlde->d_name);
@@ -150,7 +151,7 @@ CleanupPriorWALFiles(void)
                                {
                                        /*
                                         * Prints the name of the file to be removed and skips the
-                                        * actual removal.  The regular printout is so that the
+                                        * actual removal.      The regular printout is so that the
                                         * user can pipe the output into some other program.
                                         */
                                        printf("%s\n", WALFilePath);
@@ -298,7 +299,8 @@ main(int argc, char **argv)
                                dryrun = true;
                                break;
                        case 'x':
-                               additional_ext = optarg; /* Extension to remove from xlogfile names */
+                               additional_ext = optarg;                /* Extension to remove from
+                                                                                                * xlogfile names */
                                break;
                        default:
                                fprintf(stderr, "Try \"%s --help\" for more information.\n", progname);
index 06869fa344e8a5b23c613574f26787dd2e424fb8..aa11c144d68cf4c8a224d1cdcdd61a74c824ed47 100644 (file)
@@ -103,19 +103,19 @@ typedef struct Counters
        int64           calls;                  /* # of times executed */
        double          total_time;             /* total execution time, in msec */
        int64           rows;                   /* total # of retrieved or affected rows */
-       int64           shared_blks_hit;                /* # of shared buffer hits */
+       int64           shared_blks_hit;        /* # of shared buffer hits */
        int64           shared_blks_read;               /* # of shared disk blocks read */
        int64           shared_blks_dirtied;    /* # of shared disk blocks dirtied */
        int64           shared_blks_written;    /* # of shared disk blocks written */
-       int64           local_blks_hit;                 /* # of local buffer hits */
-       int64           local_blks_read;                /* # of local disk blocks read */
+       int64           local_blks_hit; /* # of local buffer hits */
+       int64           local_blks_read;        /* # of local disk blocks read */
        int64           local_blks_dirtied;             /* # of local disk blocks dirtied */
        int64           local_blks_written;             /* # of local disk blocks written */
-       int64           temp_blks_read;                 /* # of temp blocks read */
+       int64           temp_blks_read; /* # of temp blocks read */
        int64           temp_blks_written;              /* # of temp blocks written */
-       double          blk_read_time;                  /* time spent reading, in msec */
-       double          blk_write_time;                 /* time spent writing, in msec */
-       double          usage;                                  /* usage factor */
+       double          blk_read_time;  /* time spent reading, in msec */
+       double          blk_write_time; /* time spent writing, in msec */
+       double          usage;                  /* usage factor */
 } Counters;
 
 /*
@@ -140,7 +140,7 @@ typedef struct pgssSharedState
 {
        LWLockId        lock;                   /* protects hashtable search/modification */
        int                     query_size;             /* max query length in bytes */
-       double          cur_median_usage;       /* current median usage in hashtable */
+       double          cur_median_usage;               /* current median usage in hashtable */
 } pgssSharedState;
 
 /*
@@ -150,7 +150,7 @@ typedef struct pgssLocationLen
 {
        int                     location;               /* start offset in query text */
        int                     length;                 /* length in bytes, or -1 to ignore */
-}      pgssLocationLen;
+} pgssLocationLen;
 
 /*
  * Working state for computing a query jumble and producing a normalized
@@ -172,7 +172,7 @@ typedef struct pgssJumbleState
 
        /* Current number of valid entries in clocations array */
        int                     clocations_count;
-}      pgssJumbleState;
+} pgssJumbleState;
 
 /*---- Local variables ----*/
 
@@ -248,21 +248,21 @@ static uint32 pgss_hash_string(const char *str);
 static void pgss_store(const char *query, uint32 queryId,
                   double total_time, uint64 rows,
                   const BufferUsage *bufusage,
-                  pgssJumbleState * jstate);
+                  pgssJumbleState *jstate);
 static Size pgss_memsize(void);
 static pgssEntry *entry_alloc(pgssHashKey *key, const char *query,
-                                                         int query_len, bool sticky);
+                       int query_len, bool sticky);
 static void entry_dealloc(void);
 static void entry_reset(void);
-static void AppendJumble(pgssJumbleState * jstate,
+static void AppendJumble(pgssJumbleState *jstate,
                         const unsigned char *item, Size size);
-static void JumbleQuery(pgssJumbleState * jstate, Query *query);
-static void JumbleRangeTable(pgssJumbleState * jstate, List *rtable);
-static void JumbleExpr(pgssJumbleState * jstate, Node *node);
-static void RecordConstLocation(pgssJumbleState * jstate, int location);
-static char *generate_normalized_query(pgssJumbleState * jstate, const char *query,
+static void JumbleQuery(pgssJumbleState *jstate, Query *query);
+static void JumbleRangeTable(pgssJumbleState *jstate, List *rtable);
+static void JumbleExpr(pgssJumbleState *jstate, Node *node);
+static void RecordConstLocation(pgssJumbleState *jstate, int location);
+static char *generate_normalized_query(pgssJumbleState *jstate, const char *query,
                                                  int *query_len_p, int encoding);
-static void fill_in_constant_lengths(pgssJumbleState * jstate, const char *query);
+static void fill_in_constant_lengths(pgssJumbleState *jstate, const char *query);
 static int     comp_location(const void *a, const void *b);
 
 
@@ -513,8 +513,8 @@ pgss_shmem_startup(void)
        FreeFile(file);
 
        /*
-        * Remove the file so it's not included in backups/replication
-        * slaves, etc. A new file will be written on next shutdown.
+        * Remove the file so it's not included in backups/replication slaves,
+        * etc. A new file will be written on next shutdown.
         */
        unlink(PGSS_DUMP_FILE);
 
@@ -600,7 +600,7 @@ error:
        ereport(LOG,
                        (errcode_for_file_access(),
                         errmsg("could not write pg_stat_statement file \"%s\": %m",
-                                       PGSS_DUMP_FILE  ".tmp")));
+                                       PGSS_DUMP_FILE ".tmp")));
        if (file)
                FreeFile(file);
        unlink(PGSS_DUMP_FILE ".tmp");
@@ -626,8 +626,8 @@ pgss_post_parse_analyze(ParseState *pstate, Query *query)
         * the statement contains an optimizable statement for which a queryId
         * could be derived (such as EXPLAIN or DECLARE CURSOR).  For such cases,
         * runtime control will first go through ProcessUtility and then the
-        * executor, and we don't want the executor hooks to do anything, since
-        * we are already measuring the statement's costs at the utility level.
+        * executor, and we don't want the executor hooks to do anything, since we
+        * are already measuring the statement's costs at the utility level.
         */
        if (query->utilityStmt)
        {
@@ -768,7 +768,7 @@ pgss_ExecutorEnd(QueryDesc *queryDesc)
 
                pgss_store(queryDesc->sourceText,
                                   queryId,
-                                  queryDesc->totaltime->total * 1000.0, /* convert to msec */
+                                  queryDesc->totaltime->total * 1000.0,                /* convert to msec */
                                   queryDesc->estate->es_processed,
                                   &queryDesc->totaltime->bufusage,
                                   NULL);
@@ -789,10 +789,9 @@ pgss_ProcessUtility(Node *parsetree, const char *queryString,
                                        DestReceiver *dest, char *completionTag)
 {
        /*
-        * If it's an EXECUTE statement, we don't track it and don't increment
-        * the nesting level.  This allows the cycles to be charged to the
-        * underlying PREPARE instead (by the Executor hooks), which is much more
-        * useful.
+        * If it's an EXECUTE statement, we don't track it and don't increment the
+        * nesting level.  This allows the cycles to be charged to the underlying
+        * PREPARE instead (by the Executor hooks), which is much more useful.
         *
         * We also don't track execution of PREPARE.  If we did, we would get one
         * hash table entry for the PREPARE (with hash calculated from the query
@@ -942,7 +941,7 @@ static void
 pgss_store(const char *query, uint32 queryId,
                   double total_time, uint64 rows,
                   const BufferUsage *bufusage,
-                  pgssJumbleState * jstate)
+                  pgssJumbleState *jstate)
 {
        pgssHashKey key;
        pgssEntry  *entry;
@@ -1355,7 +1354,7 @@ entry_reset(void)
  * the current jumble.
  */
 static void
-AppendJumble(pgssJumbleState * jstate, const unsigned char *item, Size size)
+AppendJumble(pgssJumbleState *jstate, const unsigned char *item, Size size)
 {
        unsigned char *jumble = jstate->jumble;
        Size            jumble_len = jstate->jumble_len;
@@ -1404,7 +1403,7 @@ AppendJumble(pgssJumbleState * jstate, const unsigned char *item, Size size)
  * of information).
  */
 static void
-JumbleQuery(pgssJumbleState * jstate, Query *query)
+JumbleQuery(pgssJumbleState *jstate, Query *query)
 {
        Assert(IsA(query, Query));
        Assert(query->utilityStmt == NULL);
@@ -1431,7 +1430,7 @@ JumbleQuery(pgssJumbleState * jstate, Query *query)
  * Jumble a range table
  */
 static void
-JumbleRangeTable(pgssJumbleState * jstate, List *rtable)
+JumbleRangeTable(pgssJumbleState *jstate, List *rtable)
 {
        ListCell   *lc;
 
@@ -1485,11 +1484,11 @@ JumbleRangeTable(pgssJumbleState * jstate, List *rtable)
  *
  * Note: the reason we don't simply use expression_tree_walker() is that the
  * point of that function is to support tree walkers that don't care about
- * most tree node types, but here we care about all types.  We should complain
+ * most tree node types, but here we care about all types.     We should complain
  * about any unrecognized node type.
  */
 static void
-JumbleExpr(pgssJumbleState * jstate, Node *node)
+JumbleExpr(pgssJumbleState *jstate, Node *node)
 {
        ListCell   *temp;
 
@@ -1874,7 +1873,7 @@ JumbleExpr(pgssJumbleState * jstate, Node *node)
  * that is currently being walked.
  */
 static void
-RecordConstLocation(pgssJumbleState * jstate, int location)
+RecordConstLocation(pgssJumbleState *jstate, int location)
 {
        /* -1 indicates unknown or undefined location */
        if (location >= 0)
@@ -1909,7 +1908,7 @@ RecordConstLocation(pgssJumbleState * jstate, int location)
  * Returns a palloc'd string, which is not necessarily null-terminated.
  */
 static char *
-generate_normalized_query(pgssJumbleState * jstate, const char *query,
+generate_normalized_query(pgssJumbleState *jstate, const char *query,
                                                  int *query_len_p, int encoding)
 {
        char       *norm_query;
@@ -2007,7 +2006,7 @@ generate_normalized_query(pgssJumbleState * jstate, const char *query,
  * a problem.
  *
  * Duplicate constant pointers are possible, and will have their lengths
- * marked as '-1', so that they are later ignored.  (Actually, we assume the
+ * marked as '-1', so that they are later ignored.     (Actually, we assume the
  * lengths were initialized as -1 to start with, and don't change them here.)
  *
  * N.B. There is an assumption that a '-' character at a Const location begins
@@ -2015,7 +2014,7 @@ generate_normalized_query(pgssJumbleState * jstate, const char *query,
  * reason for a constant to start with a '-'.
  */
 static void
-fill_in_constant_lengths(pgssJumbleState * jstate, const char *query)
+fill_in_constant_lengths(pgssJumbleState *jstate, const char *query)
 {
        pgssLocationLen *locs;
        core_yyscan_t yyscanner;
index 7f92bc88182beedf3bfd1881f90ec5c4d0fcf4ce..9fe2301e419a569d6f6111c606a22c01c2690c9a 100644 (file)
@@ -29,7 +29,7 @@
 
 /* These are macros to avoid timing the function call overhead. */
 #ifndef WIN32
-#define START_TIMER    \
+#define START_TIMER \
 do { \
        alarm_triggered = false; \
        alarm(secs_per_test); \
@@ -37,7 +37,7 @@ do { \
 } while (0)
 #else
 /* WIN32 doesn't support alarm, so we create a thread and sleep there */
-#define START_TIMER    \
+#define START_TIMER \
 do { \
        alarm_triggered = false; \
        if (CreateThread(NULL, 0, process_alarm, NULL, 0, NULL) == \
@@ -55,7 +55,7 @@ do { \
        gettimeofday(&stop_t, NULL); \
        print_elapse(start_t, stop_t, ops); \
 } while (0)
-               
+
 
 static const char *progname;
 
@@ -77,6 +77,7 @@ static void test_sync(int writes_per_op);
 static void test_open_syncs(void);
 static void test_open_sync(const char *msg, int writes_size);
 static void test_file_descriptor_sync(void);
+
 #ifndef WIN32
 static void process_alarm(int sig);
 #else
index 4e43694338bed648fe0b674952465b694e058844..b3f98abe5cb6b1bc37253d00d0ba68b6fd75e543 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     pg_test_timing.c
- *             tests overhead of timing calls and their monotonicity:  that
- *             they always move forward
+ *             tests overhead of timing calls and their monotonicity:  that
+ *             they always move forward
  */
 
 #include "postgres_fe.h"
@@ -35,8 +35,8 @@ handle_args(int argc, char *argv[])
                {"duration", required_argument, NULL, 'd'},
                {NULL, 0, NULL, 0}
        };
-       int option;                     /* Command line option */
-       int     optindex = 0;   /* used by getopt_long */
+       int                     option;                 /* Command line option */
+       int                     optindex = 0;   /* used by getopt_long */
 
        if (argc > 1)
        {
@@ -87,7 +87,7 @@ handle_args(int argc, char *argv[])
        else
        {
                fprintf(stderr,
-                               "%s: duration must be a positive integer (duration is \"%d\")\n",
+                       "%s: duration must be a positive integer (duration is \"%d\")\n",
                                progname, test_duration);
                fprintf(stderr, "Try \"%s --help\" for more information.\n",
                                progname);
@@ -98,16 +98,22 @@ handle_args(int argc, char *argv[])
 static void
 test_timing(int32 duration)
 {
-       uint64 total_time;
-       int64 time_elapsed = 0;
-       uint64 loop_count = 0;
-       uint64 prev, cur;
-       int32 diff, i, bits, found;
-
-       instr_time start_time, end_time, temp;
+       uint64          total_time;
+       int64           time_elapsed = 0;
+       uint64          loop_count = 0;
+       uint64          prev,
+                               cur;
+       int32           diff,
+                               i,
+                               bits,
+                               found;
+
+       instr_time      start_time,
+                               end_time,
+                               temp;
 
        static int64 histogram[32];
-       char    buf[100];
+       char            buf[100];
 
        total_time = duration > 0 ? duration * 1000000 : 0;
 
@@ -146,7 +152,7 @@ test_timing(int32 duration)
        INSTR_TIME_SUBTRACT(end_time, start_time);
 
        printf("Per loop time including overhead: %0.2f nsec\n",
-                       INSTR_TIME_GET_DOUBLE(end_time) * 1e9 / loop_count);
+                  INSTR_TIME_GET_DOUBLE(end_time) * 1e9 / loop_count);
        printf("Histogram of timing durations:\n");
        printf("%9s: %10s %9s\n", "< usec", "count", "percent");
 
index 57bce012070a49bb2c5e2d45140bffcd8a307669..d59c8eb670b44c4c8b79e6b92baa0f68e6ce4e73 100644 (file)
@@ -199,9 +199,9 @@ gtrgm_consistent(PG_FUNCTION_ARGS)
         * trigram extraction is relatively CPU-expensive.      We must include
         * strategy number because trigram extraction depends on strategy.
         *
-        * The cached structure contains the strategy number, then the input
-        * query (starting at a MAXALIGN boundary), then the TRGM value (also
-        * starting at a MAXALIGN boundary).
+        * The cached structure contains the strategy number, then the input query
+        * (starting at a MAXALIGN boundary), then the TRGM value (also starting
+        * at a MAXALIGN boundary).
         */
        if (cache == NULL ||
                strategy != *((StrategyNumber *) cache) ||
@@ -341,8 +341,7 @@ gtrgm_distance(PG_FUNCTION_ARGS)
        char       *cache = (char *) fcinfo->flinfo->fn_extra;
 
        /*
-        * Cache the generated trigrams across multiple calls with the same
-        * query.
+        * Cache the generated trigrams across multiple calls with the same query.
         */
        if (cache == NULL ||
                VARSIZE(cache) != querysize ||
index 2669c096586743aa2580696915d00f10abaeed3c..eed4a1eba7c7cebf271aa9ba22728f515a65d358 100644 (file)
@@ -168,7 +168,7 @@ issue_warnings(char *sequence_script_file_name)
                                          SYSTEMQUOTE "\"%s/psql\" --echo-queries "
                                          "--set ON_ERROR_STOP=on "
                                          "--no-psqlrc --port %d --username \"%s\" "
-                                         "-f \"%s\" --dbname template1 >> \"%s\" 2>&1" SYSTEMQUOTE,
+                                  "-f \"%s\" --dbname template1 >> \"%s\" 2>&1" SYSTEMQUOTE,
                                          new_cluster.bindir, new_cluster.port, os_info.user,
                                          sequence_script_file_name, UTILITY_LOG_FILE);
                        unlink(sequence_script_file_name);
@@ -204,7 +204,7 @@ output_completion_banner(char *analyze_script_file_name,
        else
                pg_log(PG_REPORT,
                           "Optimizer statistics and free space information are not transferred\n"
-                          "by pg_upgrade so, once you start the new server, consider running:\n"
+               "by pg_upgrade so, once you start the new server, consider running:\n"
                           "    %s\n\n", analyze_script_file_name);
 
        pg_log(PG_REPORT,
@@ -238,7 +238,8 @@ check_cluster_versions(void)
 
        /*
         * We can't allow downgrading because we use the target pg_dumpall, and
-        * pg_dumpall cannot operate on new database versions, only older versions.
+        * pg_dumpall cannot operate on new database versions, only older
+        * versions.
         */
        if (old_cluster.major_version > new_cluster.major_version)
                pg_log(PG_FATAL, "This utility cannot be used to downgrade to older major PostgreSQL versions.\n");
@@ -402,31 +403,31 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
 #endif
 
        fprintf(script, "echo %sThis script will generate minimal optimizer statistics rapidly%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "echo %sso your system is usable, and then gather statistics twice more%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "echo %swith increasing accuracy.  When it is done, your system will%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "echo %shave the default level of optimizer statistics.%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "echo\n\n");
 
        fprintf(script, "echo %sIf you have used ALTER TABLE to modify the statistics target for%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "echo %sany tables, you might want to remove them and restore them after%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "echo %srunning this script because they will delay fast statistics generation.%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "echo\n\n");
 
        fprintf(script, "echo %sIf you would like default statistics as quickly as possible, cancel%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "echo %sthis script and run:%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "echo %s    vacuumdb --all %s%s\n", ECHO_QUOTE,
-               /* Did we copy the free space files? */
-               (GET_MAJOR_VERSION(old_cluster.major_version) >= 804) ?
-               "--analyze-only" : "--analyze", ECHO_QUOTE);
+       /* Did we copy the free space files? */
+                       (GET_MAJOR_VERSION(old_cluster.major_version) >= 804) ?
+                       "--analyze-only" : "--analyze", ECHO_QUOTE);
        fprintf(script, "echo\n\n");
 
 #ifndef WIN32
@@ -441,15 +442,15 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
 #endif
 
        fprintf(script, "echo %sGenerating minimal optimizer statistics (1 target)%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "echo %s--------------------------------------------------%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "vacuumdb --all --analyze-only\n");
        fprintf(script, "echo\n");
        fprintf(script, "echo %sThe server is now available with minimal optimizer statistics.%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "echo %sQuery performance will be optimal once this script completes.%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "echo\n\n");
 
 #ifndef WIN32
@@ -462,9 +463,9 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
 #endif
 
        fprintf(script, "echo %sGenerating medium optimizer statistics (10 targets)%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "echo %s---------------------------------------------------%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "vacuumdb --all --analyze-only\n");
        fprintf(script, "echo\n\n");
 
@@ -475,17 +476,17 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
 #endif
 
        fprintf(script, "echo %sGenerating default (full) optimizer statistics (100 targets?)%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "echo %s-------------------------------------------------------------%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
        fprintf(script, "vacuumdb --all %s\n",
-               /* Did we copy the free space files? */
-               (GET_MAJOR_VERSION(old_cluster.major_version) >= 804) ?
-               "--analyze-only" : "--analyze");
+       /* Did we copy the free space files? */
+                       (GET_MAJOR_VERSION(old_cluster.major_version) >= 804) ?
+                       "--analyze-only" : "--analyze");
 
        fprintf(script, "echo\n\n");
        fprintf(script, "echo %sDone%s\n",
-                                       ECHO_QUOTE, ECHO_QUOTE);
+                       ECHO_QUOTE, ECHO_QUOTE);
 
        fclose(script);
 
@@ -716,8 +717,8 @@ check_for_isn_and_int8_passing_mismatch(ClusterInfo *cluster)
                pg_log(PG_REPORT, "fatal\n");
                pg_log(PG_FATAL,
                           "Your installation contains \"contrib/isn\" functions which rely on the\n"
-                          "bigint data type.  Your old and new clusters pass bigint values\n"
-                          "differently so this cluster cannot currently be upgraded.  You can\n"
+                 "bigint data type.  Your old and new clusters pass bigint values\n"
+               "differently so this cluster cannot currently be upgraded.  You can\n"
                           "manually upgrade databases that use \"contrib/isn\" facilities and remove\n"
                           "\"contrib/isn\" from the old cluster and restart the upgrade.  A list of\n"
                           "the problem functions is in the file:\n"
@@ -764,9 +765,9 @@ check_for_reg_data_type_usage(ClusterInfo *cluster)
                PGconn     *conn = connectToServer(cluster, active_db->db_name);
 
                /*
-                *      While several relkinds don't store any data, e.g. views, they
-                *      can be used to define data types of other columns, so we
-                *      check all relkinds.
+                * While several relkinds don't store any data, e.g. views, they can
+                * be used to define data types of other columns, so we check all
+                * relkinds.
                 */
                res = executeQueryOrDie(conn,
                                                                "SELECT n.nspname, c.relname, a.attname "
@@ -777,16 +778,16 @@ check_for_reg_data_type_usage(ClusterInfo *cluster)
                                                                "               NOT a.attisdropped AND "
                                                                "               a.atttypid IN ( "
                  "                     'pg_catalog.regproc'::pg_catalog.regtype, "
-                 "                     'pg_catalog.regprocedure'::pg_catalog.regtype, "
+                                                               "                       'pg_catalog.regprocedure'::pg_catalog.regtype, "
                  "                     'pg_catalog.regoper'::pg_catalog.regtype, "
-                 "                     'pg_catalog.regoperator'::pg_catalog.regtype, "
+                                                               "                       'pg_catalog.regoperator'::pg_catalog.regtype, "
                /* regclass.oid is preserved, so 'regclass' is OK */
                /* regtype.oid is preserved, so 'regtype' is OK */
-                 "                     'pg_catalog.regconfig'::pg_catalog.regtype, "
-                 "                     'pg_catalog.regdictionary'::pg_catalog.regtype) AND "
-                 "             c.relnamespace = n.oid AND "
-                 "             n.nspname != 'pg_catalog' AND "
-                 "             n.nspname != 'information_schema'");
+               "                       'pg_catalog.regconfig'::pg_catalog.regtype, "
+                                                               "                       'pg_catalog.regdictionary'::pg_catalog.regtype) AND "
+                                                               "               c.relnamespace = n.oid AND "
+                                                         "             n.nspname != 'pg_catalog' AND "
+                                                "              n.nspname != 'information_schema'");
 
                ntups = PQntuples(res);
                i_nspname = PQfnumber(res, "nspname");
@@ -822,8 +823,8 @@ check_for_reg_data_type_usage(ClusterInfo *cluster)
                pg_log(PG_REPORT, "fatal\n");
                pg_log(PG_FATAL,
                           "Your installation contains one of the reg* data types in user tables.\n"
-                          "These data types reference system OIDs that are not preserved by\n"
-                          "pg_upgrade, so this cluster cannot currently be upgraded.  You can\n"
+                "These data types reference system OIDs that are not preserved by\n"
+               "pg_upgrade, so this cluster cannot currently be upgraded.  You can\n"
                           "remove the problem tables and restart the upgrade.  A list of the problem\n"
                           "columns is in the file:\n"
                           "    %s\n\n", output_path);
@@ -836,9 +837,11 @@ check_for_reg_data_type_usage(ClusterInfo *cluster)
 static void
 get_bin_version(ClusterInfo *cluster)
 {
-       char            cmd[MAXPGPATH], cmd_output[MAX_STRING];
+       char            cmd[MAXPGPATH],
+                               cmd_output[MAX_STRING];
        FILE       *output;
-       int                     pre_dot, post_dot;
+       int                     pre_dot,
+                               post_dot;
 
        snprintf(cmd, sizeof(cmd), "\"%s/pg_ctl\" --version", cluster->bindir);
 
@@ -858,4 +861,3 @@ get_bin_version(ClusterInfo *cluster)
 
        cluster->bin_version = (pre_dot * 100 + post_dot) * 100;
 }
-
index e01280db9e284b5527c5d7db0afc481247e1e017..6bffe549e59610846eaa391f63bb956ab05d37f3 100644 (file)
@@ -129,6 +129,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
                pg_log(PG_VERBOSE, "%s", bufin);
 
 #ifdef WIN32
+
                /*
                 * Due to an installer bug, LANG=C doesn't work for PG 8.3.3, but does
                 * work 8.2.6 and 8.3.7, so check for non-ASCII output and suggest a
@@ -506,7 +507,7 @@ check_control_data(ControlData *oldctrl,
                 * This is a common 8.3 -> 8.4 upgrade problem, so we are more verbose
                 */
                pg_log(PG_FATAL,
-                          "You will need to rebuild the new server with configure option\n"
+                       "You will need to rebuild the new server with configure option\n"
                           "--disable-integer-datetimes or get server binaries built with those\n"
                           "options.\n");
        }
@@ -531,6 +532,6 @@ disable_old_cluster(void)
        pg_log(PG_REPORT, "\n"
                   "If you want to start the old cluster, you will need to remove\n"
                   "the \".old\" suffix from %s/global/pg_control.old.\n"
-                  "Because \"link\" mode was used, the old cluster cannot be safely\n"
-                  "started once the new cluster has been started.\n\n", old_cluster.pgdata);
+                "Because \"link\" mode was used, the old cluster cannot be safely\n"
+       "started once the new cluster has been started.\n\n", old_cluster.pgdata);
 }
index 68cf0795aabdb7f734d2528980cf4bbad6a8a46f..9e63bd5856839b1c6f099cdb0b5e53ea34ec19d4 100644 (file)
@@ -18,8 +18,9 @@
 static void check_data_dir(const char *pg_data);
 static void check_bin_dir(ClusterInfo *cluster);
 static void validate_exec(const char *dir, const char *cmdName);
+
 #ifdef WIN32
-static int win32_check_directory_write_permissions(void);
+static int     win32_check_directory_write_permissions(void);
 #endif
 
 
@@ -64,7 +65,7 @@ exec_prog(bool throw_error, bool is_priv,
                pg_log(throw_error ? PG_FATAL : PG_REPORT,
                           "Consult the last few lines of \"%s\" for\n"
                           "the probable cause of the failure.\n",
-                               log_file);
+                          log_file);
                return 1;
        }
 
@@ -142,12 +143,12 @@ verify_directories(void)
 static int
 win32_check_directory_write_permissions(void)
 {
-       int fd;
+       int                     fd;
 
        /*
-        *      We open a file we would normally create anyway.  We do this even in
-        *      'check' mode, which isn't ideal, but this is the best we can do.
-        */     
+        * We open a file we would normally create anyway.      We do this even in
+        * 'check' mode, which isn't ideal, but this is the best we can do.
+        */
        if ((fd = open(GLOBALS_DUMP_FILE, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR)) < 0)
                return -1;
        close(fd);
@@ -184,7 +185,7 @@ check_data_dir(const char *pg_data)
                struct stat statBuf;
 
                snprintf(subDirName, sizeof(subDirName), "%s%s%s", pg_data,
-                       /* Win32 can't stat() a directory with a trailing slash. */
+               /* Win32 can't stat() a directory with a trailing slash. */
                                 *requiredSubdirs[subdirnum] ? "/" : "",
                                 requiredSubdirs[subdirnum]);
 
index 0276636e03fa4208134b0d4aa91c2c037c9c432f..1dd3722142c9e83c1ec228099c3a3fd302a2179b 100644 (file)
@@ -233,7 +233,7 @@ copy_file(const char *srcfile, const char *dstfile, bool force)
  * large number of times.
  */
 int
-load_directory(const char *dirname, struct dirent ***namelist)
+load_directory(const char *dirname, struct dirent *** namelist)
 {
        DIR                *dirdesc;
        struct dirent *direntry;
@@ -251,7 +251,7 @@ load_directory(const char *dirname, struct dirent ***namelist)
                count++;
 
                *namelist = (struct dirent **) realloc((void *) (*namelist),
-                                       (size_t) ((name_num + 1) * sizeof(struct dirent *)));
+                                               (size_t) ((name_num + 1) * sizeof(struct dirent *)));
 
                if (*namelist == NULL)
                {
@@ -314,7 +314,6 @@ win32_pghardlink(const char *src, const char *dst)
        else
  &nb