mirror of
https://github.com/postgres/postgres.git
synced 2025-10-22 14:32:25 +03:00
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 e3860ffa4d
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/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
This commit is contained in:
@@ -32,4 +32,4 @@ extern ObjectAddress ExecAlterOwnerStmt(AlterOwnerStmt *stmt);
|
||||
extern void AlterObjectOwner_internal(Relation catalog, Oid objectId,
|
||||
Oid new_ownerId);
|
||||
|
||||
#endif /* ALTER_H */
|
||||
#endif /* ALTER_H */
|
||||
|
@@ -54,4 +54,4 @@ extern void HandleNotifyInterrupt(void);
|
||||
/* process interrupts */
|
||||
extern void ProcessNotifyInterrupt(void);
|
||||
|
||||
#endif /* ASYNC_H */
|
||||
#endif /* ASYNC_H */
|
||||
|
@@ -36,4 +36,4 @@ extern void finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
|
||||
MultiXactId minMulti,
|
||||
char newrelpersistence);
|
||||
|
||||
#endif /* CLUSTER_H */
|
||||
#endif /* CLUSTER_H */
|
||||
|
@@ -22,4 +22,4 @@ extern ObjectAddress DefineCollation(ParseState *pstate, List *names, List *para
|
||||
extern void IsThereCollationInNamespace(const char *collname, Oid nspOid);
|
||||
extern ObjectAddress AlterCollation(AlterCollationStmt *stmt);
|
||||
|
||||
#endif /* COLLATIONCMDS_H */
|
||||
#endif /* COLLATIONCMDS_H */
|
||||
|
@@ -42,4 +42,4 @@ extern void CreateSharedComments(Oid oid, Oid classoid, char *comment);
|
||||
|
||||
extern char *GetComment(Oid oid, Oid classoid, int32 subid);
|
||||
|
||||
#endif /* COMMENT_H */
|
||||
#endif /* COMMENT_H */
|
||||
|
@@ -20,4 +20,4 @@
|
||||
|
||||
extern ObjectAddress CreateConversionCommand(CreateConversionStmt *parsetree);
|
||||
|
||||
#endif /* CONVERSIONCMDS_H */
|
||||
#endif /* CONVERSIONCMDS_H */
|
||||
|
@@ -41,4 +41,4 @@ extern uint64 CopyFrom(CopyState cstate);
|
||||
|
||||
extern DestReceiver *CreateCopyDestReceiver(void);
|
||||
|
||||
#endif /* COPY_H */
|
||||
#endif /* COPY_H */
|
||||
|
@@ -28,4 +28,4 @@ extern int GetIntoRelEFlags(IntoClause *intoClause);
|
||||
|
||||
extern DestReceiver *CreateIntoRelDestReceiver(IntoClause *intoClause);
|
||||
|
||||
#endif /* CREATEAS_H */
|
||||
#endif /* CREATEAS_H */
|
||||
|
@@ -31,4 +31,4 @@ extern char *get_database_name(Oid dbid);
|
||||
|
||||
extern void check_encoding_locale_matches(int encoding, const char *collate, const char *ctype);
|
||||
|
||||
#endif /* DBCOMMANDS_H */
|
||||
#endif /* DBCOMMANDS_H */
|
||||
|
@@ -41,4 +41,4 @@ extern void dbase_redo(XLogReaderState *rptr);
|
||||
extern void dbase_desc(StringInfo buf, XLogReaderState *rptr);
|
||||
extern const char *dbase_identify(uint8 info);
|
||||
|
||||
#endif /* DBCOMMANDS_XLOG_H */
|
||||
#endif /* DBCOMMANDS_XLOG_H */
|
||||
|
@@ -164,4 +164,4 @@ extern TypeName *defGetTypeName(DefElem *def);
|
||||
extern int defGetTypeLength(DefElem *def);
|
||||
extern List *defGetStringList(DefElem *def);
|
||||
|
||||
#endif /* DEFREM_H */
|
||||
#endif /* DEFREM_H */
|
||||
|
@@ -17,4 +17,4 @@
|
||||
|
||||
extern void DiscardCommand(DiscardStmt *stmt, bool isTopLevel);
|
||||
|
||||
#endif /* DISCARD_H */
|
||||
#endif /* DISCARD_H */
|
||||
|
@@ -86,4 +86,4 @@ extern void EventTriggerCollectAlterTSConfig(AlterTSConfigurationStmt *stmt,
|
||||
Oid cfgId, Oid *dictIds, int ndicts);
|
||||
extern void EventTriggerCollectAlterDefPrivs(AlterDefaultPrivilegesStmt *stmt);
|
||||
|
||||
#endif /* EVENT_TRIGGER_H */
|
||||
#endif /* EVENT_TRIGGER_H */
|
||||
|
@@ -44,7 +44,7 @@ typedef struct ExplainState
|
||||
List *rtable; /* range table */
|
||||
List *rtable_names; /* alias names for RTEs */
|
||||
List *deparse_cxt; /* context list for deparsing expressions */
|
||||
Bitmapset *printed_subplans; /* ids of SubPlans we've printed */
|
||||
Bitmapset *printed_subplans; /* ids of SubPlans we've printed */
|
||||
} ExplainState;
|
||||
|
||||
/* Hook for plugins to get control in ExplainOneQuery() */
|
||||
@@ -101,4 +101,4 @@ extern void ExplainPropertyFloat(const char *qlabel, double value, int ndigits,
|
||||
extern void ExplainPropertyBool(const char *qlabel, bool value,
|
||||
ExplainState *es);
|
||||
|
||||
#endif /* EXPLAIN_H */
|
||||
#endif /* EXPLAIN_H */
|
||||
|
@@ -53,4 +53,4 @@ extern ObjectAddress AlterExtensionNamespace(const char *extensionName, const ch
|
||||
|
||||
extern void AlterExtensionOwner_oid(Oid extensionOid, Oid newOwnerId);
|
||||
|
||||
#endif /* EXTENSION_H */
|
||||
#endif /* EXTENSION_H */
|
||||
|
@@ -21,4 +21,4 @@
|
||||
*/
|
||||
extern void LockTableCommand(LockStmt *lockstmt);
|
||||
|
||||
#endif /* LOCKCMDS_H */
|
||||
#endif /* LOCKCMDS_H */
|
||||
|
@@ -30,4 +30,4 @@ extern DestReceiver *CreateTransientRelDestReceiver(Oid oid);
|
||||
|
||||
extern bool MatViewIncrementalMaintenanceIsEnabled(void);
|
||||
|
||||
#endif /* MATVIEW_H */
|
||||
#endif /* MATVIEW_H */
|
||||
|
@@ -35,4 +35,4 @@ extern ObjectAddress rename_policy(RenameStmt *stmt);
|
||||
|
||||
extern bool relation_has_policies(Relation rel);
|
||||
|
||||
#endif /* POLICY_H */
|
||||
#endif /* POLICY_H */
|
||||
|
@@ -30,4 +30,4 @@ extern void PortalCleanup(Portal portal);
|
||||
|
||||
extern void PersistHoldablePortal(Portal portal);
|
||||
|
||||
#endif /* PORTALCMDS_H */
|
||||
#endif /* PORTALCMDS_H */
|
||||
|
@@ -28,7 +28,7 @@ typedef struct
|
||||
{
|
||||
/* dynahash.c requires key to be first field */
|
||||
char stmt_name[NAMEDATALEN];
|
||||
CachedPlanSource *plansource; /* the actual cached plan */
|
||||
CachedPlanSource *plansource; /* the actual cached plan */
|
||||
bool from_sql; /* prepared via SQL, not FE/BE protocol? */
|
||||
TimestampTz prepare_time; /* the time when the stmt was prepared */
|
||||
} PreparedStatement;
|
||||
@@ -57,4 +57,4 @@ extern List *FetchPreparedStatementTargetList(PreparedStatement *stmt);
|
||||
|
||||
extern void DropAllPreparedStatements(void);
|
||||
|
||||
#endif /* PREPARE_H */
|
||||
#endif /* PREPARE_H */
|
||||
|
@@ -20,4 +20,4 @@ extern void DropProceduralLanguageById(Oid langOid);
|
||||
extern bool PLTemplateExists(const char *languageName);
|
||||
extern Oid get_language_oid(const char *langname, bool missing_ok);
|
||||
|
||||
#endif /* PROCLANG_H */
|
||||
#endif /* PROCLANG_H */
|
||||
|
@@ -26,4 +26,4 @@ extern void RemovePublicationRelById(Oid proid);
|
||||
extern ObjectAddress AlterPublicationOwner(const char *name, Oid newOwnerId);
|
||||
extern void AlterPublicationOwner_oid(Oid pubid, Oid newOwnerId);
|
||||
|
||||
#endif /* PUBLICATIONCMDS_H */
|
||||
#endif /* PUBLICATIONCMDS_H */
|
||||
|
@@ -28,4 +28,4 @@ extern ObjectAddress RenameSchema(const char *oldname, const char *newname);
|
||||
extern ObjectAddress AlterSchemaOwner(const char *name, Oid newOwnerId);
|
||||
extern void AlterSchemaOwner_oid(Oid schemaOid, Oid newOwnerId);
|
||||
|
||||
#endif /* SCHEMACMDS_H */
|
||||
#endif /* SCHEMACMDS_H */
|
||||
|
@@ -31,4 +31,4 @@ typedef void (*check_object_relabel_type) (const ObjectAddress *object,
|
||||
extern void register_label_provider(const char *provider,
|
||||
check_object_relabel_type hook);
|
||||
|
||||
#endif /* SECLABEL_H */
|
||||
#endif /* SECLABEL_H */
|
||||
|
@@ -66,4 +66,4 @@ extern void seq_desc(StringInfo buf, XLogReaderState *rptr);
|
||||
extern const char *seq_identify(uint8 info);
|
||||
extern void seq_mask(char *pagedata, BlockNumber blkno);
|
||||
|
||||
#endif /* SEQUENCE_H */
|
||||
#endif /* SEQUENCE_H */
|
||||
|
@@ -26,4 +26,4 @@ extern void DropSubscription(DropSubscriptionStmt *stmt, bool isTopLevel);
|
||||
extern ObjectAddress AlterSubscriptionOwner(const char *name, Oid newOwnerId);
|
||||
extern void AlterSubscriptionOwner_oid(Oid subid, Oid newOwnerId);
|
||||
|
||||
#endif /* SUBSCRIPTIONCMDS_H */
|
||||
#endif /* SUBSCRIPTIONCMDS_H */
|
||||
|
@@ -87,4 +87,4 @@ extern void RangeVarCallbackOwnsTable(const RangeVar *relation,
|
||||
|
||||
extern void RangeVarCallbackOwnsRelation(const RangeVar *relation,
|
||||
Oid relId, Oid oldRelId, void *noCatalogs);
|
||||
#endif /* TABLECMDS_H */
|
||||
#endif /* TABLECMDS_H */
|
||||
|
@@ -63,4 +63,4 @@ extern void tblspc_redo(XLogReaderState *rptr);
|
||||
extern void tblspc_desc(StringInfo buf, XLogReaderState *rptr);
|
||||
extern const char *tblspc_identify(uint8 info);
|
||||
|
||||
#endif /* TABLESPACE_H */
|
||||
#endif /* TABLESPACE_H */
|
||||
|
@@ -212,4 +212,4 @@ extern bool RI_Initial_Check(Trigger *trigger,
|
||||
|
||||
extern int RI_FKey_trigger_type(Oid tgfoid);
|
||||
|
||||
#endif /* TRIGGER_H */
|
||||
#endif /* TRIGGER_H */
|
||||
|
@@ -54,4 +54,4 @@ extern Oid AlterTypeNamespaceInternal(Oid typeOid, Oid nspOid,
|
||||
bool errorOnTableType,
|
||||
ObjectAddresses *objsMoved);
|
||||
|
||||
#endif /* TYPECMDS_H */
|
||||
#endif /* TYPECMDS_H */
|
||||
|
@@ -34,4 +34,4 @@ extern void DropOwnedObjects(DropOwnedStmt *stmt);
|
||||
extern void ReassignOwnedObjects(ReassignOwnedStmt *stmt);
|
||||
extern List *roleSpecsToIds(List *memberNames);
|
||||
|
||||
#endif /* USER_H */
|
||||
#endif /* USER_H */
|
||||
|
@@ -136,20 +136,19 @@ typedef struct VacAttrStats
|
||||
typedef struct VacuumParams
|
||||
{
|
||||
int freeze_min_age; /* min freeze age, -1 to use default */
|
||||
int freeze_table_age; /* age at which to scan whole table */
|
||||
int multixact_freeze_min_age; /* min multixact freeze age,
|
||||
* -1 to use default */
|
||||
int multixact_freeze_table_age; /* multixact age at which to
|
||||
* scan whole table */
|
||||
int freeze_table_age; /* age at which to scan whole table */
|
||||
int multixact_freeze_min_age; /* min multixact freeze age, -1 to
|
||||
* use default */
|
||||
int multixact_freeze_table_age; /* multixact age at which to scan
|
||||
* whole table */
|
||||
bool is_wraparound; /* force a for-wraparound vacuum */
|
||||
int log_min_duration; /* minimum execution threshold in ms
|
||||
* at which verbose logs are
|
||||
* activated, -1 to use default */
|
||||
int log_min_duration; /* minimum execution threshold in ms at
|
||||
* which verbose logs are activated, -1
|
||||
* to use default */
|
||||
} VacuumParams;
|
||||
|
||||
/* GUC parameters */
|
||||
extern PGDLLIMPORT int default_statistics_target; /* PGDLLIMPORT for
|
||||
* PostGIS */
|
||||
extern PGDLLIMPORT int default_statistics_target; /* PGDLLIMPORT for PostGIS */
|
||||
extern int vacuum_freeze_min_age;
|
||||
extern int vacuum_freeze_table_age;
|
||||
extern int vacuum_multixact_freeze_min_age;
|
||||
@@ -203,4 +202,4 @@ extern double anl_random_fract(void);
|
||||
extern double anl_init_selection_state(int n);
|
||||
extern double anl_get_next_S(double t, int n, double *stateptr);
|
||||
|
||||
#endif /* VACUUM_H */
|
||||
#endif /* VACUUM_H */
|
||||
|
@@ -37,4 +37,4 @@ extern bool check_role(char **newval, void **extra, GucSource source);
|
||||
extern void assign_role(const char *newval, void *extra);
|
||||
extern const char *show_role(void);
|
||||
|
||||
#endif /* VARIABLE_H */
|
||||
#endif /* VARIABLE_H */
|
||||
|
@@ -24,4 +24,4 @@ extern ObjectAddress DefineView(ViewStmt *stmt, const char *queryString,
|
||||
|
||||
extern void StoreViewQuery(Oid viewOid, Query *viewParse, bool replace);
|
||||
|
||||
#endif /* VIEW_H */
|
||||
#endif /* VIEW_H */
|
||||
|
Reference in New Issue
Block a user