diff options
author | Tom Lane | 2017-06-21 19:18:54 +0000 |
---|---|---|
committer | Tom Lane | 2017-06-21 19:19:25 +0000 |
commit | c7b8998ebbf310a156aa38022555a24d98fdbfb4 (patch) | |
tree | e85979fb1213a731b7b557f8a830df541f26b135 /src/backend/commands | |
parent | f669c09989bda894d6ba01634ccb229f0687c08a (diff) |
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments
to the right of code, and remove pgindent hack that caused comments
following #endif to not obey the general rule.
Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using
the published version of pg_bsd_indent, but a hacked-up version that
tried to minimize the amount of movement of comments to the right of
code. The situation of interest is where such a comment has to be
moved to the right of its default placement at column 33 because there's
code there. BSD indent has always moved right in units of tab stops
in such cases --- but in the previous incarnation, indent was working
in 8-space tab stops, while now it knows we use 4-space tabs. So the
net result is that in about half the cases, such comments are placed
one tab stop left of before. This is better all around: it leaves
more room on the line for comment text, and it means that in such
cases the comment uniformly starts at the next 4-space tab stop after
the code, rather than sometimes one and sometimes two tabs after.
Also, ensure that comments following #endif are indented the same
as comments following other preprocessor commands such as #else.
That inconsistency turns out to have been self-inflicted damage
from a poorly-thought-through post-indent "fixup" in pgindent.
This patch is much less interesting than the first round of indent
changes, but also bulkier, so I thought it best to separate the effects.
Discussion: https://postgr.es/m/[email protected]
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/backend/commands')
25 files changed, 240 insertions, 243 deletions
diff --git a/src/backend/commands/aggregatecmds.c b/src/backend/commands/aggregatecmds.c index a84c61493f5..b204b19c72c 100644 --- a/src/backend/commands/aggregatecmds.c +++ b/src/backend/commands/aggregatecmds.c @@ -416,8 +416,8 @@ DefineAggregate(ParseState *pstate, List *name, List *args, bool oldstyle, List /* * Most of the argument-checking is done inside of AggregateCreate */ - return AggregateCreate(aggName, /* aggregate name */ - aggNamespace, /* namespace */ + return AggregateCreate(aggName, /* aggregate name */ + aggNamespace, /* namespace */ aggKind, numArgs, numDirectArgs, @@ -427,22 +427,22 @@ DefineAggregate(ParseState *pstate, List *name, List *args, bool oldstyle, List PointerGetDatum(parameterNames), parameterDefaults, variadicArgType, - transfuncName, /* step function name */ - finalfuncName, /* final function name */ - combinefuncName, /* combine function name */ - serialfuncName, /* serial function name */ + transfuncName, /* step function name */ + finalfuncName, /* final function name */ + combinefuncName, /* combine function name */ + serialfuncName, /* serial function name */ deserialfuncName, /* deserial function name */ - mtransfuncName, /* fwd trans function name */ + mtransfuncName, /* fwd trans function name */ minvtransfuncName, /* inv trans function name */ - mfinalfuncName, /* final function name */ + mfinalfuncName, /* final function name */ finalfuncExtraArgs, mfinalfuncExtraArgs, sortoperatorName, /* sort operator name */ transTypeId, /* transition data type */ transSpace, /* transition space */ - mtransTypeId, /* transition data type */ + mtransTypeId, /* transition data type */ mtransSpace, /* transition space */ - initval, /* initial condition */ + initval, /* initial condition */ minitval, /* initial condition */ - proparallel); /* parallel safe? */ + proparallel); /* parallel safe? */ } diff --git a/src/backend/commands/alter.c b/src/backend/commands/alter.c index 4d3fe8c745a..e5f0b75a86a 100644 --- a/src/backend/commands/alter.c +++ b/src/backend/commands/alter.c @@ -408,7 +408,7 @@ ExecRenameStmt(RenameStmt *stmt) default: elog(ERROR, "unrecognized rename stmt type: %d", (int) stmt->renameType); - return InvalidObjectAddress; /* keep compiler happy */ + return InvalidObjectAddress; /* keep compiler happy */ } } @@ -525,7 +525,7 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt, default: elog(ERROR, "unrecognized AlterObjectSchemaStmt type: %d", (int) stmt->objectType); - return InvalidObjectAddress; /* keep compiler happy */ + return InvalidObjectAddress; /* keep compiler happy */ } if (oldSchemaAddr) @@ -880,7 +880,7 @@ ExecAlterOwnerStmt(AlterOwnerStmt *stmt) default: elog(ERROR, "unrecognized AlterOwnerStmt type: %d", (int) stmt->objectType); - return InvalidObjectAddress; /* keep compiler happy */ + return InvalidObjectAddress; /* keep compiler happy */ } } diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index ecdd8950ee0..a19c6c25e61 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -452,7 +452,7 @@ do_analyze_rel(Relation onerel, int options, VacuumParams *params, /* Found an index expression */ Node *indexkey; - if (indexpr_item == NULL) /* shouldn't happen */ + if (indexpr_item == NULL) /* shouldn't happen */ elog(ERROR, "too few entries in indexprs list"); indexkey = (Node *) lfirst(indexpr_item); indexpr_item = lnext(indexpr_item); @@ -1545,7 +1545,7 @@ update_attstats(Oid relid, bool inh, int natts, VacAttrStats **vacattrstats) i = Anum_pg_statistic_stakind1 - 1; for (k = 0; k < STATISTIC_NUM_SLOTS; k++) { - values[i++] = Int16GetDatum(stats->stakind[k]); /* stakindN */ + values[i++] = Int16GetDatum(stats->stakind[k]); /* stakindN */ } i = Anum_pg_statistic_staop1 - 1; for (k = 0; k < STATISTIC_NUM_SLOTS; k++) @@ -1860,7 +1860,7 @@ compute_trivial_stats(VacAttrStatsP stats, stats->stawidth = total_width / (double) nonnull_cnt; else stats->stawidth = stats->attrtype->typlen; - stats->stadistinct = 0.0; /* "unknown" */ + stats->stadistinct = 0.0; /* "unknown" */ } else if (null_cnt > 0) { @@ -1871,7 +1871,7 @@ compute_trivial_stats(VacAttrStatsP stats, stats->stawidth = 0; /* "unknown" */ else stats->stawidth = stats->attrtype->typlen; - stats->stadistinct = 0.0; /* "unknown" */ + stats->stadistinct = 0.0; /* "unknown" */ } } @@ -2224,7 +2224,7 @@ compute_distinct_stats(VacAttrStatsP stats, stats->stawidth = 0; /* "unknown" */ else stats->stawidth = stats->attrtype->typlen; - stats->stadistinct = 0.0; /* "unknown" */ + stats->stadistinct = 0.0; /* "unknown" */ } /* We don't need to bother cleaning up any of our temporary palloc's */ @@ -2774,7 +2774,7 @@ compute_scalar_stats(VacAttrStatsP stats, stats->stawidth = 0; /* "unknown" */ else stats->stawidth = stats->attrtype->typlen; - stats->stadistinct = 0.0; /* "unknown" */ + stats->stadistinct = 0.0; /* "unknown" */ } /* We don't need to bother cleaning up any of our temporary palloc's */ diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c index 87b215d8d32..9befe0492ae 100644 --- a/src/backend/commands/async.c +++ b/src/backend/commands/async.c @@ -245,7 +245,7 @@ typedef struct AsyncQueueControl QueuePosition head; /* head points to the next free location */ QueuePosition tail; /* the global tail is equivalent to the pos of * the "slowest" backend */ - TimestampTz lastQueueFillWarn; /* time of last queue-full msg */ + TimestampTz lastQueueFillWarn; /* time of last queue-full msg */ QueueBackendStatus backend[FLEXIBLE_ARRAY_MEMBER]; /* backend[0] is not used; used entries are from [1] to [MaxBackends] */ } AsyncQueueControl; @@ -265,7 +265,7 @@ static SlruCtlData AsyncCtlData; #define AsyncCtl (&AsyncCtlData) #define QUEUE_PAGESIZE BLCKSZ -#define QUEUE_FULL_WARN_INTERVAL 5000 /* warn at most once every 5s */ +#define QUEUE_FULL_WARN_INTERVAL 5000 /* warn at most once every 5s */ /* * slru.c currently assumes that all filenames are four characters of hex @@ -291,7 +291,7 @@ static SlruCtlData AsyncCtlData; * (ie, have committed a LISTEN on). It is a simple list of channel names, * allocated in TopMemoryContext. */ -static List *listenChannels = NIL; /* list of C strings */ +static List *listenChannels = NIL; /* list of C strings */ /* * State for pending LISTEN/UNLISTEN actions consists of an ordered list of @@ -316,7 +316,7 @@ typedef struct char channel[FLEXIBLE_ARRAY_MEMBER]; /* nul-terminated string */ } ListenAction; -static List *pendingActions = NIL; /* list of ListenAction */ +static List *pendingActions = NIL; /* list of ListenAction */ static List *upperPendingActions = NIL; /* list of upper-xact lists */ @@ -342,9 +342,9 @@ typedef struct Notification char *payload; /* payload string (can be empty) */ } Notification; -static List *pendingNotifies = NIL; /* list of Notifications */ +static List *pendingNotifies = NIL; /* list of Notifications */ -static List *upperPendingNotifies = NIL; /* list of upper-xact lists */ +static List *upperPendingNotifies = NIL; /* list of upper-xact lists */ /* * Inbound notifications are initially processed by HandleNotifyInterrupt(), @@ -1184,7 +1184,7 @@ asyncQueueUnregister(void) { bool advanceTail; - Assert(listenChannels == NIL); /* else caller error */ + Assert(listenChannels == NIL); /* else caller error */ if (!amRegisteredListener) /* nothing to do */ return; @@ -1825,7 +1825,7 @@ asyncQueueReadAllNotifications(void) /* we only want to read as far as head */ copysize = QUEUE_POS_OFFSET(head) - curoffset; if (copysize < 0) - copysize = 0; /* just for safety */ + copysize = 0; /* just for safety */ } else { diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index ef1abf34abb..1cc53094268 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -325,7 +325,7 @@ cluster_rel(Oid tableOid, Oid indexOid, bool recheck, bool verbose) * Check that the index is still the one with indisclustered set. */ tuple = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexOid)); - if (!HeapTupleIsValid(tuple)) /* probably can't happen */ + if (!HeapTupleIsValid(tuple)) /* probably can't happen */ { relation_close(OldHeap, AccessExclusiveLock); return; diff --git a/src/backend/commands/collationcmds.c b/src/backend/commands/collationcmds.c index 91b65b174d3..e805b7cfc4b 100644 --- a/src/backend/commands/collationcmds.c +++ b/src/backend/commands/collationcmds.c @@ -417,7 +417,7 @@ get_icu_locale_comment(const char *localename) return result; } -#endif /* USE_ICU */ +#endif /* USE_ICU */ Datum @@ -552,7 +552,7 @@ pg_import_system_collations(PG_FUNCTION_ARGS) if (count == 0) ereport(WARNING, (errmsg("no usable system locales were found"))); -#endif /* not HAVE_LOCALE_T && not WIN32 */ +#endif /* not HAVE_LOCALE_T && not WIN32 */ #ifdef USE_ICU if (!is_encoding_supported_by_icu(GetDatabaseEncoding())) diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index ff32d041897..ec6011cdb85 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -102,7 +102,7 @@ typedef struct CopyStateData bool fe_eof; /* true if detected end of copy data */ EolType eol_type; /* EOL type of input */ int file_encoding; /* file or remote side's character encoding */ - bool need_transcoding; /* file encoding diff from server? */ + bool need_transcoding; /* file encoding diff from server? */ bool encoding_embeds_ascii; /* ASCII can be non-first byte? */ /* parameters from the COPY command */ @@ -119,17 +119,17 @@ typedef struct CopyStateData bool header_line; /* CSV header line? */ char *null_print; /* NULL marker string (server encoding!) */ int null_print_len; /* length of same */ - char *null_print_client; /* same converted to file encoding */ + char *null_print_client; /* same converted to file encoding */ char *delim; /* column delimiter (must be 1 byte) */ char *quote; /* CSV quote char (must be 1 byte) */ char *escape; /* CSV escape char (must be 1 byte) */ List *force_quote; /* list of column names */ bool force_quote_all; /* FORCE_QUOTE *? */ - bool *force_quote_flags; /* per-column CSV FQ flags */ + bool *force_quote_flags; /* per-column CSV FQ flags */ List *force_notnull; /* list of column names */ bool *force_notnull_flags; /* per-column CSV FNN flags */ List *force_null; /* list of column names */ - bool *force_null_flags; /* per-column CSV FN flags */ + bool *force_null_flags; /* per-column CSV FN flags */ bool convert_selectively; /* do selective binary conversion? */ List *convert_select; /* list of column names (can be NIL) */ bool *convert_select_flags; /* per-column CSV/TEXT CS flags */ @@ -162,7 +162,7 @@ typedef struct CopyStateData Oid *typioparams; /* array of element types for in_functions */ int *defmap; /* array of default att numbers */ ExprState **defexprs; /* array of default att expressions */ - bool volatile_defexprs; /* is any of defexprs volatile? */ + bool volatile_defexprs; /* is any of defexprs volatile? */ List *range_table; PartitionDispatch *partition_dispatch_info; @@ -195,7 +195,7 @@ typedef struct CopyStateData * can display it in error messages if appropriate. */ StringInfoData line_buf; - bool line_buf_converted; /* converted to server encoding? */ + bool line_buf_converted; /* converted to server encoding? */ bool line_buf_valid; /* contains the row being processed? */ /* @@ -355,10 +355,10 @@ SendCopyBegin(CopyState cstate) int i; pq_beginmessage(&buf, 'H'); - pq_sendbyte(&buf, format); /* overall format */ + pq_sendbyte(&buf, format); /* overall format */ pq_sendint(&buf, natts, 2); for (i = 0; i < natts; i++) - pq_sendint(&buf, format, 2); /* per-column formats */ + pq_sendint(&buf, format, 2); /* per-column formats */ pq_endmessage(&buf); cstate->copy_dest = COPY_NEW_FE; } @@ -388,10 +388,10 @@ ReceiveCopyBegin(CopyState cstate) int i; pq_beginmessage(&buf, 'G'); - pq_sendbyte(&buf, format); /* overall format */ + pq_sendbyte(&buf, format); /* overall format */ pq_sendint(&buf, natts, 2); for (i = 0; i < natts; i++) - pq_sendint(&buf, format, 2); /* per-column formats */ + pq_sendint(&buf, format, 2); /* per-column formats */ pq_endmessage(&buf); cstate->copy_dest = COPY_NEW_FE; cstate->fe_msgbuf = makeStringInfo(); @@ -609,20 +609,20 @@ CopyGetData(CopyState cstate, void *databuf, int minread, int maxread) RESUME_CANCEL_INTERRUPTS(); switch (mtype) { - case 'd': /* CopyData */ + case 'd': /* CopyData */ break; - case 'c': /* CopyDone */ + case 'c': /* CopyDone */ /* COPY IN correctly terminated by frontend */ cstate->fe_eof = true; return bytesread; - case 'f': /* CopyFail */ + case 'f': /* CopyFail */ ereport(ERROR, (errcode(ERRCODE_QUERY_CANCELED), errmsg("COPY from stdin failed: %s", pq_getmsgstring(cstate->fe_msgbuf)))); break; - case 'H': /* Flush */ - case 'S': /* Sync */ + case 'H': /* Flush */ + case 'S': /* Sync */ /* * Ignore Flush/Sync for the convenience of client @@ -1697,7 +1697,7 @@ BeginCopy(ParseState *pstate, /* See Multibyte encoding comment above */ cstate->encoding_embeds_ascii = PG_ENCODING_IS_CLIENT_ONLY(cstate->file_encoding); - cstate->copy_dest = COPY_FILE; /* default */ + cstate->copy_dest = COPY_FILE; /* default */ MemoryContextSwitchTo(oldcontext); @@ -1951,7 +1951,7 @@ CopyTo(CopyState cstate) tupDesc = cstate->queryDesc->tupDesc; attr = tupDesc->attrs; num_phys_attrs = tupDesc->natts; - cstate->null_print_client = cstate->null_print; /* default */ + cstate->null_print_client = cstate->null_print; /* default */ /* We use fe_msgbuf as a per-row buffer regardless of copy_dest */ cstate->fe_msgbuf = makeStringInfo(); @@ -3707,8 +3707,8 @@ CopyReadLineText(CopyState cstate) if (c == '\n') { - raw_buf_ptr++; /* eat newline */ - cstate->eol_type = EOL_CRNL; /* in case not set yet */ + raw_buf_ptr++; /* eat newline */ + cstate->eol_type = EOL_CRNL; /* in case not set yet */ } else { @@ -4458,7 +4458,7 @@ CopyAttributeOutText(CopyState cstate, char *string) break; /* All ASCII control chars are length 1 */ ptr++; - continue; /* fall to end of loop */ + continue; /* fall to end of loop */ } /* if we get here, we need to convert the control char */ DUMPSOFAR(); @@ -4518,7 +4518,7 @@ CopyAttributeOutText(CopyState cstate, char *string) break; /* All ASCII control chars are length 1 */ ptr++; - continue; /* fall to end of loop */ + continue; /* fall to end of loop */ } /* if we get here, we need to convert the control char */ DUMPSOFAR(); diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 11038f6764c..96ab6f23cd1 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -322,7 +322,7 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt) * won't change underneath us. */ if (!dbtemplate) - dbtemplate = "template1"; /* Default template database name */ + dbtemplate = "template1"; /* Default template database name */ if (!get_db_info(dbtemplate, ShareLock, &src_dboid, &src_owner, &src_encoding, @@ -1284,7 +1284,7 @@ movedb(const char *dbname, const char *tblspcname) sysscan = systable_beginscan(pgdbrel, DatabaseNameIndexId, true, NULL, 1, &scankey); oldtuple = systable_getnext(sysscan); - if (!HeapTupleIsValid(oldtuple)) /* shouldn't happen... */ + if (!HeapTupleIsValid(oldtuple)) /* shouldn't happen... */ ereport(ERROR, (errcode(ERRCODE_UNDEFINED_DATABASE), errmsg("database \"%s\" does not exist", dbname))); diff --git a/src/backend/commands/event_trigger.c b/src/backend/commands/event_trigger.c index 4cfab418a6f..48a63755599 100644 --- a/src/backend/commands/event_trigger.c +++ b/src/backend/commands/event_trigger.c @@ -57,8 +57,8 @@ typedef struct EventTriggerQueryState bool in_sql_drop; /* table_rewrite */ - Oid table_rewrite_oid; /* InvalidOid, or set for - * table_rewrite event */ + Oid table_rewrite_oid; /* InvalidOid, or set for table_rewrite + * event */ int table_rewrite_reason; /* AT_REWRITE reason */ /* Support for command collection */ diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c index 91f9cac7862..a40b5ec4de7 100644 --- a/src/backend/commands/extension.c +++ b/src/backend/commands/extension.c @@ -96,7 +96,7 @@ typedef struct ExtensionVersionInfo /* working state for Dijkstra's algorithm: */ bool distance_known; /* is distance from start known yet? */ int distance; /* current worst-case distance estimate */ - struct ExtensionVersionInfo *previous; /* current best predecessor */ + struct ExtensionVersionInfo *previous; /* current best predecessor */ } ExtensionVersionInfo; /* Local functions */ @@ -2387,7 +2387,7 @@ pg_extension_config_dump(PG_FUNCTION_ARGS) extTup = systable_getnext(extScan); - if (!HeapTupleIsValid(extTup)) /* should not happen */ + if (!HeapTupleIsValid(extTup)) /* should not happen */ elog(ERROR, "could not find tuple for extension %u", CurrentExtensionObject); @@ -2433,7 +2433,7 @@ pg_extension_config_dump(PG_FUNCTION_ARGS) { if (arrayData[i] == tableoid) { - arrayIndex = i + 1; /* replace this element instead */ + arrayIndex = i + 1; /* replace this element instead */ break; } } @@ -2535,7 +2535,7 @@ extension_config_remove(Oid extensionoid, Oid tableoid) extTup = systable_getnext(extScan); - if (!HeapTupleIsValid(extTup)) /* should not happen */ + if (!HeapTupleIsValid(extTup)) /* should not happen */ elog(ERROR, "could not find tuple for extension %u", extensionoid); @@ -2736,7 +2736,7 @@ AlterExtensionNamespace(const char *extensionName, const char *newschema, Oid *o extTup = systable_getnext(extScan); - if (!HeapTupleIsValid(extTup)) /* should not happen */ + if (!HeapTupleIsValid(extTup)) /* should not happen */ elog(ERROR, "could not find tuple for extension %u", extensionOid); @@ -2801,7 +2801,7 @@ AlterExtensionNamespace(const char *extensionName, const char *newschema, Oid *o dep.objectId = pg_depend->objid; dep.objectSubId = pg_depend->objsubid; - if (dep.objectSubId != 0) /* should not happen */ + if (dep.objectSubId != 0) /* should not happen */ elog(ERROR, "extension should not have a sub-object dependency"); /* Relocate the object */ diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index 2e26090bf99..1a165d5b0c2 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -201,7 +201,7 @@ interpret_function_parameter_list(ParseState *pstate, ListCell *x; int i; - *variadicArgType = InvalidOid; /* default result */ + *variadicArgType = InvalidOid; /* default result */ *requiredResultType = InvalidOid; /* default result */ inTypes = (Oid *) palloc(parameterCount * sizeof(Oid)); @@ -562,7 +562,7 @@ interpret_func_parallel(DefElem *defel) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("parameter \"parallel\" must be SAFE, RESTRICTED, or UNSAFE"))); - return PROPARALLEL_UNSAFE; /* keep compiler quiet */ + return PROPARALLEL_UNSAFE; /* keep compiler quiet */ } } @@ -1090,7 +1090,7 @@ CreateFunction(ParseState *pstate, CreateFunctionStmt *stmt) languageValidator, prosrc_str, /* converted to text later */ probin_str, /* converted to text later */ - false, /* not an aggregate */ + false, /* not an aggregate */ isWindowFunc, security, isLeakProof, @@ -1146,7 +1146,7 @@ RemoveFunctionById(Oid funcOid) relation = heap_open(AggregateRelationId, RowExclusiveLock); tup = SearchSysCache1(AGGFNOID, ObjectIdGetDatum(funcOid)); - if (!HeapTupleIsValid(tup)) /* should not happen */ + if (!HeapTupleIsValid(tup)) /* should not happen */ elog(ERROR, "cache lookup failed for pg_aggregate tuple for function %u", funcOid); CatalogTupleDelete(relation, &tup->t_self); @@ -1326,7 +1326,7 @@ SetFunctionReturnType(Oid funcOid, Oid newRetType) elog(ERROR, "cache lookup failed for function %u", funcOid); procForm = (Form_pg_proc) GETSTRUCT(tup); - if (procForm->prorettype != OPAQUEOID) /* caller messed up */ + if (procForm->prorettype != OPAQUEOID) /* caller messed up */ elog(ERROR, "function %u doesn't return OPAQUE", funcOid); /* okay to overwrite copied tuple */ diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index c0902794e98..e3f2dcfa8cc 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -645,7 +645,7 @@ DefineIndex(Oid relationId, else { elog(ERROR, "unknown constraint type"); - constraint_type = NULL; /* keep compiler quiet */ + constraint_type = NULL; /* keep compiler quiet */ } ereport(DEBUG1, @@ -909,7 +909,7 @@ DefineIndex(Oid relationId, newer_snapshots[k])) break; } - if (k >= n_newer_snapshots) /* not there anymore */ + if (k >= n_newer_snapshots) /* not there anymore */ SetInvalidVirtualTransactionId(old_snapshots[j]); } pfree(newer_snapshots); @@ -1704,9 +1704,9 @@ ChooseIndexColumnNames(List *indexElems) /* Get the preliminary name from the IndexElem */ if (ielem->indexcolname) - origname = ielem->indexcolname; /* caller-specified name */ + origname = ielem->indexcolname; /* caller-specified name */ else if (ielem->name) - origname = ielem->name; /* simple column reference */ + origname = ielem->name; /* simple column reference */ else origname = "expr"; /* default name for expression */ diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c index ab51d1a4178..512014438b0 100644 --- a/src/backend/commands/opclasscmds.c +++ b/src/backend/commands/opclasscmds.c @@ -856,7 +856,7 @@ AlterOpFamilyAdd(AlterOpFamilyStmt *stmt, Oid amoid, Oid opfamilyoid, ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("operator argument types must be specified in ALTER OPERATOR FAMILY"))); - operOid = InvalidOid; /* keep compiler quiet */ + operOid = InvalidOid; /* keep compiler quiet */ } if (item->order_family) diff --git a/src/backend/commands/operatorcmds.c b/src/backend/commands/operatorcmds.c index 739d5875eb6..c7e76766115 100644 --- a/src/backend/commands/operatorcmds.c +++ b/src/backend/commands/operatorcmds.c @@ -70,16 +70,16 @@ DefineOperator(List *names, List *parameters) char *oprName; Oid oprNamespace; AclResult aclresult; - bool canMerge = false; /* operator merges */ + bool canMerge = false; /* operator merges */ bool canHash = false; /* operator hashes */ - List *functionName = NIL; /* function for operator */ - TypeName *typeName1 = NULL; /* first type name */ - TypeName *typeName2 = NULL; /* second type name */ + List *functionName = NIL; /* function for operator */ + TypeName *typeName1 = NULL; /* first type name */ + TypeName *typeName2 = NULL; /* second type name */ Oid typeId1 = InvalidOid; /* types converted to OID */ Oid typeId2 = InvalidOid; Oid rettype; List *commutatorName = NIL; /* optional commutator operator name */ - List *negatorName = NIL; /* optional negator operator name */ + List *negatorName = NIL; /* optional negator operator name */ List *restrictionName = NIL; /* optional restrict. sel. procedure */ List *joinName = NIL; /* optional join sel. procedure */ Oid functionOid; /* functions converted to OID */ @@ -243,9 +243,9 @@ DefineOperator(List *names, List *parameters) oprNamespace, /* namespace */ typeId1, /* left type id */ typeId2, /* right type id */ - functionOid, /* function for operator */ + functionOid, /* function for operator */ commutatorName, /* optional commutator operator name */ - negatorName, /* optional negator operator name */ + negatorName, /* optional negator operator name */ restrictionOid, /* optional restrict. sel. procedure */ joinOid, /* optional join sel. procedure name */ canMerge, /* operator merges */ diff --git a/src/backend/commands/portalcmds.c b/src/backend/commands/portalcmds.c index 167910fcb5b..46369cf3dbe 100644 --- a/src/backend/commands/portalcmds.c +++ b/src/backend/commands/portalcmds.c @@ -403,7 +403,7 @@ PersistHoldablePortal(Portal portal) /* * Now shut down the inner executor. */ - portal->queryDesc = NULL; /* prevent double shutdown */ + portal->queryDesc = NULL; /* prevent double shutdown */ ExecutorFinish(queryDesc); ExecutorEnd(queryDesc); FreeQueryDesc(queryDesc); diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c index a4fbc05a122..4d555f1f5c7 100644 --- a/src/backend/commands/proclang.c +++ b/src/backend/commands/proclang.c @@ -161,18 +161,18 @@ CreateProceduralLanguage(CreatePLangStmt *stmt) { tmpAddr = ProcedureCreate(pltemplate->tmplinline, PG_CATALOG_NAMESPACE, - false, /* replace */ - false, /* returnsSet */ + false, /* replace */ + false, /* returnsSet */ VOIDOID, BOOTSTRAP_SUPERUSERID, ClanguageId, F_FMGR_C_VALIDATOR, pltemplate->tmplinline, pltemplate->tmpllibrary, - false, /* isAgg */ - false, /* isWindowFunc */ - false, /* security_definer */ - false, /* isLeakProof */ + false, /* isAgg */ + false, /* isWindowFunc */ + false, /* security_definer */ + false, /* isLeakProof */ true, /* isStrict */ PROVOLATILE_VOLATILE, PROPARALLEL_UNSAFE, @@ -204,18 +204,18 @@ CreateProceduralLanguage(CreatePLangStmt *stmt) { tmpAddr = ProcedureCreate(pltemplate->tmplvalidator, PG_CATALOG_NAMESPACE, - false, /* replace */ - false, /* returnsSet */ + false, /* replace */ + false, /* returnsSet */ VOIDOID, BOOTSTRAP_SUPERUSERID, ClanguageId, F_FMGR_C_VALIDATOR, pltemplate->tmplvalidator, pltemplate->tmpllibrary, - false, /* isAgg */ - false, /* isWindowFunc */ - false, /* security_definer */ - false, /* isLeakProof */ + false, /* isAgg */ + false, /* isWindowFunc */ + false, /* security_definer */ + false, /* isLeakProof */ true, /* isStrict */ PROVOLATILE_VOLATILE, PROPARALLEL_UNSAFE, @@ -533,7 +533,7 @@ DropProceduralLanguageById(Oid langOid) rel = heap_open(LanguageRelationId, RowExclusiveLock); langTup = SearchSysCache1(LANGOID, ObjectIdGetDatum(langOid)); - if (!HeapTupleIsValid(langTup)) /* should not happen */ + if (!HeapTupleIsValid(langTup)) /* should not happen */ elog(ERROR, "cache lookup failed for language %u", langOid); CatalogTupleDelete(rel, &langTup->t_self); diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 031bbc874de..58bda558379 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -611,7 +611,7 @@ nextval_internal(Oid relid, bool check_permissions) */ PreventCommandIfParallelMode("nextval()"); - if (elm->last != elm->cached) /* some numbers were cached */ + if (elm->last != elm->cached) /* some numbers were cached */ { Assert(elm->last_valid); Assert(elm->increment != 0); @@ -1455,7 +1455,7 @@ init_params(ParseState *pstate, List *options, bool for_identity, seqform->seqmax = PG_INT64_MAX; } else - seqform->seqmax = -1; /* descending seq */ + seqform->seqmax = -1; /* descending seq */ seqdataform->log_cnt = 0; } @@ -1532,9 +1532,9 @@ init_params(ParseState *pstate, List *options, bool for_identity, else if (isInit) { if (seqform->seqincrement > 0) - seqform->seqstart = seqform->seqmin; /* ascending seq */ + seqform->seqstart = seqform->seqmin; /* ascending seq */ else - seqform->seqstart = seqform->seqmax; /* descending seq */ + seqform->seqstart = seqform->seqmax; /* descending seq */ } /* crosscheck START */ diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 758c876ef3f..207241cb923 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -138,17 +138,17 @@ static List *on_commits = NIL; * a pass determined by subcommand type. */ -#define AT_PASS_UNSET -1 /* UNSET will cause ERROR */ -#define AT_PASS_DROP 0 /* DROP (all flavors) */ -#define AT_PASS_ALTER_TYPE 1 /* ALTER COLUMN TYPE */ -#define AT_PASS_OLD_INDEX 2 /* re-add existing indexes */ -#define AT_PASS_OLD_CONSTR 3 /* re-add existing constraints */ -#define AT_PASS_COL_ATTRS 4 /* set other column attributes */ +#define AT_PASS_UNSET -1 /* UNSET will cause ERROR */ +#define AT_PASS_DROP 0 /* DROP (all flavors) */ +#define AT_PASS_ALTER_TYPE 1 /* ALTER COLUMN TYPE */ +#define AT_PASS_OLD_INDEX 2 /* re-add existing indexes */ +#define AT_PASS_OLD_CONSTR 3 /* re-add existing constraints */ +#define AT_PASS_COL_ATTRS 4 /* set other column attributes */ /* We could support a RENAME COLUMN pass here, but not currently used */ -#define AT_PASS_ADD_COL 5 /* ADD COLUMN */ -#define AT_PASS_ADD_INDEX 6 /* ADD indexes */ -#define AT_PASS_ADD_CONSTR 7 /* ADD constraints, defaults */ -#define AT_PASS_MISC 8 /* other stuff */ +#define AT_PASS_ADD_COL 5 /* ADD COLUMN */ +#define AT_PASS_ADD_INDEX 6 /* ADD indexes */ +#define AT_PASS_ADD_CONSTR 7 /* ADD constraints, defaults */ +#define AT_PASS_MISC 8 /* other stuff */ #define AT_NUM_PASSES 9 typedef struct AlteredTableInfo @@ -166,13 +166,13 @@ typedef struct AlteredTableInfo int rewrite; /* Reason for forced rewrite, if any */ Oid newTableSpace; /* new tablespace; 0 means no change */ bool chgPersistence; /* T if SET LOGGED/UNLOGGED is used */ - char newrelpersistence; /* if above is true */ + char newrelpersistence; /* if above is true */ Expr *partition_constraint; /* for attach partition validation */ /* Objects to rebuild after completing ALTER TYPE operations */ List *changedConstraintOids; /* OIDs of constraints to rebuild */ List *changedConstraintDefs; /* string definitions of same */ - List *changedIndexOids; /* OIDs of indexes to rebuild */ - List *changedIndexDefs; /* string definitions of same */ + List *changedIndexOids; /* OIDs of indexes to rebuild */ + List *changedIndexDefs; /* string definitions of same */ } AlteredTableInfo; /* Struct describing one new constraint to check in Phase 3 scan */ @@ -701,13 +701,13 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, cooked = (CookedConstraint *) palloc(sizeof(CookedConstraint)); cooked->contype = CONSTR_DEFAULT; - cooked->conoid = InvalidOid; /* until created */ + cooked->conoid = InvalidOid; /* until created */ cooked->name = NULL; cooked->attnum = attnum; cooked->expr = colDef->cooked_default; cooked->skip_validation = false; cooked->is_local = true; /* not used for defaults */ - cooked->inhcount = 0; /* ditto */ + cooked->inhcount = 0; /* ditto */ cooked->is_no_inherit = false; cookedDefaults = lappend(cookedDefaults, cooked); descriptor->attrs[attnum - 1]->atthasdef = true; @@ -917,7 +917,7 @@ DropErrorMsgNonExistent(RangeVar *rel, char rightkind, bool missing_ok) } } - Assert(rentry->kind != '\0'); /* Should be impossible */ + Assert(rentry->kind != '\0'); /* Should be impossible */ } /* @@ -1629,7 +1629,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence, int parentsWithOids = 0; bool have_bogus_defaults = false; int child_attno; - static Node bogus_marker = {0}; /* marks conflicting defaults */ + static Node bogus_marker = {0}; /* marks conflicting defaults */ List *saved_schema = NIL; /* @@ -1688,8 +1688,8 @@ MergeAttributes(List *schema, List *supers, char relpersistence, while (rest != NULL) { ColumnDef *restdef = lfirst(rest); - ListCell *next = lnext(rest); /* need to save it in case we - * delete it */ + ListCell *next = lnext(rest); /* need to save it in case we + * delete it */ if (strcmp(coldef->colname, restdef->colname) == 0) { @@ -2012,7 +2012,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence, cooked = (CookedConstraint *) palloc(sizeof(CookedConstraint)); cooked->contype = CONSTR_CHECK; - cooked->conoid = InvalidOid; /* until created */ + cooked->conoid = InvalidOid; /* until created */ cooked->name = pstrdup(name); cooked->attnum = 0; /* not used for constraints */ cooked->expr = expr; @@ -2650,7 +2650,7 @@ renameatt_internal(Oid myrelid, heap_close(attrelation, RowExclusiveLock); - relation_close(targetrelation, NoLock); /* close rel but keep lock */ + relation_close(targetrelation, NoLock); /* close rel but keep lock */ return attnum; } @@ -2701,10 +2701,10 @@ renameatt(RenameStmt *stmt) attnum = renameatt_internal(relid, - stmt->subname, /* old att name */ - stmt->newname, /* new att name */ + stmt->subname, /* old att name */ + stmt->newname, /* new att name */ stmt->relation->inh, /* recursive? */ - false, /* recursing? */ + false, /* recursing? */ 0, /* expected inhcount */ stmt->behavior); @@ -2856,8 +2856,8 @@ RenameConstraint(RenameStmt *stmt) stmt->subname, stmt->newname, (stmt->relation && - stmt->relation->inh), /* recursive? */ - false, /* recursing? */ + stmt->relation->inh), /* recursive? */ + false, /* recursing? */ 0 /* expected inhcount */ ); } @@ -2933,7 +2933,7 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal) relrelation = heap_open(RelationRelationId, RowExclusiveLock); reltup = SearchSysCacheCopy1(RELOID, ObjectIdGetDatum(myrelid)); - if (!HeapTupleIsValid(reltup)) /* shouldn't happen */ + if (!HeapTupleIsValid(reltup)) /* shouldn't happen */ elog(ERROR, "cache lookup failed for relation %u", myrelid); relform = (Form_pg_class) GETSTRUCT(reltup); @@ -3175,7 +3175,7 @@ AlterTableGetLockLevel(List *cmds) */ case AT_AddColumn: /* may rewrite heap, in some cases and visible * to SELECT */ - case AT_SetTableSpace: /* must rewrite heap */ + case AT_SetTableSpace: /* must rewrite heap */ case AT_AlterColumnType: /* must rewrite heap */ case AT_AddOids: /* must rewrite heap */ cmd_lockmode = AccessExclusiveLock; @@ -3196,7 +3196,7 @@ AlterTableGetLockLevel(List *cmds) * Removing constraints can affect SELECTs that have been * optimised assuming the constraint holds true. */ - case AT_DropConstraint: /* as DROP INDEX */ + case AT_DropConstraint: /* as DROP INDEX */ case AT_DropNotNull: /* may change some SQL plans */ cmd_lockmode = AccessExclusiveLock; break; @@ -3264,8 +3264,8 @@ AlterTableGetLockLevel(List *cmds) break; case AT_AddConstraint: - case AT_ProcessedConstraint: /* becomes AT_AddConstraint */ - case AT_AddConstraintRecurse: /* becomes AT_AddConstraint */ + case AT_ProcessedConstraint: /* becomes AT_AddConstraint */ + case AT_AddConstraintRecurse: /* becomes AT_AddConstraint */ case AT_ReAddConstraint: /* becomes AT_AddConstraint */ if (IsA(cmd->def, Constraint)) { @@ -3345,11 +3345,11 @@ AlterTableGetLockLevel(List *cmds) * applies: we don't currently allow concurrent catalog * updates. */ - case AT_SetStatistics: /* Uses MVCC in getTableAttrs() */ + case AT_SetStatistics: /* Uses MVCC in getTableAttrs() */ case AT_ClusterOn: /* Uses MVCC in getIndexes() */ case AT_DropCluster: /* Uses MVCC in getIndexes() */ case AT_SetOptions: /* Uses MVCC in getTableAttrs() */ - case AT_ResetOptions: /* Uses MVCC in getTableAttrs() */ + case AT_ResetOptions: /* Uses MVCC in getTableAttrs() */ cmd_lockmode = ShareUpdateExclusiveLock; break; @@ -3368,8 +3368,8 @@ AlterTableGetLockLevel(List *cmds) * reasons these can all be used with ALTER TABLE, so we can't * decide between them using the basic grammar. */ - case AT_SetRelOptions: /* Uses MVCC in getIndexes() and - * getTables() */ + case AT_SetRelOptions: /* Uses MVCC in getIndexes() and + * getTables() */ case AT_ResetRelOptions: /* Uses MVCC in getIndexes() and * getTables() */ cmd_lockmode = AlterTableGetRelOptionsLockLevel((List *) cmd->def); @@ -3553,7 +3553,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, cmd->subtype = AT_AddConstraintRecurse; pass = AT_PASS_ADD_CONSTR; break; - case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */ + case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */ ATSimplePermissions(rel, ATT_TABLE); /* This command never recurses */ /* No command-specific prep needed */ @@ -3643,7 +3643,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, break; case AT_SetRelOptions: /* SET (...) */ case AT_ResetRelOptions: /* RESET (...) */ - case AT_ReplaceRelOptions: /* reset them all, then set just these */ + case AT_ReplaceRelOptions: /* reset them all, then set just these */ ATSimplePermissions(rel, ATT_TABLE | ATT_VIEW | ATT_MATVIEW | ATT_INDEX); /* This command never recurses */ /* No command-specific prep needed */ @@ -3665,7 +3665,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, ATSimplePermissions(rel, ATT_TABLE); pass = AT_PASS_MISC; break; - case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */ + case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */ ATSimplePermissions(rel, ATT_TABLE | ATT_FOREIGN_TABLE); /* Recursion occurs during execution phase */ /* No command-specific prep needed except saving recurse flag */ @@ -3719,7 +3719,7 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, default: /* oops */ elog(ERROR, "unrecognized alter table type: %d", (int) cmd->subtype); - pass = AT_PASS_UNSET; /* keep compiler quiet */ + pass = AT_PASS_UNSET; /* keep compiler quiet */ break; } Assert(pass > AT_PASS_UNSET); @@ -3856,7 +3856,7 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, cmd->behavior, false, false, cmd->missing_ok, lockmode); break; - case AT_DropColumnRecurse: /* DROP COLUMN with recursion */ + case AT_DropColumnRecurse: /* DROP COLUMN with recursion */ address = ATExecDropColumn(wqueue, rel, cmd->name, cmd->behavior, true, false, cmd->missing_ok, lockmode); @@ -3887,19 +3887,19 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, case AT_ReAddComment: /* Re-add existing comment */ address = CommentObject((CommentStmt *) cmd->def); break; - case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */ + case AT_AddIndexConstraint: /* ADD CONSTRAINT USING INDEX */ address = ATExecAddIndexConstraint(tab, rel, (IndexStmt *) cmd->def, lockmode); break; case AT_AlterConstraint: /* ALTER CONSTRAINT */ address = ATExecAlterConstraint(rel, cmd, false, false, lockmode); break; - case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */ + case AT_ValidateConstraint: /* VALIDATE CONSTRAINT */ address = ATExecValidateConstraint(rel, cmd->name, false, false, lockmode); break; - case AT_ValidateConstraintRecurse: /* VALIDATE CONSTRAINT with - * recursion */ + case AT_ValidateConstraintRecurse: /* VALIDATE CONSTRAINT with + * recursion */ address = ATExecValidateConstraint(rel, cmd->name, true, false, lockmode); break; @@ -3916,7 +3916,7 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, case AT_AlterColumnType: /* ALTER COLUMN TYPE */ address = ATExecAlterColumnType(tab, rel, cmd, lockmode); break; - case AT_AlterColumnGenericOptions: /* ALTER COLUMN OPTIONS */ + case AT_AlterColumnGenericOptions: /* ALTER COLUMN OPTIONS */ address = ATExecAlterColumnGenericOptions(rel, cmd->name, (List *) cmd->def, lockmode); @@ -3966,18 +3966,18 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, break; case AT_SetRelOptions: /* SET (...) */ case AT_ResetRelOptions: /* RESET (...) */ - case AT_ReplaceRelOptions: /* replace entire option list */ + case AT_ReplaceRelOptions: /* replace entire option list */ ATExecSetRelOptions(rel, (List *) cmd->def, cmd->subtype, lockmode); break; case AT_EnableTrig: /* ENABLE TRIGGER name */ ATExecEnableDisableTrigger(rel, cmd->name, TRIGGER_FIRES_ON_ORIGIN, false, lockmode); break; - case AT_EnableAlwaysTrig: /* ENABLE ALWAYS TRIGGER name */ + case AT_EnableAlwaysTrig: /* ENABLE ALWAYS TRIGGER name */ ATExecEnableDisableTrigger(rel, cmd->name, TRIGGER_FIRES_ALWAYS, false, lockmode); break; - case AT_EnableReplicaTrig: /* ENABLE REPLICA TRIGGER name */ + case AT_EnableReplicaTrig: /* ENABLE REPLICA TRIGGER name */ ATExecEnableDisableTrigger(rel, cmd->name, TRIGGER_FIRES_ON_REPLICA, false, lockmode); break; @@ -4006,11 +4006,11 @@ ATExecCmd(List **wqueue, AlteredTableInfo *tab, Relation rel, ATExecEnableDisableRule(rel, cmd->name, RULE_FIRES_ON_ORIGIN, lockmode); break; - case AT_EnableAlwaysRule: /* ENABLE ALWAYS RULE name */ + case AT_EnableAlwaysRule: /* ENABLE ALWAYS RULE name */ ATExecEnableDisableRule(rel, cmd->name, RULE_FIRES_ALWAYS, lockmode); break; - case AT_EnableReplicaRule: /* ENABLE REPLICA RULE name */ + case AT_EnableReplicaRule: /* ENABLE REPLICA RULE name */ ATExecEnableDisableRule(rel, cmd->name, RULE_FIRES_ON_REPLICA, lockmode); break; @@ -4330,7 +4330,7 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap, LOCKMODE lockmode) */ oldrel = heap_open(tab->relid, NoLock); oldTupDesc = tab->oldDesc; - newTupDesc = RelationGetDescr(oldrel); /* includes all mods */ + newTupDesc = RelationGetDescr(oldrel); /* includes all mods */ if (OidIsValid(OIDNewHeap)) newrel = heap_open(OIDNewHeap, lockmode); @@ -6540,12 +6540,12 @@ ATExecDropColumn(List **wqueue, Relation rel, const char *colName, CheckTableNotInUse(childrel, "ALTER TABLE"); tuple = SearchSysCacheCopyAttName(childrelid, colName); - if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ + if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ elog(ERROR, "cache lookup failed for attribute \"%s\" of relation %u", colName, childrelid); childatt = (Form_pg_attribute) GETSTRUCT(tuple); - if (childatt->attinhcount <= 0) /* shouldn't happen */ + if (childatt->attinhcount <= 0) /* shouldn't happen */ elog(ERROR, "relation %u has non-inherited attribute \"%s\"", childrelid, colName); @@ -6767,8 +6767,8 @@ ATExecAddIndexConstraint(AlteredTableInfo *tab, Relation rel, stmt->deferrable, stmt->initdeferred, stmt->primary, - true, /* update pg_index */ - true, /* remove old dependencies */ + true, /* update pg_index */ + true, /* remove old dependencies */ allowSystemTableMods, false); /* is_internal */ @@ -6889,8 +6889,8 @@ ATAddCheckConstraint(List **wqueue, AlteredTableInfo *tab, Relation rel, newcons = AddRelationNewConstraints(rel, NIL, list_make1(copyObject(constr)), recursing | is_readd, /* allow_merge */ - !recursing, /* is_local */ - is_readd); /* is_internal */ + !recursing, /* is_local */ + is_readd); /* is_internal */ /* we don't expect more than one constraint here */ Assert(list_length(newcons) <= 1); @@ -7337,8 +7337,7 @@ ATAddForeignKeyConstraint(AlteredTableInfo *tab, Relation rel, RelationGetRelid(rel), fkattnum, numfks, - InvalidOid, /* not a domain - * constraint */ + InvalidOid, /* not a domain constraint */ indexOid, RelationGetRelid(pkrel), pkattnum, @@ -7349,13 +7348,13 @@ ATAddForeignKeyConstraint(AlteredTableInfo *tab, Relation rel, fkconstraint->fk_upd_action, fkconstraint->fk_del_action, fkconstraint->fk_matchtype, - NULL, /* no exclusion constraint */ - NULL, /* no check constraint */ + NULL, /* no exclusion constraint */ + NULL, /* no check constraint */ NULL, NULL, - true, /* islocal */ - 0, /* inhcount */ - true, /* isnoinherit */ + true, /* islocal */ + 0, /* inhcount */ + true, /* isnoinherit */ false); /* is_internal */ ObjectAddressSet(address, ConstraintRelationId, constrOid); @@ -8607,7 +8606,7 @@ ATExecDropConstraint(Relation rel, const char *constrName, con = (Form_pg_constraint) GETSTRUCT(copy_tuple); - if (con->coninhcount <= 0) /* shouldn't happen */ + if (con->coninhcount <= 0) /* shouldn't happen */ elog(ERROR, "relation %u has non-inherited constraint \"%s\"", childrelid, constrName); @@ -8965,7 +8964,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel, /* Look up the target column */ heapTup = SearchSysCacheCopyAttName(RelationGetRelid(rel), colName); - if (!HeapTupleIsValid(heapTup)) /* shouldn't happen */ + if (!HeapTupleIsValid(heapTup)) /* shouldn't happen */ ereport(ERROR, (errcode(ERRCODE_UNDEFINED_COLUMN), errmsg("column \"%s\" of relation \"%s\" does not exist", @@ -9005,7 +9004,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel, defaultexpr = build_column_default(rel, attnum); Assert(defaultexpr); defaultexpr = strip_implicit_coercions(defaultexpr); - defaultexpr = coerce_to_target_type(NULL, /* no UNKNOWN params */ + defaultexpr = coerce_to_target_type(NULL, /* no UNKNOWN params */ defaultexpr, exprType(defaultexpr), targettype, targettypmod, COERCION_ASSIGNMENT, @@ -9500,7 +9499,7 @@ ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab, LOCKMODE lockmode) bool conislocal; tup = SearchSysCache1(CONSTROID, ObjectIdGetDatum(oldId)); - if (!HeapTupleIsValid(tup)) /* should not happen */ + if (!HeapTupleIsValid(tup)) /* should not happen */ elog(ERROR, "cache lookup failed for constraint %u", oldId); con = (Form_pg_constraint) GETSTRUCT(tup); relid = con->conrelid; @@ -11647,7 +11646,7 @@ RemoveInheritance(Relation child_rel, Relation parent_rel) HeapTuple copyTuple = heap_copytuple(constraintTuple); Form_pg_constraint copy_con = (Form_pg_constraint) GETSTRUCT(copyTuple); - if (copy_con->coninhcount <= 0) /* shouldn't happen */ + if (copy_con->coninhcount <= 0) /* shouldn't happen */ elog(ERROR, "relation %u has non-inherited constraint \"%s\"", RelationGetRelid(child_rel), NameStr(copy_con->conname)); @@ -12836,7 +12835,7 @@ PreCommit_on_commit_actions(void) if (oids_to_truncate != NIL) { heap_truncate(oids_to_truncate); - CommandCounterIncrement(); /* XXX needed? */ + CommandCounterIncrement(); /* XXX needed? */ } } @@ -12979,7 +12978,7 @@ RangeVarCallbackOwnsRelation(const RangeVar *relation, return; tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relId)); - if (!HeapTupleIsValid(tuple)) /* should not happen */ + if (!HeapTupleIsValid(tuple)) /* should not happen */ elog(ERROR, "cache lookup failed for relation %u", relId); if (!pg_class_ownercheck(relId, GetUserId())) diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c index f9c26201d98..03bf06012ad 100644 --- a/src/backend/commands/tablespace.c +++ b/src/backend/commands/tablespace.c @@ -388,7 +388,7 @@ CreateTableSpace(CreateTableSpaceStmt *stmt) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("tablespaces are not supported on this platform"))); return InvalidOid; /* keep compiler quiet */ -#endif /* HAVE_SYMLINK */ +#endif /* HAVE_SYMLINK */ } /* @@ -549,7 +549,7 @@ DropTableSpace(DropTableSpaceStmt *stmt) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("tablespaces are not supported on this platform"))); -#endif /* HAVE_SYMLINK */ +#endif /* HAVE_SYMLINK */ } diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index d7ed71f7675..191f27651c1 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -593,11 +593,11 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString, stmt->initdeferred, true, RelationGetRelid(rel), - NULL, /* no conkey */ + NULL, /* no conkey */ 0, - InvalidOid, /* no domain */ - InvalidOid, /* no index */ - InvalidOid, /* no foreign key */ + InvalidOid, /* no domain */ + InvalidOid, /* no index */ + InvalidOid, /* no foreign key */ NULL, NULL, NULL, @@ -606,14 +606,14 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString, ' ', ' ', ' ', - NULL, /* no exclusion */ - NULL, /* no check constraint */ + NULL, /* no exclusion */ + NULL, /* no check constraint */ NULL, NULL, - true, /* islocal */ - 0, /* inhcount */ - true, /* isnoinherit */ - isInternal); /* is_internal */ + true, /* islocal */ + 0, /* inhcount */ + true, /* isnoinherit */ + isInternal); /* is_internal */ } /* @@ -2026,7 +2026,7 @@ equalTriggerDescs(TriggerDesc *trigdesc1, TriggerDesc *trigdesc2) return false; return true; } -#endif /* NOT_USED */ +#endif /* NOT_USED */ /* * Call a trigger function. @@ -3255,8 +3255,7 @@ typedef SetConstraintStateData *SetConstraintState; */ typedef uint32 TriggerFlags; -#define AFTER_TRIGGER_OFFSET 0x0FFFFFFF /* must be low-order - * bits */ +#define AFTER_TRIGGER_OFFSET 0x0FFFFFFF /* must be low-order bits */ #define AFTER_TRIGGER_DONE 0x10000000 #define AFTER_TRIGGER_IN_PROGRESS 0x20000000 /* bits describing the size and tuple sources of this event */ @@ -3317,7 +3316,7 @@ typedef struct AfterTriggerEventDataZeroCtids */ typedef struct AfterTriggerEventChunk { - struct AfterTriggerEventChunk *next; /* list link */ + struct AfterTriggerEventChunk *next; /* list link */ char *freeptr; /* start of free space in chunk */ char *endfree; /* end of free space in chunk */ char *endptr; /* end of chunk */ @@ -3409,7 +3408,7 @@ typedef struct AfterTriggersData { CommandId firing_counter; /* next firing ID to assign */ SetConstraintState state; /* the active S C state */ - AfterTriggerEventList events; /* deferred-event list */ + AfterTriggerEventList events; /* deferred-event list */ int query_depth; /* current query list index */ AfterTriggerEventList *query_stack; /* events pending from each query */ Tuplestorestate **fdw_tuplestores; /* foreign tuples for one row from @@ -3422,7 +3421,7 @@ typedef struct AfterTriggersData /* these fields are just for resetting at subtrans abort: */ SetConstraintState *state_stack; /* stacked S C states */ - AfterTriggerEventList *events_stack; /* stacked list pointers */ + AfterTriggerEventList *events_stack; /* stacked list pointers */ int *depth_stack; /* stacked query_depths */ CommandId *firing_stack; /* stacked firing_counters */ int maxtransdepth; /* allocated len of above arrays */ @@ -4058,7 +4057,7 @@ afterTriggerInvokeEvents(AfterTriggerEventList *events, slot1 = MakeSingleTupleTableSlot(rel->rd_att); slot2 = MakeSingleTupleTableSlot(rel->rd_att); } - if (trigdesc == NULL) /* should not happen */ + if (trigdesc == NULL) /* should not happen */ elog(ERROR, "relation %u has no triggers", evtshared->ats_relid); } @@ -4132,7 +4131,7 @@ AfterTriggerBeginXact(void) /* * Initialize after-trigger state structure to empty */ - afterTriggers.firing_counter = (CommandId) 1; /* mustn't be 0 */ + afterTriggers.firing_counter = (CommandId) 1; /* mustn't be 0 */ afterTriggers.query_depth = -1; /* diff --git a/src/backend/commands/tsearchcmds.c b/src/backend/commands/tsearchcmds.c index dfb95a1ed35..cb212fdf68d 100644 --- a/src/backend/commands/tsearchcmds.c +++ b/src/backend/commands/tsearchcmds.c @@ -1561,7 +1561,7 @@ serialize_deflist(List *deflist) List * deserialize_deflist(Datum txt) { - text *in = DatumGetTextPP(txt); /* in case it's toasted */ + text *in = DatumGetTextPP(txt); /* in case it's toasted */ List *result = NIL; int len = VARSIZE_ANY_EXHDR(in); char *ptr, @@ -1582,7 +1582,7 @@ deserialize_deflist(Datum txt) } ds_state; ds_state state = CS_WAITKEY; - workspace = (char *) palloc(len + 1); /* certainly enough room */ + workspace = (char *) palloc(len + 1); /* certainly enough room */ ptr = VARDATA_ANY(in); endptr = ptr + len; for (; ptr < endptr; ptr++) diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c index e7ecc4ed7e5..4e083eb3456 100644 --- a/src/backend/commands/typecmds.c +++ b/src/backend/commands/typecmds.c @@ -606,11 +606,11 @@ DefineType(ParseState *pstate, List *names, List *parameters) address = TypeCreate(InvalidOid, /* no predetermined type OID */ typeName, /* type name */ - typeNamespace, /* namespace */ + typeNamespace, /* namespace */ InvalidOid, /* relation oid (n/a here) */ 0, /* relation kind (ditto) */ GetUserId(), /* owner's ID */ - internalLength, /* internal size */ + internalLength, /* internal size */ TYPTYPE_BASE, /* type-type (base type) */ category, /* type-category */ preferred, /* is it a preferred type? */ @@ -653,7 +653,7 @@ DefineType(ParseState *pstate, List *names, List *parameters) GetUserId(), /* owner's ID */ -1, /* internal size (always varlena) */ TYPTYPE_BASE, /* type-type (base type) */ - TYPCATEGORY_ARRAY, /* type-category (array) */ + TYPCATEGORY_ARRAY, /* type-category (array) */ false, /* array types are never preferred */ delimiter, /* array element delimiter */ F_ARRAY_IN, /* input procedure */ @@ -662,7 +662,7 @@ DefineType(ParseState *pstate, List *names, List *parameters) F_ARRAY_SEND, /* send procedure */ typmodinOid, /* typmodin procedure */ typmodoutOid, /* typmodout procedure */ - F_ARRAY_TYPANALYZE, /* analyze procedure */ + F_ARRAY_TYPANALYZE, /* analyze procedure */ typoid, /* element type ID */ true, /* yes this is an array type */ InvalidOid, /* no further array type */ @@ -1033,19 +1033,19 @@ DefineDomain(CreateDomainStmt *stmt) address = TypeCreate(InvalidOid, /* no predetermined type OID */ domainName, /* type name */ - domainNamespace, /* namespace */ + domainNamespace, /* namespace */ InvalidOid, /* relation oid (n/a here) */ 0, /* relation kind (ditto) */ GetUserId(), /* owner's ID */ - internalLength, /* internal size */ - TYPTYPE_DOMAIN, /* type-type (domain type) */ + internalLength, /* internal size */ + TYPTYPE_DOMAIN, /* type-type (domain type) */ category, /* type-category */ false, /* domain types are never preferred */ delimiter, /* array element delimiter */ - inputProcedure, /* input procedure */ - outputProcedure, /* output procedure */ + inputProcedure, /* input procedure */ + outputProcedure, /* output procedure */ receiveProcedure, /* receive procedure */ - sendProcedure, /* send procedure */ + sendProcedure, /* send procedure */ InvalidOid, /* typmodin procedure - none */ InvalidOid, /* typmodout procedure - none */ analyzeProcedure, /* analyze procedure */ @@ -1054,7 +1054,7 @@ DefineDomain(CreateDomainStmt *stmt) InvalidOid, /* no arrays for domains (yet) */ basetypeoid, /* base type ID */ defaultValue, /* default type value (text) */ - defaultValueBin, /* default type value (binary) */ + defaultValueBin, /* default type value (binary) */ byValue, /* passed by value */ alignment, /* required alignment */ storage, /* TOAST strategy */ @@ -1145,7 +1145,7 @@ DefineEnum(CreateEnumStmt *stmt) enumTypeAddr = TypeCreate(InvalidOid, /* no predetermined type OID */ enumName, /* type name */ - enumNamespace, /* namespace */ + enumNamespace, /* namespace */ InvalidOid, /* relation oid (n/a here) */ 0, /* relation kind (ditto) */ GetUserId(), /* owner's ID */ @@ -1191,7 +1191,7 @@ DefineEnum(CreateEnumStmt *stmt) GetUserId(), /* owner's ID */ -1, /* internal size (always varlena) */ TYPTYPE_BASE, /* type-type (base type) */ - TYPCATEGORY_ARRAY, /* type-category (array) */ + TYPCATEGORY_ARRAY, /* type-category (array) */ false, /* array types are never preferred */ DEFAULT_TYPDELIM, /* array element delimiter */ F_ARRAY_IN, /* input procedure */ @@ -1200,7 +1200,7 @@ DefineEnum(CreateEnumStmt *stmt) F_ARRAY_SEND, /* send procedure */ InvalidOid, /* typmodin procedure - none */ InvalidOid, /* typmodout procedure - none */ - F_ARRAY_TYPANALYZE, /* analyze procedure */ + F_ARRAY_TYPANALYZE, /* analyze procedure */ enumTypeAddr.objectId, /* element type ID */ true, /* yes this is an array type */ InvalidOid, /* no further array type */ @@ -1473,12 +1473,12 @@ DefineRange(CreateRangeStmt *stmt) address = TypeCreate(InvalidOid, /* no predetermined type OID */ typeName, /* type name */ - typeNamespace, /* namespace */ + typeNamespace, /* namespace */ InvalidOid, /* relation oid (n/a here) */ 0, /* relation kind (ditto) */ GetUserId(), /* owner's ID */ -1, /* internal size (always varlena) */ - TYPTYPE_RANGE, /* type-type (range type) */ + TYPTYPE_RANGE, /* type-type (range type) */ TYPCATEGORY_RANGE, /* type-category (range type) */ false, /* range types are never preferred */ DEFAULT_TYPDELIM, /* array element delimiter */ @@ -1491,7 +1491,7 @@ DefineRange(CreateRangeStmt *stmt) F_RANGE_TYPANALYZE, /* analyze procedure */ InvalidOid, /* element type ID - none */ false, /* this is not an array type */ - rangeArrayOid, /* array type we are about to create */ + rangeArrayOid, /* array type we are about to create */ InvalidOid, /* base type ID (only for domains) */ NULL, /* never a default type value */ NULL, /* no binary form available either */ @@ -1521,7 +1521,7 @@ DefineRange(CreateRangeStmt *stmt) GetUserId(), /* owner's ID */ -1, /* internal size (always varlena) */ TYPTYPE_BASE, /* type-type (base type) */ - TYPCATEGORY_ARRAY, /* type-category (array) */ + TYPCATEGORY_ARRAY, /* type-category (array) */ false, /* array types are never preferred */ DEFAULT_TYPDELIM, /* array element delimiter */ F_ARRAY_IN, /* input procedure */ @@ -1530,7 +1530,7 @@ DefineRange(CreateRangeStmt *stmt) F_ARRAY_SEND, /* send procedure */ InvalidOid, /* typmodin procedure - none */ InvalidOid, /* typmodout procedure - none */ - F_ARRAY_TYPANALYZE, /* analyze procedure */ + F_ARRAY_TYPANALYZE, /* analyze procedure */ typoid, /* element type ID */ true, /* yes this is an array type */ InvalidOid, /* no further array type */ @@ -1591,14 +1591,14 @@ makeRangeConstructors(const char *name, Oid namespace, pronargs[i]); myself = ProcedureCreate(name, /* name: same as range type */ - namespace, /* namespace */ + namespace, /* namespace */ false, /* replace */ false, /* returns set */ - rangeOid, /* return type */ + rangeOid, /* return type */ BOOTSTRAP_SUPERUSERID, /* proowner */ INTERNALlanguageId, /* language */ - F_FMGR_INTERNAL_VALIDATOR, /* language validator */ - prosrc[i], /* prosrc */ + F_FMGR_INTERNAL_VALIDATOR, /* language validator */ + prosrc[i], /* prosrc */ NULL, /* probin */ false, /* isAgg */ false, /* isWindowFunc */ @@ -1606,8 +1606,8 @@ makeRangeConstructors(const char *name, Oid namespace, false, /* leakproof */ false, /* isStrict */ PROVOLATILE_IMMUTABLE, /* volatility */ - PROPARALLEL_SAFE, /* parallel safety */ - constructorArgTypesVector, /* parameterTypes */ + PROPARALLEL_SAFE, /* parallel safety */ + constructorArgTypesVector, /* parameterTypes */ PointerGetDatum(NULL), /* allParameterTypes */ PointerGetDatum(NULL), /* parameterModes */ PointerGetDatum(NULL), /* parameterNames */ @@ -2131,7 +2131,7 @@ AlterDomainDefault(List *names, Node *defaultRaw) ParseState *pstate; Relation rel; char *defaultValue; - Node *defaultExpr = NULL; /* NULL if no default specified */ + Node *defaultExpr = NULL; /* NULL if no default specified */ Datum new_record[Natts_pg_type]; bool new_record_nulls[Natts_pg_type]; bool new_record_repl[Natts_pg_type]; @@ -2226,7 +2226,7 @@ AlterDomainDefault(List *names, Node *defaultRaw) /* Rebuild dependencies */ GenerateTypeDependencies(typTup->typnamespace, domainoid, - InvalidOid, /* typrelid is n/a */ + InvalidOid, /* typrelid is n/a */ 0, /* relation kind is n/a */ typTup->typowner, typTup->typinput, @@ -2237,11 +2237,11 @@ AlterDomainDefault(List *names, Node *defaultRaw) typTup->typmodout, typTup->typanalyze, InvalidOid, - false, /* a domain isn't an implicit array */ + false, /* a domain isn't an implicit array */ typTup->typbasetype, typTup->typcollation, defaultExpr, - true); /* Rebuild is true */ + true); /* Rebuild is true */ InvokeObjectPostAlterHook(TypeRelationId, domainoid, 0); @@ -3065,12 +3065,12 @@ domainAddConstraint(Oid domainOid, Oid domainNamespace, Oid baseTypeOid, false, /* Is Deferrable */ false, /* Is Deferred */ !constr->skip_validation, /* Is Validated */ - InvalidOid, /* not a relation constraint */ + InvalidOid, /* not a relation constraint */ NULL, 0, - domainOid, /* domain constraint */ - InvalidOid, /* no associated index */ - InvalidOid, /* Foreign key fields */ + domainOid, /* domain constraint */ + InvalidOid, /* no associated index */ + InvalidOid, /* Foreign key fields */ NULL, NULL, NULL, @@ -3079,11 +3079,11 @@ domainAddConstraint(Oid domainOid, Oid domainNamespace, Oid baseTypeOid, ' ', ' ', ' ', - NULL, /* not an exclusion constraint */ - expr, /* Tree form of check constraint */ + NULL, /* not an exclusion constraint */ + expr, /* Tree form of check constraint */ ccbin, /* Binary form of check constraint */ ccsrc, /* Source form of check constraint */ - true, /* is local */ + true, /* is local */ 0, /* inhcount */ false, /* connoinherit */ false); /* is_internal */ diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index 10d6ba9e04c..24608c27c33 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -82,18 +82,17 @@ CreateRole(ParseState *pstate, CreateRoleStmt *stmt) char *password = NULL; /* user password */ bool issuper = false; /* Make the user a superuser? */ bool inherit = true; /* Auto inherit privileges? */ - bool createrole = false; /* Can this user create roles? */ - bool createdb = false; /* Can the user create databases? */ - bool canlogin = false; /* Can this user login? */ + bool createrole = false; /* Can this user create roles? */ + bool createdb = false; /* Can the user create databases? */ + bool canlogin = false; /* Can this user login? */ bool isreplication = false; /* Is this a replication role? */ - bool bypassrls = false; /* Is this a row security enabled - * role? */ + bool bypassrls = false; /* Is this a row security enabled role? */ int connlimit = -1; /* maximum connections allowed */ List *addroleto = NIL; /* roles to make this a member of */ - List *rolemembers = NIL; /* roles to be members of this role */ - List *adminmembers = NIL; /* roles to be admins of this role */ - char *validUntil = NULL; /* time the login is valid until */ - Datum validUntil_datum; /* same, as timestamptz Datum */ + List *rolemembers = NIL; /* roles to be members of this role */ + List *adminmembers = NIL; /* roles to be admins of this role */ + char *validUntil = NULL; /* time the login is valid until */ + Datum validUntil_datum; /* same, as timestamptz Datum */ bool validUntil_null; DefElem *dpassword = NULL; DefElem *dissuper = NULL; @@ -497,11 +496,11 @@ AlterRole(AlterRoleStmt *stmt) int createrole = -1; /* Can this user create roles? */ int createdb = -1; /* Can the user create databases? */ int canlogin = -1; /* Can this user login? */ - int isreplication = -1; /* Is this a replication role? */ + int isreplication = -1; /* Is this a replication role? */ int connlimit = -1; /* maximum connections allowed */ - List *rolemembers = NIL; /* roles to be added/removed */ - char *validUntil = NULL; /* time the login is valid until */ - Datum validUntil_datum; /* same, as timestamptz Datum */ + List *rolemembers = NIL; /* roles to be added/removed */ + char *validUntil = NULL; /* time the login is valid until */ + Datum validUntil_datum; /* same, as timestamptz Datum */ bool validUntil_null; int bypassrls = -1; DefElem *dpassword = NULL; diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c index 153a3608611..7978c062d75 100644 --- a/src/backend/commands/vacuumlazy.c +++ b/src/backend/commands/vacuumlazy.c @@ -81,8 +81,8 @@ * that the potential for improvement was great enough to merit the cost of * supporting them. */ -#define VACUUM_TRUNCATE_LOCK_CHECK_INTERVAL 20 /* ms */ -#define VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL 50 /* ms */ +#define VACUUM_TRUNCATE_LOCK_CHECK_INTERVAL 20 /* ms */ +#define VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL 50 /* ms */ #define VACUUM_TRUNCATE_LOCK_TIMEOUT 5000 /* ms */ /* @@ -112,7 +112,7 @@ typedef struct LVRelStats BlockNumber old_rel_pages; /* previous value of pg_class.relpages */ BlockNumber rel_pages; /* total number of pages */ BlockNumber scanned_pages; /* number of pages we examined */ - BlockNumber pinskipped_pages; /* # of pages we skipped due to a pin */ + BlockNumber pinskipped_pages; /* # of pages we skipped due to a pin */ BlockNumber frozenskipped_pages; /* # of frozen pages we skipped */ BlockNumber tupcount_pages; /* pages whose tuples we counted */ double scanned_tuples; /* counts only tuples on tupcount_pages */ diff --git a/src/backend/commands/view.c b/src/backend/commands/view.c index a5d6574eaf3..e83e4f455f2 100644 --- a/src/backend/commands/view.c +++ b/src/backend/commands/view.c @@ -546,7 +546,7 @@ DefineView(ViewStmt *stmt, const char *queryString, * long as the CREATE command is consistent with that --- no explicit * schema name. */ - view = copyObject(stmt->view); /* don't corrupt original command */ + view = copyObject(stmt->view); /* don't corrupt original command */ if (view->relpersistence == RELPERSISTENCE_PERMANENT && isQueryUsingTempRelation(viewParse)) { |