1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Initial pgindent and pgperltidy run for v13.

Includes some manual cleanup of places that pgindent messed up,
most of which weren't per project style anyway.

Notably, it seems some people didn't absorb the style rules of
commit c9d297751, because there were a bunch of new occurrences
of function calls with a newline just after the left paren, all
with faulty expectations about how the rest of the call would get
indented.
This commit is contained in:
Tom Lane
2020-05-14 13:06:38 -04:00
parent 1255466f83
commit 5cbfce562f
198 changed files with 2019 additions and 1786 deletions

View File

@ -470,7 +470,7 @@ ExecAlterObjectDependsStmt(AlterObjectDependsStmt *stmt, ObjectAddress *refAddre
}
else
{
List *currexts;
List *currexts;
/* Avoid duplicates */
currexts = getAutoExtensionsOfObject(address.classId,

View File

@ -1947,11 +1947,11 @@ remove_dbtablespaces(Oid db_id)
Relation rel;
TableScanDesc scan;
HeapTuple tuple;
List *ltblspc = NIL;
ListCell *cell;
int ntblspc;
int i;
Oid *tablespace_ids;
List *ltblspc = NIL;
ListCell *cell;
int ntblspc;
int i;
Oid *tablespace_ids;
rel = table_open(TableSpaceRelationId, AccessShareLock);
scan = table_beginscan_catalog(rel, 0, NULL);

View File

@ -72,12 +72,6 @@ typedef struct EventTriggerQueryState
static EventTriggerQueryState *currentEventTriggerState = NULL;
typedef struct
{
const char *obtypename;
bool supported;
} event_trigger_support_data;
/* Support for dropped objects */
typedef struct SQLDropObject
{

View File

@ -2886,8 +2886,8 @@ show_incremental_sort_info(IncrementalSortState *incrsortstate,
* we don't need to do anything if there were 0 full groups.
*
* We still have to continue after this block if there are no full groups,
* though, since it's possible that we have workers that did real work even
* if the leader didn't participate.
* though, since it's possible that we have workers that did real work
* even if the leader didn't participate.
*/
if (fullsortGroupInfo->groupCount > 0)
{
@ -2914,8 +2914,8 @@ show_incremental_sort_info(IncrementalSortState *incrsortstate,
&incrsortstate->shared_info->sinfo[n];
/*
* If a worker hasn't processed any sort groups at all, then exclude
* it from output since it either didn't launch or didn't
* If a worker hasn't processed any sort groups at all, then
* exclude it from output since it either didn't launch or didn't
* contribute anything meaningful.
*/
fullsortGroupInfo = &incsort_info->fullsortGroupInfo;
@ -2923,8 +2923,8 @@ show_incremental_sort_info(IncrementalSortState *incrsortstate,
/*
* Since we never have any prefix groups unless we've first sorted
* a full groups and transitioned modes (copying the tuples into a
* prefix group), we don't need to do anything if there were 0 full
* groups.
* prefix group), we don't need to do anything if there were 0
* full groups.
*/
if (fullsortGroupInfo->groupCount == 0)
continue;
@ -3048,8 +3048,8 @@ show_hash_info(HashState *hashstate, ExplainState *es)
static void
show_hashagg_info(AggState *aggstate, ExplainState *es)
{
Agg *agg = (Agg *)aggstate->ss.ps.plan;
int64 memPeakKb = (aggstate->hash_mem_peak + 1023) / 1024;
Agg *agg = (Agg *) aggstate->ss.ps.plan;
int64 memPeakKb = (aggstate->hash_mem_peak + 1023) / 1024;
Assert(IsA(aggstate, AggState));

View File

@ -1402,39 +1402,39 @@ CreateExtensionInternal(char *extensionName,
* does what is needed, we try to find a sequence of update scripts that
* will get us there.
*/
filename = get_extension_script_filename(pcontrol, NULL, versionName);
if (stat(filename, &fst) == 0)
{
/* Easy, no extra scripts */
updateVersions = NIL;
}
else
{
/* Look for best way to install this version */
List *evi_list;
ExtensionVersionInfo *evi_start;
ExtensionVersionInfo *evi_target;
filename = get_extension_script_filename(pcontrol, NULL, versionName);
if (stat(filename, &fst) == 0)
{
/* Easy, no extra scripts */
updateVersions = NIL;
}
else
{
/* Look for best way to install this version */
List *evi_list;
ExtensionVersionInfo *evi_start;
ExtensionVersionInfo *evi_target;
/* Extract the version update graph from the script directory */
evi_list = get_ext_ver_list(pcontrol);
/* Extract the version update graph from the script directory */
evi_list = get_ext_ver_list(pcontrol);
/* Identify the target version */
evi_target = get_ext_ver_info(versionName, &evi_list);
/* Identify the target version */
evi_target = get_ext_ver_info(versionName, &evi_list);
/* Identify best path to reach target */
evi_start = find_install_path(evi_list, evi_target,
&updateVersions);
/* Identify best path to reach target */
evi_start = find_install_path(evi_list, evi_target,
&updateVersions);
/* Fail if no path ... */
if (evi_start == NULL)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("extension \"%s\" has no installation script nor update path for version \"%s\"",
pcontrol->name, versionName)));
/* Fail if no path ... */
if (evi_start == NULL)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("extension \"%s\" has no installation script nor update path for version \"%s\"",
pcontrol->name, versionName)));
/* Otherwise, install best starting point and then upgrade */
versionName = evi_start->name;
}
/* Otherwise, install best starting point and then upgrade */
versionName = evi_start->name;
}
/*
* Fetch control parameters for installation target version

View File

@ -1417,7 +1417,7 @@ CreateCast(CreateCastStmt *stmt)
char castmethod;
HeapTuple tuple;
AclResult aclresult;
ObjectAddress myself;
ObjectAddress myself;
sourcetypeid = typenameTypeId(NULL, stmt->sourcetype);
targettypeid = typenameTypeId(NULL, stmt->targettype);

View File

@ -338,7 +338,7 @@ DefineOpClass(CreateOpClassStmt *stmt)
opfamilyoid, /* oid of containing opfamily */
opclassoid; /* oid of opclass we create */
int maxOpNumber, /* amstrategies value */
optsProcNumber, /* amoptsprocnum value */
optsProcNumber, /* amoptsprocnum value */
maxProcNumber; /* amsupport value */
bool amstorage; /* amstorage flag */
List *operators; /* OpFamilyMember list for operators */
@ -779,7 +779,7 @@ AlterOpFamily(AlterOpFamilyStmt *stmt)
Oid amoid, /* our AM's oid */
opfamilyoid; /* oid of opfamily */
int maxOpNumber, /* amstrategies value */
optsProcNumber, /* amopclassopts value */
optsProcNumber, /* amopclassopts value */
maxProcNumber; /* amsupport value */
HeapTuple tup;
Form_pg_am amform;
@ -1252,6 +1252,7 @@ assignProcTypes(OpFamilyMember *member, Oid amoid, Oid typeoid,
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("btree equal image functions must return boolean")));
/*
* pg_amproc functions are indexed by (lefttype, righttype), but
* an equalimage function can only be called at CREATE INDEX time.

View File

@ -322,8 +322,8 @@ AlterPublicationOptions(AlterPublicationStmt *stmt, Relation rel,
* invalidate all partitions contained in the respective partition
* trees, not just those explicitly mentioned in the publication.
*/
List *relids = GetPublicationRelations(pubform->oid,
PUBLICATION_PART_ALL);
List *relids = GetPublicationRelations(pubform->oid,
PUBLICATION_PART_ALL);
/*
* We don't want to send too many individual messages, at some point
@ -380,8 +380,8 @@ AlterPublicationTables(AlterPublicationStmt *stmt, Relation rel,
PublicationDropTables(pubid, rels, false);
else /* DEFELEM_SET */
{
List *oldrelids = GetPublicationRelations(pubid,
PUBLICATION_PART_ROOT);
List *oldrelids = GetPublicationRelations(pubid,
PUBLICATION_PART_ROOT);
List *delrels = NIL;
ListCell *oldlc;

View File

@ -431,7 +431,7 @@ AlterStatistics(AlterStatsStmt *stmt)
Datum repl_val[Natts_pg_statistic_ext];
bool repl_null[Natts_pg_statistic_ext];
bool repl_repl[Natts_pg_statistic_ext];
ObjectAddress address;
ObjectAddress address;
int newtarget = stmt->stxstattarget;
/* Limit statistics target to a sane range */
@ -455,9 +455,9 @@ AlterStatistics(AlterStatsStmt *stmt)
stxoid = get_statistics_object_oid(stmt->defnames, stmt->missing_ok);
/*
* If we got here and the OID is not valid, it means the statistics
* does not exist, but the command specified IF EXISTS. So report
* this as a simple NOTICE and we're done.
* If we got here and the OID is not valid, it means the statistics does
* not exist, but the command specified IF EXISTS. So report this as a
* simple NOTICE and we're done.
*/
if (!OidIsValid(stxoid))
{

View File

@ -177,7 +177,7 @@ typedef struct AlteredTableInfo
List *changedIndexOids; /* OIDs of indexes to rebuild */
List *changedIndexDefs; /* string definitions of same */
char *replicaIdentityIndex; /* index to reset as REPLICA IDENTITY */
char *clusterOnIndex; /* index to use for CLUSTER */
char *clusterOnIndex; /* index to use for CLUSTER */
} AlteredTableInfo;
/* Struct describing one new constraint to check in Phase 3 scan */
@ -1265,9 +1265,9 @@ RemoveRelations(DropStmt *drop)
if (drop->concurrent)
{
/*
* Note that for temporary relations this lock may get upgraded
* later on, but as no other session can access a temporary
* relation, this is actually fine.
* Note that for temporary relations this lock may get upgraded later
* on, but as no other session can access a temporary relation, this
* is actually fine.
*/
lockmode = ShareUpdateExclusiveLock;
Assert(drop->removeType == OBJECT_INDEX);
@ -1620,10 +1620,10 @@ ExecuteTruncate(TruncateStmt *stmt)
}
/*
* Inherited TRUNCATE commands perform access
* permission checks on the parent table only.
* So we skip checking the children's permissions
* and don't call truncate_check_perms() here.
* Inherited TRUNCATE commands perform access permission
* checks on the parent table only. So we skip checking the
* children's permissions and don't call
* truncate_check_perms() here.
*/
truncate_check_rel(RelationGetRelid(rel), rel->rd_rel);
truncate_check_activity(rel);
@ -2650,6 +2650,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence,
errmsg("column \"%s\" inherits from generated column but specifies identity",
def->colname)));
}
/*
* If the parent column is not generated, then take whatever
* the child column definition says.
@ -7500,8 +7501,8 @@ ATExecSetStorage(Relation rel, const char *colName, Node *newValue, LOCKMODE loc
*/
foreach(lc, RelationGetIndexList(rel))
{
Oid indexoid = lfirst_oid(lc);
Relation indrel;
Oid indexoid = lfirst_oid(lc);
Relation indrel;
AttrNumber indattnum = 0;
indrel = index_open(indexoid, lockmode);
@ -16993,7 +16994,7 @@ static void
DropClonedTriggersFromPartition(Oid partitionId)
{
ScanKeyData skey;
SysScanDesc scan;
SysScanDesc scan;
HeapTuple trigtup;
Relation tgrel;
ObjectAddresses *objects;

View File

@ -2240,8 +2240,8 @@ ExecBRInsertTriggers(EState *estate, ResultRelInfo *relinfo,
/*
* After a tuple in a partition goes through a trigger, the user
* could have changed the partition key enough that the tuple
* no longer fits the partition. Verify that.
* could have changed the partition key enough that the tuple no
* longer fits the partition. Verify that.
*/
if (trigger->tgisclone &&
!ExecPartitionCheck(relinfo, slot, estate, false))