1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-17 06:41:09 +03:00

Initial pgindent and pgperltidy run for v14.

Also "make reformat-dat-files".

The only change worthy of note is that pgindent messed up the formatting
of launcher.c's struct LogicalRepWorkerId, which led me to notice that
that struct wasn't used at all anymore, so I just took it out.
This commit is contained in:
Tom Lane
2021-05-12 13:14:10 -04:00
parent e6ccd1ce16
commit def5b065ff
230 changed files with 2408 additions and 2125 deletions

View File

@ -617,11 +617,10 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
*
* We assume that VACUUM hasn't set pg_class.reltuples already, even
* during a VACUUM ANALYZE. Although VACUUM often updates pg_class,
* exceptions exist. A "VACUUM (ANALYZE, INDEX_CLEANUP OFF)" command
* will never update pg_class entries for index relations. It's also
* possible that an individual index's pg_class entry won't be updated
* during VACUUM if the index AM returns NULL from its amvacuumcleanup()
* routine.
* exceptions exist. A "VACUUM (ANALYZE, INDEX_CLEANUP OFF)" command will
* never update pg_class entries for index relations. It's also possible
* that an individual index's pg_class entry won't be updated during
* VACUUM if the index AM returns NULL from its amvacuumcleanup() routine.
*/
if (!inh)
{
@ -659,9 +658,9 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
else if (onerel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
{
/*
* Partitioned tables don't have storage, so we don't set any fields in
* their pg_class entries except for reltuples, which is necessary for
* auto-analyze to work properly.
* Partitioned tables don't have storage, so we don't set any fields
* in their pg_class entries except for reltuples, which is necessary
* for auto-analyze to work properly.
*/
vac_update_relstats(onerel, -1, totalrows,
0, false, InvalidTransactionId,

View File

@ -104,7 +104,7 @@ typedef struct CopyToStateData
typedef struct
{
DestReceiver pub; /* publicly-known function pointers */
CopyToState cstate; /* CopyToStateData for the command */
CopyToState cstate; /* CopyToStateData for the command */
uint64 processed; /* # of tuples processed */
} DR_copy;
@ -348,7 +348,7 @@ BeginCopyTo(ParseState *pstate,
List *attnamelist,
List *options)
{
CopyToState cstate;
CopyToState cstate;
bool pipe = (filename == NULL);
TupleDesc tupDesc;
int num_phys_attrs;
@ -415,7 +415,7 @@ BeginCopyTo(ParseState *pstate,
oldcontext = MemoryContextSwitchTo(cstate->copycontext);
/* Extract options from the statement node tree */
ProcessCopyOptions(pstate, &cstate->opts, false /* is_from */, options);
ProcessCopyOptions(pstate, &cstate->opts, false /* is_from */ , options);
/* Process the source/target relation or query */
if (rel)
@ -793,7 +793,7 @@ DoCopyTo(CopyToState cstate)
else
tupDesc = cstate->queryDesc->tupDesc;
num_phys_attrs = tupDesc->natts;
cstate->opts.null_print_client = cstate->opts.null_print; /* default */
cstate->opts.null_print_client = cstate->opts.null_print; /* default */
/* We use fe_msgbuf as a per-row buffer regardless of copy_dest */
cstate->fe_msgbuf = makeStringInfo();
@ -850,8 +850,8 @@ DoCopyTo(CopyToState cstate)
*/
if (cstate->need_transcoding)
cstate->opts.null_print_client = pg_server_to_any(cstate->opts.null_print,
cstate->opts.null_print_len,
cstate->file_encoding);
cstate->opts.null_print_len,
cstate->file_encoding);
/* if a header has been requested send the line */
if (cstate->opts.header_line)
@ -1265,7 +1265,7 @@ static bool
copy_dest_receive(TupleTableSlot *slot, DestReceiver *self)
{
DR_copy *myState = (DR_copy *) self;
CopyToState cstate = myState->cstate;
CopyToState cstate = myState->cstate;
/* Send the data */
CopyOneRowTo(cstate, slot);

View File

@ -167,7 +167,7 @@ ExplainQuery(ParseState *pstate, ExplainStmt *stmt,
ExplainState *es = NewExplainState();
TupOutputState *tstate;
JumbleState *jstate = NULL;
Query *query;
Query *query;
List *rewritten;
ListCell *lc;
bool timing_set = false;
@ -458,7 +458,7 @@ ExplainOneUtility(Node *utilityStmt, IntoClause *into, ExplainState *es,
else if (ctas->objtype == OBJECT_MATVIEW)
ExplainDummyGroup("CREATE MATERIALIZED VIEW", NULL, es);
else
elog(ERROR, "unexpected object type: %d",
elog(ERROR, "unexpected object type: %d",
(int) ctas->objtype);
return;
}
@ -612,7 +612,7 @@ ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es,
if (es->verbose && plannedstmt->queryId != UINT64CONST(0))
{
char buf[MAXINT8LEN+1];
char buf[MAXINT8LEN + 1];
pg_lltoa(plannedstmt->queryId, buf);
ExplainPropertyText("Query Identifier", buf, es);
@ -3298,7 +3298,7 @@ show_hashagg_info(AggState *aggstate, ExplainState *es)
if (aggstate->hash_batches_used > 1)
{
appendStringInfo(es->str, " Disk Usage: " UINT64_FORMAT "kB",
aggstate->hash_disk_used);
aggstate->hash_disk_used);
}
}

View File

@ -3293,8 +3293,8 @@ ExecAlterExtensionContentsStmt(AlterExtensionContentsStmt *stmt,
case OBJECT_SUBSCRIPTION:
case OBJECT_TABLESPACE:
ereport(ERROR,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("cannot add an object of this type to an extension")));
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("cannot add an object of this type to an extension")));
break;
default:
/* OK */

View File

@ -1086,9 +1086,9 @@ DefineIndex(Oid relationId,
ereport(DEBUG1,
(errmsg_internal("%s %s will create implicit index \"%s\" for table \"%s\"",
is_alter_table ? "ALTER TABLE / ADD" : "CREATE TABLE /",
constraint_type,
indexRelationName, RelationGetRelationName(rel))));
is_alter_table ? "ALTER TABLE / ADD" : "CREATE TABLE /",
constraint_type,
indexRelationName, RelationGetRelationName(rel))));
}
/*

View File

@ -628,7 +628,7 @@ AlterSubscription_refresh(Subscription *sub, bool copy_data)
InvalidXLogRecPtr);
ereport(DEBUG1,
(errmsg_internal("table \"%s.%s\" added to subscription \"%s\"",
rv->schemaname, rv->relname, sub->name)));
rv->schemaname, rv->relname, sub->name)));
}
}
@ -702,9 +702,9 @@ AlterSubscription_refresh(Subscription *sub, bool copy_data)
ereport(DEBUG1,
(errmsg_internal("table \"%s.%s\" removed from subscription \"%s\"",
get_namespace_name(get_rel_namespace(relid)),
get_rel_name(relid),
sub->name)));
get_namespace_name(get_rel_namespace(relid)),
get_rel_name(relid),
sub->name)));
}
}

View File

@ -563,7 +563,7 @@ static void ATExecGenericOptions(Relation rel, List *options);
static void ATExecSetRowSecurity(Relation rel, bool rls);
static void ATExecForceNoForceRowSecurity(Relation rel, bool force_rls);
static ObjectAddress ATExecSetCompression(AlteredTableInfo *tab, Relation rel,
const char *column, Node *newValue, LOCKMODE lockmode);
const char *column, Node *newValue, LOCKMODE lockmode);
static void index_copy_data(Relation rel, RelFileNode newrnode);
static const char *storage_name(char c);
@ -2593,7 +2593,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence,
if (CompressionMethodIsValid(attribute->attcompression))
{
const char *compression =
GetCompressionMethodName(attribute->attcompression);
GetCompressionMethodName(attribute->attcompression);
if (def->compression == NULL)
def->compression = pstrdup(compression);
@ -2641,7 +2641,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence,
def->location = -1;
if (CompressionMethodIsValid(attribute->attcompression))
def->compression = pstrdup(GetCompressionMethodName(
attribute->attcompression));
attribute->attcompression));
else
def->compression = NULL;
inhSchema = lappend(inhSchema, def);
@ -4524,7 +4524,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd,
/* No command-specific prep needed */
pass = AT_PASS_MISC;
break;
case AT_SetCompression: /* ALTER COLUMN SET COMPRESSION */
case AT_SetCompression: /* ALTER COLUMN SET COMPRESSION */
ATSimplePermissions(rel, ATT_TABLE | ATT_MATVIEW);
/* This command never recurses */
/* No command-specific prep needed */
@ -5666,11 +5666,11 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap, LOCKMODE lockmode)
if (newrel)
ereport(DEBUG1,
(errmsg_internal("rewriting table \"%s\"",
RelationGetRelationName(oldrel))));
RelationGetRelationName(oldrel))));
else
ereport(DEBUG1,
(errmsg_internal("verifying table \"%s\"",
RelationGetRelationName(oldrel))));
RelationGetRelationName(oldrel))));
if (newrel)
{
@ -7297,7 +7297,7 @@ NotNullImpliedByRelConstraints(Relation rel, Form_pg_attribute attr)
{
ereport(DEBUG1,
(errmsg_internal("existing constraints on column \"%s.%s\" are sufficient to prove that it does not contain nulls",
RelationGetRelationName(rel), NameStr(attr->attname))));
RelationGetRelationName(rel), NameStr(attr->attname))));
return true;
}
@ -12876,7 +12876,7 @@ ATPostAlterTypeParse(Oid oldId, Oid oldRelId, Oid refRelId, char *cmd,
}
else if (IsA(stm, CreateStatsStmt))
{
CreateStatsStmt *stmt = (CreateStatsStmt *) stm;
CreateStatsStmt *stmt = (CreateStatsStmt *) stm;
AlterTableCmd *newcmd;
/* keep the statistics object's comment */
@ -14539,9 +14539,9 @@ MergeAttributesIntoExisting(Relation child_rel, Relation parent_rel)
if (strcmp(child_expr, parent_expr) != 0)
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("column \"%s\" in child table has a conflicting generation expression",
attributeName)));
(errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("column \"%s\" in child table has a conflicting generation expression",
attributeName)));
}
/*
@ -14769,7 +14769,7 @@ static void
MarkInheritDetached(Relation child_rel, Relation parent_rel)
{
Relation catalogRelation;
SysScanDesc scan;
SysScanDesc scan;
ScanKeyData key;
HeapTuple inheritsTuple;
bool found = false;
@ -15645,7 +15645,7 @@ ATExecSetCompression(AlteredTableInfo *tab,
if (!IsStorageCompressible(typstorage))
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("column data type %s does not support compression",
errmsg("column data type %s does not support compression",
format_type_be(atttableform->atttypid))));
/* get the attribute compression method. */
@ -17010,11 +17010,11 @@ QueuePartitionConstraintValidation(List **wqueue, Relation scanrel,
if (!validate_default)
ereport(DEBUG1,
(errmsg_internal("partition constraint for table \"%s\" is implied by existing constraints",
RelationGetRelationName(scanrel))));
RelationGetRelationName(scanrel))));
else
ereport(DEBUG1,
(errmsg_internal("updated partition constraint for default partition \"%s\" is implied by existing constraints",
RelationGetRelationName(scanrel))));
RelationGetRelationName(scanrel))));
return;
}
@ -17745,8 +17745,8 @@ ATExecDetachPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
AccessExclusiveLock);
/*
* Check inheritance conditions and either delete the pg_inherits row
* (in non-concurrent mode) or just set the inhdetachpending flag.
* Check inheritance conditions and either delete the pg_inherits row (in
* non-concurrent mode) or just set the inhdetachpending flag.
*/
if (!concurrent)
RemoveInheritance(partRel, rel, false);
@ -17771,11 +17771,11 @@ ATExecDetachPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
*/
if (concurrent)
{
Oid partrelid,
parentrelid;
Oid partrelid,
parentrelid;
LOCKTAG tag;
char *parentrelname;
char *partrelname;
char *parentrelname;
char *partrelname;
/*
* Add a new constraint to the partition being detached, which
@ -17815,10 +17815,10 @@ ATExecDetachPartition(List **wqueue, AlteredTableInfo *tab, Relation rel,
StartTransactionCommand();
/*
* Now wait. This ensures that all queries that were planned including
* the partition are finished before we remove the rest of catalog
* entries. We don't need or indeed want to acquire this lock, though
* -- that would block later queries.
* Now wait. This ensures that all queries that were planned
* including the partition are finished before we remove the rest of
* catalog entries. We don't need or indeed want to acquire this
* lock, though -- that would block later queries.
*
* We don't need to concern ourselves with waiting for a lock on the
* partition itself, since we will acquire AccessExclusiveLock below.
@ -18046,7 +18046,7 @@ DetachPartitionFinalize(Relation rel, Relation partRel, bool concurrent,
static ObjectAddress
ATExecDetachPartitionFinalize(Relation rel, RangeVar *name)
{
Relation partRel;
Relation partRel;
ObjectAddress address;
Snapshot snap = GetActiveSnapshot();

View File

@ -4353,7 +4353,7 @@ GetAfterTriggersStoreSlot(AfterTriggersTableData *table,
/* Create it if not already done. */
if (!table->storeslot)
{
MemoryContext oldcxt;
MemoryContext oldcxt;
/*
* We only need this slot only until AfterTriggerEndQuery, but making

View File

@ -1569,7 +1569,7 @@ DefineRange(CreateRangeStmt *stmt)
/* Create the multirange that goes with it */
if (multirangeTypeName)
{
Oid old_typoid;
Oid old_typoid;
/*
* Look to see if multirange type already exists.
@ -1579,8 +1579,8 @@ DefineRange(CreateRangeStmt *stmt)
ObjectIdGetDatum(multirangeNamespace));
/*
* If it's not a shell, see if it's an autogenerated array type, and if so
* rename it out of the way.
* If it's not a shell, see if it's an autogenerated array type, and
* if so rename it out of the way.
*/
if (OidIsValid(old_typoid) && get_typisdefined(old_typoid))
{
@ -1600,7 +1600,7 @@ DefineRange(CreateRangeStmt *stmt)
mltrngaddress =
TypeCreate(multirangeOid, /* force assignment of this type OID */
multirangeTypeName, /* type name */
multirangeNamespace, /* namespace */
multirangeNamespace, /* namespace */
InvalidOid, /* relation oid (n/a here) */
0, /* relation kind (ditto) */
GetUserId(), /* owner's ID */
@ -1682,7 +1682,7 @@ DefineRange(CreateRangeStmt *stmt)
TypeCreate(multirangeArrayOid, /* force assignment of this type OID */
multirangeArrayName, /* type name */
multirangeNamespace, /* namespace */
multirangeNamespace, /* namespace */
InvalidOid, /* relation oid (n/a here) */
0, /* relation kind (ditto) */
GetUserId(), /* owner's ID */
@ -1844,7 +1844,7 @@ makeMultirangeConstructors(const char *name, Oid namespace,
PROKIND_FUNCTION,
false, /* security_definer */
false, /* leakproof */
true, /* isStrict */
true, /* isStrict */
PROVOLATILE_IMMUTABLE, /* volatility */
PROPARALLEL_SAFE, /* parallel safety */
argtypes, /* parameterTypes */
@ -1929,7 +1929,7 @@ makeMultirangeConstructors(const char *name, Oid namespace,
PROKIND_FUNCTION,
false, /* security_definer */
false, /* leakproof */
true, /* isStrict */
true, /* isStrict */
PROVOLATILE_IMMUTABLE, /* volatility */
PROPARALLEL_SAFE, /* parallel safety */
argtypes, /* parameterTypes */

View File

@ -1173,8 +1173,8 @@ vacuum_xid_failsafe_check(TransactionId relfrozenxid, MultiXactId relminmxid)
/*
* Similar to above, determine the index skipping age to use for
* multixact. In any case no less than autovacuum_multixact_freeze_max_age
* * 1.05.
* multixact. In any case no less than autovacuum_multixact_freeze_max_age *
* 1.05.
*/
skip_index_vacuum = Max(vacuum_multixact_failsafe_age,
autovacuum_multixact_freeze_max_age * 1.05);