From 9e1c9f959422192bbe1b842a2a1ffaf76b080196 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 1 Jul 2019 12:37:52 -0400 Subject: [PATCH] pgindent run prior to branching v12. pgperltidy and reformat-dat-files too, though the latter didn't find anything to change. --- contrib/postgres_fdw/postgres_fdw.h | 1 + src/backend/commands/indexcmds.c | 8 ++++---- src/backend/commands/tablecmds.c | 3 ++- src/backend/commands/tablespace.c | 4 ++-- src/backend/executor/nodeIndexonlyscan.c | 5 ++--- src/backend/executor/nodeModifyTable.c | 4 ++-- src/backend/partitioning/partbounds.c | 5 +++-- src/backend/utils/adt/pg_lsn.c | 2 +- src/backend/utils/cache/syscache.c | 2 +- src/backend/utils/misc/guc.c | 2 +- src/bin/initdb/findtimezone.c | 5 +++-- src/include/catalog/pg_statistic_ext_data.h | 6 +++--- src/tools/msvc/Mkvcbuild.pm | 12 ++++++------ src/tools/pgindent/README | 1 + src/tools/pgindent/typedefs.list | 2 -- 15 files changed, 32 insertions(+), 30 deletions(-) diff --git a/contrib/postgres_fdw/postgres_fdw.h b/contrib/postgres_fdw/postgres_fdw.h index 35545e1831..6acb7dcf6c 100644 --- a/contrib/postgres_fdw/postgres_fdw.h +++ b/contrib/postgres_fdw/postgres_fdw.h @@ -64,6 +64,7 @@ typedef struct PgFdwRelationInfo int width; Cost startup_cost; Cost total_cost; + /* * Estimated number of rows fetched from the foreign server, and costs * excluding costs for transferring those rows from the foreign server. diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 579b998954..6fa5738bbf 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -1085,9 +1085,9 @@ DefineIndex(Oid relationId, childrel = table_open(childRelid, lockmode); /* - * Don't try to create indexes on foreign tables, though. - * Skip those if a regular index, or fail if trying to create - * a constraint index. + * Don't try to create indexes on foreign tables, though. Skip + * those if a regular index, or fail if trying to create a + * constraint index. */ if (childrel->rd_rel->relkind == RELKIND_FOREIGN_TABLE) { @@ -1097,7 +1097,7 @@ DefineIndex(Oid relationId, errmsg("cannot create unique index on partitioned table \"%s\"", RelationGetRelationName(rel)), errdetail("Table \"%s\" contains partitions that are foreign tables.", - RelationGetRelationName(rel)))); + RelationGetRelationName(rel)))); table_close(childrel, lockmode); continue; diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index fd67d2a841..3aee2d82ce 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -1077,7 +1077,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, errmsg("cannot create foreign partition of partitioned table \"%s\"", RelationGetRelationName(parent)), errdetail("Table \"%s\" contains indexes that are unique.", - RelationGetRelationName(parent)))); + RelationGetRelationName(parent)))); else { index_close(idxRel, AccessShareLock); @@ -15682,6 +15682,7 @@ ATExecAttachPartition(List **wqueue, Relation rel, PartitionCmd *cmd) defaultrel = table_open(defaultPartOid, NoLock); defPartConstraint = get_proposed_default_constraint(partBoundConstraint); + /* * Map the Vars in the constraint expression from rel's attnos to * defaultrel's. diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c index 502736be1a..84efb414d8 100644 --- a/src/backend/commands/tablespace.c +++ b/src/backend/commands/tablespace.c @@ -1211,8 +1211,8 @@ check_temp_tablespaces(char **newval, void **extra, GucSource source) /* * If we aren't inside a transaction, or connected to a database, we * cannot do the catalog accesses necessary to verify the name. Must - * accept the value on faith. - * Fortunately, there's then also no need to pass the data to fd.c. + * accept the value on faith. Fortunately, there's then also no need to + * pass the data to fd.c. */ if (IsTransactionState() && MyDatabaseId != InvalidOid) { diff --git a/src/backend/executor/nodeIndexonlyscan.c b/src/backend/executor/nodeIndexonlyscan.c index f0f8fa210b..652a9afc75 100644 --- a/src/backend/executor/nodeIndexonlyscan.c +++ b/src/backend/executor/nodeIndexonlyscan.c @@ -528,9 +528,8 @@ ExecInitIndexOnlyScan(IndexOnlyScan *node, EState *estate, int eflags) &TTSOpsVirtual); /* - * We need another slot, in a format that's suitable for the table AM, - * for when we need to fetch a tuple from the table for rechecking - * visibility. + * We need another slot, in a format that's suitable for the table AM, for + * when we need to fetch a tuple from the table for rechecking visibility. */ indexstate->ioss_TableSlot = ExecAllocTableSlot(&estate->es_tupleTable, diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c index 24ed3718ef..d8b695d897 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c @@ -2317,8 +2317,8 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) * indexes for insertion of new index entries. Note we *must* set * estate->es_result_relation_info correctly while we initialize each * sub-plan; external modules such as FDWs may depend on that (see - * contrib/postgres_fdw/postgres_fdw.c: postgresBeginDirectModify() - * as one example). + * contrib/postgres_fdw/postgres_fdw.c: postgresBeginDirectModify() as one + * example). */ saved_resultRelInfo = estate->es_result_relation_info; diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c index f3c9236ad5..13d576c379 100644 --- a/src/backend/partitioning/partbounds.c +++ b/src/backend/partitioning/partbounds.c @@ -1237,13 +1237,14 @@ check_default_partition_contents(Relation parent, Relation default_rel, : get_qual_for_range(parent, new_spec, false); def_part_constraints = get_proposed_default_constraint(new_part_constraints); + /* * Map the Vars in the constraint expression from parent's attnos to * default_rel's. */ def_part_constraints = - map_partition_varattnos(def_part_constraints, 1, default_rel, - parent, NULL); + map_partition_varattnos(def_part_constraints, 1, default_rel, + parent, NULL); /* * If the existing constraints on the default partition imply that it will diff --git a/src/backend/utils/adt/pg_lsn.c b/src/backend/utils/adt/pg_lsn.c index 2d4b4bf3d8..4c329a8d8f 100644 --- a/src/backend/utils/adt/pg_lsn.c +++ b/src/backend/utils/adt/pg_lsn.c @@ -61,7 +61,7 @@ pg_lsn_in(PG_FUNCTION_ARGS) { char *str = PG_GETARG_CSTRING(0); XLogRecPtr result; - bool have_error = false; + bool have_error = false; result = pg_lsn_in_internal(str, &have_error); if (have_error) diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c index 99976468e5..16297a52a1 100644 --- a/src/backend/utils/cache/syscache.c +++ b/src/backend/utils/cache/syscache.c @@ -728,7 +728,7 @@ static const struct cachedesc cacheinfo[] = { }, 32 }, - {StatisticExtDataRelationId, /* STATEXTDATASTXOID */ + {StatisticExtDataRelationId, /* STATEXTDATASTXOID */ StatisticExtDataStxoidIndexId, 1, { diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 92c4fee8f8..631f16f5fe 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -11615,7 +11615,7 @@ check_recovery_target_time(char **newval, void **extra, GucSource source) dterr = DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tz); if (dterr != 0) return false; - if (dtype != DTK_DATE) + if (dtype != DTK_DATE) return false; if (tm2timestamp(tm, fsec, &tz, ×tamp) != 0) diff --git a/src/bin/initdb/findtimezone.c b/src/bin/initdb/findtimezone.c index f91fd3115e..a5c9c9ee51 100644 --- a/src/bin/initdb/findtimezone.c +++ b/src/bin/initdb/findtimezone.c @@ -699,8 +699,9 @@ scan_available_timezones(char *tzdir, char *tzdirsub, struct tztry *tt, else if (score == *bestscore) { /* Consider how to break a tie */ - int namepref = (zone_name_pref(tzdirsub) - - zone_name_pref(bestzonename)); + int namepref = (zone_name_pref(tzdirsub) - + zone_name_pref(bestzonename)); + if (namepref > 0 || (namepref == 0 && (strlen(tzdirsub) < strlen(bestzonename) || diff --git a/src/include/catalog/pg_statistic_ext_data.h b/src/include/catalog/pg_statistic_ext_data.h index 5da9bc8ae2..952883e2d3 100644 --- a/src/include/catalog/pg_statistic_ext_data.h +++ b/src/include/catalog/pg_statistic_ext_data.h @@ -34,9 +34,9 @@ CATALOG(pg_statistic_ext_data,3429,StatisticExtDataRelationId) #ifdef CATALOG_VARLEN /* variable-length fields start here */ - pg_ndistinct stxdndistinct; /* ndistinct coefficients (serialized) */ + pg_ndistinct stxdndistinct; /* ndistinct coefficients (serialized) */ pg_dependencies stxddependencies; /* dependencies (serialized) */ - pg_mcv_list stxdmcv; /* MCV (serialized) */ + pg_mcv_list stxdmcv; /* MCV (serialized) */ #endif @@ -47,6 +47,6 @@ CATALOG(pg_statistic_ext_data,3429,StatisticExtDataRelationId) * the format of pg_statistic_ext_data relation. * ---------------- */ -typedef FormData_pg_statistic_ext_data *Form_pg_statistic_ext_data; +typedef FormData_pg_statistic_ext_data * Form_pg_statistic_ext_data; #endif /* PG_STATISTIC_EXT_DATA_H */ diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index 973691c3de..6f928234ee 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -42,12 +42,12 @@ my $contrib_extrasource = { 'seg' => [ 'contrib/seg/segscan.l', 'contrib/seg/segparse.y' ], }; my @contrib_excludes = ( - 'commit_ts', 'hstore_plperl', - 'hstore_plpython', 'intagg', - 'jsonb_plperl', 'jsonb_plpython', - 'ltree_plpython', 'pgcrypto', - 'sepgsql', 'brin', - 'test_extensions', 'test_pg_dump', + 'commit_ts', 'hstore_plperl', + 'hstore_plpython', 'intagg', + 'jsonb_plperl', 'jsonb_plpython', + 'ltree_plpython', 'pgcrypto', + 'sepgsql', 'brin', + 'test_extensions', 'test_pg_dump', 'snapshot_too_old', 'unsafe_tests'); # Set of variables for frontend modules diff --git a/src/tools/pgindent/README b/src/tools/pgindent/README index 044b380fed..00bffcf005 100644 --- a/src/tools/pgindent/README +++ b/src/tools/pgindent/README @@ -50,6 +50,7 @@ DOING THE INDENT RUN: 5) Reformat the bootstrap catalog data files: + ./configure # "make" will not work in an unconfigured tree cd src/include/catalog make reformat-dat-files cd ../../.. diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index bdcbc8d15e..8cc033eb13 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -729,7 +729,6 @@ FormData_pg_sequence_data FormData_pg_shdepend FormData_pg_statistic FormData_pg_statistic_ext -FormData_pg_statistic_ext_data FormData_pg_subscription FormData_pg_subscription_rel FormData_pg_tablespace @@ -787,7 +786,6 @@ Form_pg_sequence_data Form_pg_shdepend Form_pg_statistic Form_pg_statistic_ext -Form_pg_statistic_ext_data Form_pg_subscription Form_pg_subscription_rel Form_pg_tablespace -- 2.40.0