mirror of
https://github.com/postgres/postgres.git
synced 2025-12-21 05:21:08 +03:00
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
124 lines
4.0 KiB
C
124 lines
4.0 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* planmain.h
|
|
* prototypes for various files in optimizer/plan
|
|
*
|
|
*
|
|
* Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* src/include/optimizer/planmain.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef PLANMAIN_H
|
|
#define PLANMAIN_H
|
|
|
|
#include "nodes/plannodes.h"
|
|
#include "nodes/relation.h"
|
|
|
|
/* possible values for force_parallel_mode */
|
|
typedef enum
|
|
{
|
|
FORCE_PARALLEL_OFF,
|
|
FORCE_PARALLEL_ON,
|
|
FORCE_PARALLEL_REGRESS
|
|
} ForceParallelMode;
|
|
|
|
/* GUC parameters */
|
|
#define DEFAULT_CURSOR_TUPLE_FRACTION 0.1
|
|
extern double cursor_tuple_fraction;
|
|
extern int force_parallel_mode;
|
|
|
|
/* query_planner callback to compute query_pathkeys */
|
|
typedef void (*query_pathkeys_callback) (PlannerInfo *root, void *extra);
|
|
|
|
/*
|
|
* prototypes for plan/planmain.c
|
|
*/
|
|
extern RelOptInfo *query_planner(PlannerInfo *root, List *tlist,
|
|
query_pathkeys_callback qp_callback, void *qp_extra);
|
|
|
|
/*
|
|
* prototypes for plan/planagg.c
|
|
*/
|
|
extern void preprocess_minmax_aggregates(PlannerInfo *root, List *tlist);
|
|
|
|
/*
|
|
* prototypes for plan/createplan.c
|
|
*/
|
|
extern Plan *create_plan(PlannerInfo *root, Path *best_path);
|
|
extern ForeignScan *make_foreignscan(List *qptlist, List *qpqual,
|
|
Index scanrelid, List *fdw_exprs, List *fdw_private,
|
|
List *fdw_scan_tlist, List *fdw_recheck_quals,
|
|
Plan *outer_plan);
|
|
extern Plan *materialize_finished_plan(Plan *subplan);
|
|
extern bool is_projection_capable_path(Path *path);
|
|
extern bool is_projection_capable_plan(Plan *plan);
|
|
|
|
/* External use of these functions is deprecated: */
|
|
extern Sort *make_sort_from_sortclauses(List *sortcls, Plan *lefttree);
|
|
extern Agg *make_agg(List *tlist, List *qual,
|
|
AggStrategy aggstrategy, AggSplit aggsplit,
|
|
int numGroupCols, AttrNumber *grpColIdx, Oid *grpOperators,
|
|
List *groupingSets, List *chain,
|
|
double dNumGroups, Plan *lefttree);
|
|
extern Limit *make_limit(Plan *lefttree, Node *limitOffset, Node *limitCount);
|
|
|
|
/*
|
|
* prototypes for plan/initsplan.c
|
|
*/
|
|
extern int from_collapse_limit;
|
|
extern int join_collapse_limit;
|
|
|
|
extern void add_base_rels_to_query(PlannerInfo *root, Node *jtnode);
|
|
extern void build_base_rel_tlists(PlannerInfo *root, List *final_tlist);
|
|
extern void add_vars_to_targetlist(PlannerInfo *root, List *vars,
|
|
Relids where_needed, bool create_new_ph);
|
|
extern void find_lateral_references(PlannerInfo *root);
|
|
extern void create_lateral_join_info(PlannerInfo *root);
|
|
extern List *deconstruct_jointree(PlannerInfo *root);
|
|
extern void distribute_restrictinfo_to_rels(PlannerInfo *root,
|
|
RestrictInfo *restrictinfo);
|
|
extern void process_implied_equality(PlannerInfo *root,
|
|
Oid opno,
|
|
Oid collation,
|
|
Expr *item1,
|
|
Expr *item2,
|
|
Relids qualscope,
|
|
Relids nullable_relids,
|
|
Index security_level,
|
|
bool below_outer_join,
|
|
bool both_const);
|
|
extern RestrictInfo *build_implied_join_equality(Oid opno,
|
|
Oid collation,
|
|
Expr *item1,
|
|
Expr *item2,
|
|
Relids qualscope,
|
|
Relids nullable_relids,
|
|
Index security_level);
|
|
extern void match_foreign_keys_to_quals(PlannerInfo *root);
|
|
|
|
/*
|
|
* prototypes for plan/analyzejoins.c
|
|
*/
|
|
extern List *remove_useless_joins(PlannerInfo *root, List *joinlist);
|
|
extern void reduce_unique_semijoins(PlannerInfo *root);
|
|
extern bool query_supports_distinctness(Query *query);
|
|
extern bool query_is_distinct_for(Query *query, List *colnos, List *opids);
|
|
extern bool innerrel_is_unique(PlannerInfo *root,
|
|
Relids outerrelids, RelOptInfo *innerrel,
|
|
JoinType jointype, List *restrictlist, bool force_cache);
|
|
|
|
/*
|
|
* prototypes for plan/setrefs.c
|
|
*/
|
|
extern Plan *set_plan_references(PlannerInfo *root, Plan *plan);
|
|
extern void record_plan_function_dependency(PlannerInfo *root, Oid funcid);
|
|
extern void extract_query_dependencies(Node *query,
|
|
List **relationOids,
|
|
List **invalItems,
|
|
bool *hasRowSecurity);
|
|
|
|
#endif /* PLANMAIN_H */
|