Phase 2 pgindent run for v12.

Switch to 2.1 version of pg_bsd_indent.  This formats
multiline function declarations "correctly", that is with
additional lines of parameter declarations indented to match
where the first line's left parenthesis is.

Discussion: https://postgr.es/m/CAEepm=0P3FeTXRcU5B2W3jv3PgRVZ-kGUXLGfd42FFhUROO3ug@mail.gmail.com
This commit is contained in:
Tom Lane 2019-05-22 13:04:48 -04:00
parent be76af171c
commit 8255c7a5ee
712 changed files with 7441 additions and 7455 deletions

View File

@ -126,45 +126,45 @@ PG_FUNCTION_INFO_V1(bt_index_check);
PG_FUNCTION_INFO_V1(bt_index_parent_check); PG_FUNCTION_INFO_V1(bt_index_parent_check);
static void bt_index_check_internal(Oid indrelid, bool parentcheck, static void bt_index_check_internal(Oid indrelid, bool parentcheck,
bool heapallindexed, bool rootdescend); bool heapallindexed, bool rootdescend);
static inline void btree_index_checkable(Relation rel); static inline void btree_index_checkable(Relation rel);
static void bt_check_every_level(Relation rel, Relation heaprel, static void bt_check_every_level(Relation rel, Relation heaprel,
bool heapkeyspace, bool readonly, bool heapallindexed, bool heapkeyspace, bool readonly, bool heapallindexed,
bool rootdescend); bool rootdescend);
static BtreeLevel bt_check_level_from_leftmost(BtreeCheckState *state, static BtreeLevel bt_check_level_from_leftmost(BtreeCheckState *state,
BtreeLevel level); BtreeLevel level);
static void bt_target_page_check(BtreeCheckState *state); static void bt_target_page_check(BtreeCheckState *state);
static BTScanInsert bt_right_page_check_scankey(BtreeCheckState *state); static BTScanInsert bt_right_page_check_scankey(BtreeCheckState *state);
static void bt_downlink_check(BtreeCheckState *state, BTScanInsert targetkey, static void bt_downlink_check(BtreeCheckState *state, BTScanInsert targetkey,
BlockNumber childblock); BlockNumber childblock);
static void bt_downlink_missing_check(BtreeCheckState *state); static void bt_downlink_missing_check(BtreeCheckState *state);
static void bt_tuple_present_callback(Relation index, HeapTuple htup, static void bt_tuple_present_callback(Relation index, HeapTuple htup,
Datum *values, bool *isnull, Datum *values, bool *isnull,
bool tupleIsAlive, void *checkstate); bool tupleIsAlive, void *checkstate);
static IndexTuple bt_normalize_tuple(BtreeCheckState *state, static IndexTuple bt_normalize_tuple(BtreeCheckState *state,
IndexTuple itup); IndexTuple itup);
static bool bt_rootdescend(BtreeCheckState *state, IndexTuple itup); static bool bt_rootdescend(BtreeCheckState *state, IndexTuple itup);
static inline bool offset_is_negative_infinity(BTPageOpaque opaque, static inline bool offset_is_negative_infinity(BTPageOpaque opaque,
OffsetNumber offset); OffsetNumber offset);
static inline bool invariant_l_offset(BtreeCheckState *state, BTScanInsert key, static inline bool invariant_l_offset(BtreeCheckState *state, BTScanInsert key,
OffsetNumber upperbound); OffsetNumber upperbound);
static inline bool invariant_leq_offset(BtreeCheckState *state, static inline bool invariant_leq_offset(BtreeCheckState *state,
BTScanInsert key, BTScanInsert key,
OffsetNumber upperbound); OffsetNumber upperbound);
static inline bool invariant_g_offset(BtreeCheckState *state, BTScanInsert key, static inline bool invariant_g_offset(BtreeCheckState *state, BTScanInsert key,
OffsetNumber lowerbound); OffsetNumber lowerbound);
static inline bool invariant_l_nontarget_offset(BtreeCheckState *state, static inline bool invariant_l_nontarget_offset(BtreeCheckState *state,
BTScanInsert key, BTScanInsert key,
BlockNumber nontargetblock, BlockNumber nontargetblock,
Page nontarget, Page nontarget,
OffsetNumber upperbound); OffsetNumber upperbound);
static Page palloc_btree_page(BtreeCheckState *state, BlockNumber blocknum); static Page palloc_btree_page(BtreeCheckState *state, BlockNumber blocknum);
static inline BTScanInsert bt_mkscankey_pivotsearch(Relation rel, static inline BTScanInsert bt_mkscankey_pivotsearch(Relation rel,
IndexTuple itup); IndexTuple itup);
static ItemId PageGetItemIdCareful(BtreeCheckState *state, BlockNumber block, static ItemId PageGetItemIdCareful(BtreeCheckState *state, BlockNumber block,
Page page, OffsetNumber offset); Page page, OffsetNumber offset);
static inline ItemPointer BTreeTupleGetHeapTIDCareful(BtreeCheckState *state, static inline ItemPointer BTreeTupleGetHeapTIDCareful(BtreeCheckState *state,
IndexTuple itup, bool nonpivot); IndexTuple itup, bool nonpivot);
/* /*
* bt_index_check(index regclass, heapallindexed boolean) * bt_index_check(index regclass, heapallindexed boolean)

View File

@ -77,8 +77,8 @@ void _PG_fini(void);
static void explain_ExecutorStart(QueryDesc *queryDesc, int eflags); static void explain_ExecutorStart(QueryDesc *queryDesc, int eflags);
static void explain_ExecutorRun(QueryDesc *queryDesc, static void explain_ExecutorRun(QueryDesc *queryDesc,
ScanDirection direction, ScanDirection direction,
uint64 count, bool execute_once); uint64 count, bool execute_once);
static void explain_ExecutorFinish(QueryDesc *queryDesc); static void explain_ExecutorFinish(QueryDesc *queryDesc);
static void explain_ExecutorEnd(QueryDesc *queryDesc); static void explain_ExecutorEnd(QueryDesc *queryDesc);

View File

@ -189,26 +189,26 @@ extern bool blvalidate(Oid opclassoid);
/* index access method interface functions */ /* index access method interface functions */
extern bool blinsert(Relation index, Datum *values, bool *isnull, extern bool blinsert(Relation index, Datum *values, bool *isnull,
ItemPointer ht_ctid, Relation heapRel, ItemPointer ht_ctid, Relation heapRel,
IndexUniqueCheck checkUnique, IndexUniqueCheck checkUnique,
struct IndexInfo *indexInfo); struct IndexInfo *indexInfo);
extern IndexScanDesc blbeginscan(Relation r, int nkeys, int norderbys); extern IndexScanDesc blbeginscan(Relation r, int nkeys, int norderbys);
extern int64 blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm); extern int64 blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm);
extern void blrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys, extern void blrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
ScanKey orderbys, int norderbys); ScanKey orderbys, int norderbys);
extern void blendscan(IndexScanDesc scan); extern void blendscan(IndexScanDesc scan);
extern IndexBuildResult *blbuild(Relation heap, Relation index, extern IndexBuildResult *blbuild(Relation heap, Relation index,
struct IndexInfo *indexInfo); struct IndexInfo *indexInfo);
extern void blbuildempty(Relation index); extern void blbuildempty(Relation index);
extern IndexBulkDeleteResult *blbulkdelete(IndexVacuumInfo *info, extern IndexBulkDeleteResult *blbulkdelete(IndexVacuumInfo *info,
IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback, IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback,
void *callback_state); void *callback_state);
extern IndexBulkDeleteResult *blvacuumcleanup(IndexVacuumInfo *info, extern IndexBulkDeleteResult *blvacuumcleanup(IndexVacuumInfo *info,
IndexBulkDeleteResult *stats); IndexBulkDeleteResult *stats);
extern bytea *bloptions(Datum reloptions, bool validate); extern bytea *bloptions(Datum reloptions, bool validate);
extern void blcostestimate(PlannerInfo *root, IndexPath *path, extern void blcostestimate(PlannerInfo *root, IndexPath *path,
double loop_count, Cost *indexStartupCost, double loop_count, Cost *indexStartupCost,
Cost *indexTotalCost, Selectivity *indexSelectivity, Cost *indexTotalCost, Selectivity *indexSelectivity,
double *indexCorrelation, double *indexPages); double *indexCorrelation, double *indexPages);
#endif #endif

View File

@ -110,26 +110,26 @@ do { \
extern Interval *abs_interval(Interval *a); extern Interval *abs_interval(Interval *a);
extern bool gbt_num_consistent(const GBT_NUMKEY_R *key, const void *query, extern bool gbt_num_consistent(const GBT_NUMKEY_R *key, const void *query,
const StrategyNumber *strategy, bool is_leaf, const StrategyNumber *strategy, bool is_leaf,
const gbtree_ninfo *tinfo, FmgrInfo *flinfo); const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
extern float8 gbt_num_distance(const GBT_NUMKEY_R *key, const void *query, extern float8 gbt_num_distance(const GBT_NUMKEY_R *key, const void *query,
bool is_leaf, const gbtree_ninfo *tinfo, FmgrInfo *flinfo); bool is_leaf, const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
extern GIST_SPLITVEC *gbt_num_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v, extern GIST_SPLITVEC *gbt_num_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
const gbtree_ninfo *tinfo, FmgrInfo *flinfo); const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
extern GISTENTRY *gbt_num_compress(GISTENTRY *entry, const gbtree_ninfo *tinfo); extern GISTENTRY *gbt_num_compress(GISTENTRY *entry, const gbtree_ninfo *tinfo);
extern GISTENTRY *gbt_num_fetch(GISTENTRY *entry, const gbtree_ninfo *tinfo); extern GISTENTRY *gbt_num_fetch(GISTENTRY *entry, const gbtree_ninfo *tinfo);
extern void *gbt_num_union(GBT_NUMKEY *out, const GistEntryVector *entryvec, extern void *gbt_num_union(GBT_NUMKEY *out, const GistEntryVector *entryvec,
const gbtree_ninfo *tinfo, FmgrInfo *flinfo); const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
extern bool gbt_num_same(const GBT_NUMKEY *a, const GBT_NUMKEY *b, extern bool gbt_num_same(const GBT_NUMKEY *a, const GBT_NUMKEY *b,
const gbtree_ninfo *tinfo, FmgrInfo *flinfo); const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
extern void gbt_num_bin_union(Datum *u, GBT_NUMKEY *e, extern void gbt_num_bin_union(Datum *u, GBT_NUMKEY *e,
const gbtree_ninfo *tinfo, FmgrInfo *flinfo); const gbtree_ninfo *tinfo, FmgrInfo *flinfo);
#endif #endif

View File

@ -52,22 +52,22 @@ extern GBT_VARKEY *gbt_var_key_copy(const GBT_VARKEY_R *u);
extern GISTENTRY *gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo *tinfo); extern GISTENTRY *gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo *tinfo);
extern GBT_VARKEY *gbt_var_union(const GistEntryVector *entryvec, int32 *size, extern GBT_VARKEY *gbt_var_union(const GistEntryVector *entryvec, int32 *size,
Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo); Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
extern bool gbt_var_same(Datum d1, Datum d2, Oid collation, extern bool gbt_var_same(Datum d1, Datum d2, Oid collation,
const gbtree_vinfo *tinfo, FmgrInfo *flinfo); const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
extern float *gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n, extern float *gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n,
Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo); Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
extern bool gbt_var_consistent(GBT_VARKEY_R *key, const void *query, extern bool gbt_var_consistent(GBT_VARKEY_R *key, const void *query,
StrategyNumber strategy, Oid collation, bool is_leaf, StrategyNumber strategy, Oid collation, bool is_leaf,
const gbtree_vinfo *tinfo, FmgrInfo *flinfo); const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
extern GIST_SPLITVEC *gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v, extern GIST_SPLITVEC *gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo); Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
extern void gbt_var_bin_union(Datum *u, GBT_VARKEY *e, Oid collation, extern void gbt_var_bin_union(Datum *u, GBT_VARKEY *e, Oid collation,
const gbtree_vinfo *tinfo, FmgrInfo *flinfo); const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
#endif #endif

View File

@ -89,12 +89,12 @@ typedef struct storeInfo
static Datum dblink_record_internal(FunctionCallInfo fcinfo, bool is_async); static Datum dblink_record_internal(FunctionCallInfo fcinfo, bool is_async);
static void prepTuplestoreResult(FunctionCallInfo fcinfo); static void prepTuplestoreResult(FunctionCallInfo fcinfo);
static void materializeResult(FunctionCallInfo fcinfo, PGconn *conn, static void materializeResult(FunctionCallInfo fcinfo, PGconn *conn,
PGresult *res); PGresult *res);
static void materializeQueryResult(FunctionCallInfo fcinfo, static void materializeQueryResult(FunctionCallInfo fcinfo,
PGconn *conn, PGconn *conn,
const char *conname, const char *conname,
const char *sql, const char *sql,
bool fail); bool fail);
static PGresult *storeQueryResult(volatile storeInfo *sinfo, PGconn *conn, const char *sql); static PGresult *storeQueryResult(volatile storeInfo *sinfo, PGconn *conn, const char *sql);
static void storeRow(volatile storeInfo *sinfo, PGresult *res, bool first); static void storeRow(volatile storeInfo *sinfo, PGresult *res, bool first);
static remoteConn *getConnectionByName(const char *name); static remoteConn *getConnectionByName(const char *name);
@ -114,14 +114,14 @@ static char *generate_relation_name(Relation rel);
static void dblink_connstr_check(const char *connstr); static void dblink_connstr_check(const char *connstr);
static void dblink_security_check(PGconn *conn, remoteConn *rconn); static void dblink_security_check(PGconn *conn, remoteConn *rconn);
static void dblink_res_error(PGconn *conn, const char *conname, PGresult *res, static void dblink_res_error(PGconn *conn, const char *conname, PGresult *res,
bool fail, const char *fmt,...) pg_attribute_printf(5, 6); bool fail, const char *fmt,...) pg_attribute_printf(5, 6);
static char *get_connect_string(const char *servername); static char *get_connect_string(const char *servername);
static char *escape_param_str(const char *from); static char *escape_param_str(const char *from);
static void validate_pkattnums(Relation rel, static void validate_pkattnums(Relation rel,
int2vector *pkattnums_arg, int32 pknumatts_arg, int2vector *pkattnums_arg, int32 pknumatts_arg,
int **pkattnums, int *pknumatts); int **pkattnums, int *pknumatts);
static bool is_valid_dblink_option(const PQconninfoOption *options, static bool is_valid_dblink_option(const PQconninfoOption *options,
const char *option, Oid context); const char *option, Oid context);
static int applyRemoteGucs(PGconn *conn); static int applyRemoteGucs(PGconn *conn);
static void restoreLocalGucs(int nestlevel); static void restoreLocalGucs(int nestlevel);

View File

@ -117,49 +117,49 @@ PG_FUNCTION_INFO_V1(file_fdw_validator);
* FDW callback routines * FDW callback routines
*/ */
static void fileGetForeignRelSize(PlannerInfo *root, static void fileGetForeignRelSize(PlannerInfo *root,
RelOptInfo *baserel, RelOptInfo *baserel,
Oid foreigntableid); Oid foreigntableid);
static void fileGetForeignPaths(PlannerInfo *root, static void fileGetForeignPaths(PlannerInfo *root,
RelOptInfo *baserel, RelOptInfo *baserel,
Oid foreigntableid); Oid foreigntableid);
static ForeignScan *fileGetForeignPlan(PlannerInfo *root, static ForeignScan *fileGetForeignPlan(PlannerInfo *root,
RelOptInfo *baserel, RelOptInfo *baserel,
Oid foreigntableid, Oid foreigntableid,
ForeignPath *best_path, ForeignPath *best_path,
List *tlist, List *tlist,
List *scan_clauses, List *scan_clauses,
Plan *outer_plan); Plan *outer_plan);
static void fileExplainForeignScan(ForeignScanState *node, ExplainState *es); static void fileExplainForeignScan(ForeignScanState *node, ExplainState *es);
static void fileBeginForeignScan(ForeignScanState *node, int eflags); static void fileBeginForeignScan(ForeignScanState *node, int eflags);
static TupleTableSlot *fileIterateForeignScan(ForeignScanState *node); static TupleTableSlot *fileIterateForeignScan(ForeignScanState *node);
static void fileReScanForeignScan(ForeignScanState *node); static void fileReScanForeignScan(ForeignScanState *node);
static void fileEndForeignScan(ForeignScanState *node); static void fileEndForeignScan(ForeignScanState *node);
static bool fileAnalyzeForeignTable(Relation relation, static bool fileAnalyzeForeignTable(Relation relation,
AcquireSampleRowsFunc *func, AcquireSampleRowsFunc *func,
BlockNumber *totalpages); BlockNumber *totalpages);
static bool fileIsForeignScanParallelSafe(PlannerInfo *root, RelOptInfo *rel, static bool fileIsForeignScanParallelSafe(PlannerInfo *root, RelOptInfo *rel,
RangeTblEntry *rte); RangeTblEntry *rte);
/* /*
* Helper functions * Helper functions
*/ */
static bool is_valid_option(const char *option, Oid context); static bool is_valid_option(const char *option, Oid context);
static void fileGetOptions(Oid foreigntableid, static void fileGetOptions(Oid foreigntableid,
char **filename, char **filename,
bool *is_program, bool *is_program,
List **other_options); List **other_options);
static List *get_file_fdw_attribute_options(Oid relid); static List *get_file_fdw_attribute_options(Oid relid);
static bool check_selective_binary_conversion(RelOptInfo *baserel, static bool check_selective_binary_conversion(RelOptInfo *baserel,
Oid foreigntableid, Oid foreigntableid,
List **columns); List **columns);
static void estimate_size(PlannerInfo *root, RelOptInfo *baserel, static void estimate_size(PlannerInfo *root, RelOptInfo *baserel,
FileFdwPlanState *fdw_private); FileFdwPlanState *fdw_private);
static void estimate_costs(PlannerInfo *root, RelOptInfo *baserel, static void estimate_costs(PlannerInfo *root, RelOptInfo *baserel,
FileFdwPlanState *fdw_private, FileFdwPlanState *fdw_private,
Cost *startup_cost, Cost *total_cost); Cost *startup_cost, Cost *total_cost);
static int file_acquire_sample_rows(Relation onerel, int elevel, static int file_acquire_sample_rows(Relation onerel, int elevel,
HeapTuple *rows, int targrows, HeapTuple *rows, int targrows,
double *totalrows, double *totaldeadrows); double *totalrows, double *totaldeadrows);
/* /*

View File

@ -35,7 +35,7 @@ PG_FUNCTION_INFO_V1(_int_matchsel);
static Selectivity int_query_opr_selec(ITEM *item, Datum *values, float4 *freqs, static Selectivity int_query_opr_selec(ITEM *item, Datum *values, float4 *freqs,
int nmncelems, float4 minfreq); int nmncelems, float4 minfreq);
static int compare_val_int4(const void *a, const void *b); static int compare_val_int4(const void *a, const void *b);
/* /*

View File

@ -26,7 +26,7 @@ static PyObject *decimal_constructor;
static PyObject *PLyObject_FromJsonbContainer(JsonbContainer *jsonb); static PyObject *PLyObject_FromJsonbContainer(JsonbContainer *jsonb);
static JsonbValue *PLyObject_ToJsonbValue(PyObject *obj, static JsonbValue *PLyObject_ToJsonbValue(PyObject *obj,
JsonbParseState **jsonb_state, bool is_elem); JsonbParseState **jsonb_state, bool is_elem);
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3
typedef PyObject *(*PLyUnicode_FromStringAndSize_t) typedef PyObject *(*PLyUnicode_FromStringAndSize_t)

View File

@ -50,7 +50,7 @@ getlexeme(char *start, char *end, int *len)
} }
bool bool
compare_subnode(ltree_level *t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend) compare_subnode(ltree_level *t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend)
{ {
char *endt = t->name + t->len; char *endt = t->name + t->len;
char *endq = qn + len; char *endq = qn + len;

View File

@ -155,13 +155,13 @@ Datum ltree_textadd(PG_FUNCTION_ARGS);
/* Util function */ /* Util function */
Datum ltree_in(PG_FUNCTION_ARGS); Datum ltree_in(PG_FUNCTION_ARGS);
bool ltree_execute(ITEM *curitem, void *checkval, bool ltree_execute(ITEM *curitem, void *checkval,
bool calcnot, bool (*chkcond) (void *checkval, ITEM *val)); bool calcnot, bool (*chkcond) (void *checkval, ITEM *val));
int ltree_compare(const ltree *a, const ltree *b); int ltree_compare(const ltree *a, const ltree *b);
bool inner_isparent(const ltree *c, const ltree *p); bool inner_isparent(const ltree *c, const ltree *p);
bool compare_subnode(ltree_level *t, char *q, int len, bool compare_subnode(ltree_level *t, char *q, int len,
int (*cmpptr) (const char *, const char *, size_t), bool anyend); int (*cmpptr) (const char *, const char *, size_t), bool anyend);
ltree *lca_inner(ltree **a, int len); ltree *lca_inner(ltree **a, int len);
int ltree_strncasecmp(const char *a, const char *b, size_t s); int ltree_strncasecmp(const char *a, const char *b, size_t s);

View File

@ -41,7 +41,7 @@ typedef struct brin_column_state
static Page verify_brin_page(bytea *raw_page, uint16 type, static Page verify_brin_page(bytea *raw_page, uint16 type,
const char *strtype); const char *strtype);
Datum Datum
brin_page_type(PG_FUNCTION_ARGS) brin_page_type(PG_FUNCTION_ARGS)

View File

@ -33,7 +33,7 @@
PG_MODULE_MAGIC; PG_MODULE_MAGIC;
static bytea *get_raw_page_internal(text *relname, ForkNumber forknum, static bytea *get_raw_page_internal(text *relname, ForkNumber forknum,
BlockNumber blkno); BlockNumber blkno);
/* /*

View File

@ -300,45 +300,45 @@ static void pgss_shmem_shutdown(int code, Datum arg);
static void pgss_post_parse_analyze(ParseState *pstate, Query *query); static void pgss_post_parse_analyze(ParseState *pstate, Query *query);
static void pgss_ExecutorStart(QueryDesc *queryDesc, int eflags); static void pgss_ExecutorStart(QueryDesc *queryDesc, int eflags);
static void pgss_ExecutorRun(QueryDesc *queryDesc, static void pgss_ExecutorRun(QueryDesc *queryDesc,
ScanDirection direction, ScanDirection direction,
uint64 count, bool execute_once); uint64 count, bool execute_once);
static void pgss_ExecutorFinish(QueryDesc *queryDesc); static void pgss_ExecutorFinish(QueryDesc *queryDesc);
static void pgss_ExecutorEnd(QueryDesc *queryDesc); static void pgss_ExecutorEnd(QueryDesc *queryDesc);
static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString, static void pgss_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
ProcessUtilityContext context, ParamListInfo params, ProcessUtilityContext context, ParamListInfo params,
QueryEnvironment *queryEnv, QueryEnvironment *queryEnv,
DestReceiver *dest, char *completionTag); DestReceiver *dest, char *completionTag);
static uint64 pgss_hash_string(const char *str, int len); static uint64 pgss_hash_string(const char *str, int len);
static void pgss_store(const char *query, uint64 queryId, static void pgss_store(const char *query, uint64 queryId,
int query_location, int query_len, int query_location, int query_len,
double total_time, uint64 rows, double total_time, uint64 rows,
const BufferUsage *bufusage, const BufferUsage *bufusage,
pgssJumbleState *jstate); pgssJumbleState *jstate);
static void pg_stat_statements_internal(FunctionCallInfo fcinfo, static void pg_stat_statements_internal(FunctionCallInfo fcinfo,
pgssVersion api_version, pgssVersion api_version,
bool showtext); bool showtext);
static Size pgss_memsize(void); static Size pgss_memsize(void);
static pgssEntry *entry_alloc(pgssHashKey *key, Size query_offset, int query_len, static pgssEntry *entry_alloc(pgssHashKey *key, Size query_offset, int query_len,
int encoding, bool sticky); int encoding, bool sticky);
static void entry_dealloc(void); static void entry_dealloc(void);
static bool qtext_store(const char *query, int query_len, static bool qtext_store(const char *query, int query_len,
Size *query_offset, int *gc_count); Size *query_offset, int *gc_count);
static char *qtext_load_file(Size *buffer_size); static char *qtext_load_file(Size *buffer_size);
static char *qtext_fetch(Size query_offset, int query_len, static char *qtext_fetch(Size query_offset, int query_len,
char *buffer, Size buffer_size); char *buffer, Size buffer_size);
static bool need_gc_qtexts(void); static bool need_gc_qtexts(void);
static void gc_qtexts(void); static void gc_qtexts(void);
static void entry_reset(Oid userid, Oid dbid, uint64 queryid); static void entry_reset(Oid userid, Oid dbid, uint64 queryid);
static void AppendJumble(pgssJumbleState *jstate, static void AppendJumble(pgssJumbleState *jstate,
const unsigned char *item, Size size); const unsigned char *item, Size size);
static void JumbleQuery(pgssJumbleState *jstate, Query *query); static void JumbleQuery(pgssJumbleState *jstate, Query *query);
static void JumbleRangeTable(pgssJumbleState *jstate, List *rtable); static void JumbleRangeTable(pgssJumbleState *jstate, List *rtable);
static void JumbleExpr(pgssJumbleState *jstate, Node *node); static void JumbleExpr(pgssJumbleState *jstate, Node *node);
static void RecordConstLocation(pgssJumbleState *jstate, int location); static void RecordConstLocation(pgssJumbleState *jstate, int location);
static char *generate_normalized_query(pgssJumbleState *jstate, const char *query, static char *generate_normalized_query(pgssJumbleState *jstate, const char *query,
int query_loc, int *query_len_p, int encoding); int query_loc, int *query_len_p, int encoding);
static void fill_in_constant_lengths(pgssJumbleState *jstate, const char *query, static void fill_in_constant_lengths(pgssJumbleState *jstate, const char *query,
int query_loc); int query_loc);
static int comp_location(const void *a, const void *b); static int comp_location(const void *a, const void *b);

View File

@ -134,7 +134,7 @@ extern float4 cnt_sml(TRGM *trg1, TRGM *trg2, bool inexact);
extern bool trgm_contained_by(TRGM *trg1, TRGM *trg2); extern bool trgm_contained_by(TRGM *trg1, TRGM *trg2);
extern bool *trgm_presence_map(TRGM *query, TRGM *key); extern bool *trgm_presence_map(TRGM *query, TRGM *key);
extern TRGM *createTrgmNFA(text *text_re, Oid collation, extern TRGM *createTrgmNFA(text *text_re, Oid collation,
TrgmPackedGraph **graph, MemoryContext rcontext); TrgmPackedGraph **graph, MemoryContext rcontext);
extern bool trigramsMatchGraph(TrgmPackedGraph *graph, bool *check); extern bool trigramsMatchGraph(TrgmPackedGraph *graph, bool *check);
#endif /* __TRGM_H__ */ #endif /* __TRGM_H__ */

View File

@ -478,9 +478,9 @@ typedef struct
/* prototypes for private functions */ /* prototypes for private functions */
static TRGM *createTrgmNFAInternal(regex_t *regex, TrgmPackedGraph **graph, static TRGM *createTrgmNFAInternal(regex_t *regex, TrgmPackedGraph **graph,
MemoryContext rcontext); MemoryContext rcontext);
static void RE_compile(regex_t *regex, text *text_re, static void RE_compile(regex_t *regex, text *text_re,
int cflags, Oid collation); int cflags, Oid collation);
static void getColorInfo(regex_t *regex, TrgmNFA *trgmNFA); static void getColorInfo(regex_t *regex, TrgmNFA *trgmNFA);
static bool convertPgWchar(pg_wchar c, trgm_mb_char *result); static bool convertPgWchar(pg_wchar c, trgm_mb_char *result);
static void transformGraph(TrgmNFA *trgmNFA); static void transformGraph(TrgmNFA *trgmNFA);
@ -489,7 +489,7 @@ static void addKey(TrgmNFA *trgmNFA, TrgmState *state, TrgmStateKey *key);
static void addKeyToQueue(TrgmNFA *trgmNFA, TrgmStateKey *key); static void addKeyToQueue(TrgmNFA *trgmNFA, TrgmStateKey *key);
static void addArcs(TrgmNFA *trgmNFA, TrgmState *state); static void addArcs(TrgmNFA *trgmNFA, TrgmState *state);
static void addArc(TrgmNFA *trgmNFA, TrgmState *state, TrgmStateKey *key, static void addArc(TrgmNFA *trgmNFA, TrgmState *state, TrgmStateKey *key,
TrgmColor co, TrgmStateKey *destKey); TrgmColor co, TrgmStateKey *destKey);
static bool validArcLabel(TrgmStateKey *key, TrgmColor co); static bool validArcLabel(TrgmStateKey *key, TrgmColor co);
static TrgmState *getState(TrgmNFA *trgmNFA, TrgmStateKey *key); static TrgmState *getState(TrgmNFA *trgmNFA, TrgmStateKey *key);
static bool prefixContains(TrgmPrefix *prefix1, TrgmPrefix *prefix2); static bool prefixContains(TrgmPrefix *prefix1, TrgmPrefix *prefix2);

View File

@ -51,10 +51,10 @@ PG_FUNCTION_INFO_V1(pg_truncate_visibility_map);
static TupleDesc pg_visibility_tupdesc(bool include_blkno, bool include_pd); static TupleDesc pg_visibility_tupdesc(bool include_blkno, bool include_pd);
static vbits *collect_visibility_data(Oid relid, bool include_pd); static vbits *collect_visibility_data(Oid relid, bool include_pd);
static corrupt_items *collect_corrupt_items(Oid relid, bool all_visible, static corrupt_items *collect_corrupt_items(Oid relid, bool all_visible,
bool all_frozen); bool all_frozen);
static void record_corrupt_item(corrupt_items *items, ItemPointer tid); static void record_corrupt_item(corrupt_items *items, ItemPointer tid);
static bool tuple_all_visible(HeapTuple tup, TransactionId OldestXmin, static bool tuple_all_visible(HeapTuple tup, TransactionId OldestXmin,
Buffer buffer); Buffer buffer);
static void check_relation_relkind(Relation rel); static void check_relation_relkind(Relation rel);
/* /*

View File

@ -335,19 +335,19 @@ static int s_uvcmp(mp_int a, mp_usmall uv);
/* Unsigned magnitude addition; assumes dc is big enough. /* Unsigned magnitude addition; assumes dc is big enough.
Carry out is returned (no memory allocated). */ Carry out is returned (no memory allocated). */
static mp_digit s_uadd(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a, static mp_digit s_uadd(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a,
mp_size size_b); mp_size size_b);
/* Unsigned magnitude subtraction. Assumes dc is big enough. */ /* Unsigned magnitude subtraction. Assumes dc is big enough. */
static void s_usub(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a, static void s_usub(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a,
mp_size size_b); mp_size size_b);
/* Unsigned recursive multiplication. Assumes dc is big enough. */ /* Unsigned recursive multiplication. Assumes dc is big enough. */
static int s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a, static int s_kmul(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a,
mp_size size_b); mp_size size_b);
/* Unsigned magnitude multiplication. Assumes dc is big enough. */ /* Unsigned magnitude multiplication. Assumes dc is big enough. */
static void s_umul(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a, static void s_umul(mp_digit *da, mp_digit *db, mp_digit *dc, mp_size size_a,
mp_size size_b); mp_size size_b);
/* Unsigned recursive squaring. Assumes dc is big enough. */ /* Unsigned recursive squaring. Assumes dc is big enough. */
static int s_ksqr(mp_digit *da, mp_digit *dc, mp_size size_a); static int s_ksqr(mp_digit *da, mp_digit *dc, mp_size size_a);

View File

@ -90,8 +90,8 @@ int mbuf_free(MBuf *mbuf);
/* /*
* Push filter * Push filter
*/ */
int pushf_create(PushFilter **res, const PushFilterOps *ops, void *init_arg, int pushf_create(PushFilter **res, const PushFilterOps *ops, void *init_arg,
PushFilter *next); PushFilter *next);
int pushf_write(PushFilter *mp, const uint8 *data, int len); int pushf_write(PushFilter *mp, const uint8 *data, int len);
void pushf_free_all(PushFilter *mp); void pushf_free_all(PushFilter *mp);
void pushf_free(PushFilter *mp); void pushf_free(PushFilter *mp);
@ -102,11 +102,11 @@ int pushf_create_mbuf_writer(PushFilter **mp_p, MBuf *mbuf);
/* /*
* Pull filter * Pull filter
*/ */
int pullf_create(PullFilter **res, const PullFilterOps *ops, int pullf_create(PullFilter **res, const PullFilterOps *ops,
void *init_arg, PullFilter *src); void *init_arg, PullFilter *src);
int pullf_read(PullFilter *mp, int len, uint8 **data_p); int pullf_read(PullFilter *mp, int len, uint8 **data_p);
int pullf_read_max(PullFilter *mp, int len, int pullf_read_max(PullFilter *mp, int len,
uint8 **data_p, uint8 *tmpbuf); uint8 **data_p, uint8 *tmpbuf);
void pullf_free(PullFilter *mp); void pullf_free(PullFilter *mp);
int pullf_read_fixed(PullFilter *src, int len, uint8 *dst); int pullf_read_fixed(PullFilter *src, int len, uint8 *dst);

View File

@ -811,8 +811,8 @@ parse_literal_data(PGP_Context *ctx, MBuf *dst, PullFilter *pkt)
} }
/* process_data_packets and parse_compressed_data call each other */ /* process_data_packets and parse_compressed_data call each other */
static int process_data_packets(PGP_Context *ctx, MBuf *dst, static int process_data_packets(PGP_Context *ctx, MBuf *dst,
PullFilter *src, int allow_compr, int need_mdc); PullFilter *src, int allow_compr, int need_mdc);
static int static int
parse_compressed_data(PGP_Context *ctx, MBuf *dst, PullFilter *pkt) parse_compressed_data(PGP_Context *ctx, MBuf *dst, PullFilter *pkt)

View File

@ -261,8 +261,8 @@ int pgp_set_unicode_mode(PGP_Context *ctx, int mode);
int pgp_get_unicode_mode(PGP_Context *ctx); int pgp_get_unicode_mode(PGP_Context *ctx);
int pgp_set_symkey(PGP_Context *ctx, const uint8 *key, int klen); int pgp_set_symkey(PGP_Context *ctx, const uint8 *key, int klen);
int pgp_set_pubkey(PGP_Context *ctx, MBuf *keypkt, int pgp_set_pubkey(PGP_Context *ctx, MBuf *keypkt,
const uint8 *key, int klen, int pubtype); const uint8 *key, int klen, int pubtype);
int pgp_get_keyid(MBuf *pgp_data, char *dst); int pgp_get_keyid(MBuf *pgp_data, char *dst);
@ -278,17 +278,17 @@ int pgp_s2k_read(PullFilter *src, PGP_S2K *s2k);
int pgp_s2k_process(PGP_S2K *s2k, int cipher, const uint8 *key, int klen); int pgp_s2k_process(PGP_S2K *s2k, int cipher, const uint8 *key, int klen);
typedef struct PGP_CFB PGP_CFB; typedef struct PGP_CFB PGP_CFB;
int pgp_cfb_create(PGP_CFB **ctx_p, int algo, int pgp_cfb_create(PGP_CFB **ctx_p, int algo,
const uint8 *key, int key_len, int recync, uint8 *iv); const uint8 *key, int key_len, int recync, uint8 *iv);
void pgp_cfb_free(PGP_CFB *ctx); void pgp_cfb_free(PGP_CFB *ctx);
int pgp_cfb_encrypt(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst); int pgp_cfb_encrypt(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst);
int pgp_cfb_decrypt(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst); int pgp_cfb_decrypt(PGP_CFB *ctx, const uint8 *data, int len, uint8 *dst);
void pgp_armor_encode(const uint8 *src, unsigned len, StringInfo dst, void pgp_armor_encode(const uint8 *src, unsigned len, StringInfo dst,
int num_headers, char **keys, char **values); int num_headers, char **keys, char **values);
int pgp_armor_decode(const uint8 *src, int len, StringInfo dst); int pgp_armor_decode(const uint8 *src, int len, StringInfo dst);
int pgp_extract_armor_headers(const uint8 *src, unsigned len, int pgp_extract_armor_headers(const uint8 *src, unsigned len,
int *nheaders, char ***keys, char ***values); int *nheaders, char ***keys, char ***values);
int pgp_compress_filter(PushFilter **res, PGP_Context *ctx, PushFilter *dst); int pgp_compress_filter(PushFilter **res, PGP_Context *ctx, PushFilter *dst);
int pgp_decompress_filter(PullFilter **res, PGP_Context *ctx, PullFilter *src); int pgp_decompress_filter(PullFilter **res, PGP_Context *ctx, PullFilter *src);
@ -298,10 +298,10 @@ void pgp_key_free(PGP_PubKey *pk);
int _pgp_read_public_key(PullFilter *pkt, PGP_PubKey **pk_p); int _pgp_read_public_key(PullFilter *pkt, PGP_PubKey **pk_p);
int pgp_parse_pubenc_sesskey(PGP_Context *ctx, PullFilter *pkt); int pgp_parse_pubenc_sesskey(PGP_Context *ctx, PullFilter *pkt);
int pgp_create_pkt_reader(PullFilter **pf_p, PullFilter *src, int len, int pgp_create_pkt_reader(PullFilter **pf_p, PullFilter *src, int len,
int pkttype, PGP_Context *ctx); int pkttype, PGP_Context *ctx);
int pgp_parse_pkt_hdr(PullFilter *src, uint8 *tag, int *len_p, int pgp_parse_pkt_hdr(PullFilter *src, uint8 *tag, int *len_p,
int allow_ctx); int allow_ctx);
int pgp_skip_packet(PullFilter *pkt); int pgp_skip_packet(PullFilter *pkt);
int pgp_expect_packet_end(PullFilter *pkt); int pgp_expect_packet_end(PullFilter *pkt);
@ -317,10 +317,10 @@ int pgp_mpi_write(PushFilter *dst, PGP_MPI *n);
int pgp_mpi_hash(PX_MD *md, PGP_MPI *n); int pgp_mpi_hash(PX_MD *md, PGP_MPI *n);
unsigned pgp_mpi_cksum(unsigned cksum, PGP_MPI *n); unsigned pgp_mpi_cksum(unsigned cksum, PGP_MPI *n);
int pgp_elgamal_encrypt(PGP_PubKey *pk, PGP_MPI *m, int pgp_elgamal_encrypt(PGP_PubKey *pk, PGP_MPI *m,
PGP_MPI **c1, PGP_MPI **c2); PGP_MPI **c1, PGP_MPI **c2);
int pgp_elgamal_decrypt(PGP_PubKey *pk, PGP_MPI *c1, PGP_MPI *c2, int pgp_elgamal_decrypt(PGP_PubKey *pk, PGP_MPI *c1, PGP_MPI *c2,
PGP_MPI **m); PGP_MPI **m);
int pgp_rsa_encrypt(PGP_PubKey *pk, PGP_MPI *m, PGP_MPI **c); int pgp_rsa_encrypt(PGP_PubKey *pk, PGP_MPI *m, PGP_MPI **c);
int pgp_rsa_decrypt(PGP_PubKey *pk, PGP_MPI *c, PGP_MPI **m); int pgp_rsa_decrypt(PGP_PubKey *pk, PGP_MPI *c, PGP_MPI **m);

View File

@ -56,27 +56,27 @@ int px_gen_salt(const char *salt_type, char *dst, int rounds);
*/ */
/* crypt-gensalt.c */ /* crypt-gensalt.c */
char *_crypt_gensalt_traditional_rn(unsigned long count, char *_crypt_gensalt_traditional_rn(unsigned long count,
const char *input, int size, char *output, int output_size); const char *input, int size, char *output, int output_size);
char *_crypt_gensalt_extended_rn(unsigned long count, char *_crypt_gensalt_extended_rn(unsigned long count,
const char *input, int size, char *output, int output_size); const char *input, int size, char *output, int output_size);
char *_crypt_gensalt_md5_rn(unsigned long count, char *_crypt_gensalt_md5_rn(unsigned long count,
const char *input, int size, char *output, int output_size); const char *input, int size, char *output, int output_size);
char *_crypt_gensalt_blowfish_rn(unsigned long count, char *_crypt_gensalt_blowfish_rn(unsigned long count,
const char *input, int size, char *output, int output_size); const char *input, int size, char *output, int output_size);
/* disable 'extended DES crypt' */ /* disable 'extended DES crypt' */
/* #define DISABLE_XDES */ /* #define DISABLE_XDES */
/* crypt-blowfish.c */ /* crypt-blowfish.c */
char *_crypt_blowfish_rn(const char *key, const char *setting, char *_crypt_blowfish_rn(const char *key, const char *setting,
char *output, int size); char *output, int size);
/* crypt-des.c */ /* crypt-des.c */
char *px_crypt_des(const char *key, const char *setting); char *px_crypt_des(const char *key, const char *setting);
/* crypt-md5.c */ /* crypt-md5.c */
char *px_crypt_md5(const char *pw, const char *salt, char *px_crypt_md5(const char *pw, const char *salt,
char *dst, unsigned dstlen); char *dst, unsigned dstlen);
#endif /* _PX_CRYPT_H */ #endif /* _PX_CRYPT_H */

View File

@ -66,22 +66,22 @@ typedef void (*pgstat_page) (pgstattuple_type *, Relation, BlockNumber,
BufferAccessStrategy); BufferAccessStrategy);
static Datum build_pgstattuple_type(pgstattuple_type *stat, static Datum build_pgstattuple_type(pgstattuple_type *stat,
FunctionCallInfo fcinfo); FunctionCallInfo fcinfo);
static Datum pgstat_relation(Relation rel, FunctionCallInfo fcinfo); static Datum pgstat_relation(Relation rel, FunctionCallInfo fcinfo);
static Datum pgstat_heap(Relation rel, FunctionCallInfo fcinfo); static Datum pgstat_heap(Relation rel, FunctionCallInfo fcinfo);
static void pgstat_btree_page(pgstattuple_type *stat, static void pgstat_btree_page(pgstattuple_type *stat,
Relation rel, BlockNumber blkno, Relation rel, BlockNumber blkno,
BufferAccessStrategy bstrategy); BufferAccessStrategy bstrategy);
static void pgstat_hash_page(pgstattuple_type *stat, static void pgstat_hash_page(pgstattuple_type *stat,
Relation rel, BlockNumber blkno, Relation rel, BlockNumber blkno,
BufferAccessStrategy bstrategy); BufferAccessStrategy bstrategy);
static void pgstat_gist_page(pgstattuple_type *stat, static void pgstat_gist_page(pgstattuple_type *stat,
Relation rel, BlockNumber blkno, Relation rel, BlockNumber blkno,
BufferAccessStrategy bstrategy); BufferAccessStrategy bstrategy);
static Datum pgstat_index(Relation rel, BlockNumber start, static Datum pgstat_index(Relation rel, BlockNumber start,
pgstat_page pagefn, FunctionCallInfo fcinfo); pgstat_page pagefn, FunctionCallInfo fcinfo);
static void pgstat_index_page(pgstattuple_type *stat, Page page, static void pgstat_index_page(pgstattuple_type *stat, Page page,
OffsetNumber minoff, OffsetNumber maxoff); OffsetNumber minoff, OffsetNumber maxoff);
/* /*
* build_pgstattuple_type -- build a pgstattuple_type tuple * build_pgstattuple_type -- build a pgstattuple_type tuple

View File

@ -81,16 +81,16 @@ static void do_sql_command(PGconn *conn, const char *sql);
static void begin_remote_xact(ConnCacheEntry *entry); static void begin_remote_xact(ConnCacheEntry *entry);
static void pgfdw_xact_callback(XactEvent event, void *arg); static void pgfdw_xact_callback(XactEvent event, void *arg);
static void pgfdw_subxact_callback(SubXactEvent event, static void pgfdw_subxact_callback(SubXactEvent event,
SubTransactionId mySubid, SubTransactionId mySubid,
SubTransactionId parentSubid, SubTransactionId parentSubid,
void *arg); void *arg);
static void pgfdw_inval_callback(Datum arg, int cacheid, uint32 hashvalue); static void pgfdw_inval_callback(Datum arg, int cacheid, uint32 hashvalue);
static void pgfdw_reject_incomplete_xact_state_change(ConnCacheEntry *entry); static void pgfdw_reject_incomplete_xact_state_change(ConnCacheEntry *entry);
static bool pgfdw_cancel_query(PGconn *conn); static bool pgfdw_cancel_query(PGconn *conn);
static bool pgfdw_exec_cleanup_query(PGconn *conn, const char *query, static bool pgfdw_exec_cleanup_query(PGconn *conn, const char *query,
bool ignore_errors); bool ignore_errors);
static bool pgfdw_get_cleanup_result(PGconn *conn, TimestampTz endtime, static bool pgfdw_get_cleanup_result(PGconn *conn, TimestampTz endtime,
PGresult **result); PGresult **result);
/* /*

View File

@ -116,34 +116,34 @@ typedef struct deparse_expr_cxt
* remote server. * remote server.
*/ */
static bool foreign_expr_walker(Node *node, static bool foreign_expr_walker(Node *node,
foreign_glob_cxt *glob_cxt, foreign_glob_cxt *glob_cxt,
foreign_loc_cxt *outer_cxt); foreign_loc_cxt *outer_cxt);
static char *deparse_type_name(Oid type_oid, int32 typemod); static char *deparse_type_name(Oid type_oid, int32 typemod);
/* /*
* Functions to construct string representation of a node tree. * Functions to construct string representation of a node tree.
*/ */
static void deparseTargetList(StringInfo buf, static void deparseTargetList(StringInfo buf,
RangeTblEntry *rte, RangeTblEntry *rte,
Index rtindex, Index rtindex,
Relation rel, Relation rel,
bool is_returning, bool is_returning,
Bitmapset *attrs_used, Bitmapset *attrs_used,
bool qualify_col, bool qualify_col,
List **retrieved_attrs); List **retrieved_attrs);
static void deparseExplicitTargetList(List *tlist, static void deparseExplicitTargetList(List *tlist,
bool is_returning, bool is_returning,
List **retrieved_attrs, List **retrieved_attrs,
deparse_expr_cxt *context); deparse_expr_cxt *context);
static void deparseSubqueryTargetList(deparse_expr_cxt *context); static void deparseSubqueryTargetList(deparse_expr_cxt *context);
static void deparseReturningList(StringInfo buf, RangeTblEntry *rte, static void deparseReturningList(StringInfo buf, RangeTblEntry *rte,
Index rtindex, Relation rel, Index rtindex, Relation rel,
bool trig_after_row, bool trig_after_row,
List *withCheckOptionList, List *withCheckOptionList,
List *returningList, List *returningList,
List **retrieved_attrs); List **retrieved_attrs);
static void deparseColumnRef(StringInfo buf, int varno, int varattno, static void deparseColumnRef(StringInfo buf, int varno, int varattno,
RangeTblEntry *rte, bool qualify_col); RangeTblEntry *rte, bool qualify_col);
static void deparseRelation(StringInfo buf, Relation rel); static void deparseRelation(StringInfo buf, Relation rel);
static void deparseExpr(Expr *expr, deparse_expr_cxt *context); static void deparseExpr(Expr *expr, deparse_expr_cxt *context);
static void deparseVar(Var *node, deparse_expr_cxt *context); static void deparseVar(Var *node, deparse_expr_cxt *context);
@ -155,45 +155,45 @@ static void deparseOpExpr(OpExpr *node, deparse_expr_cxt *context);
static void deparseOperatorName(StringInfo buf, Form_pg_operator opform); static void deparseOperatorName(StringInfo buf, Form_pg_operator opform);
static void deparseDistinctExpr(DistinctExpr *node, deparse_expr_cxt *context); static void deparseDistinctExpr(DistinctExpr *node, deparse_expr_cxt *context);
static void deparseScalarArrayOpExpr(ScalarArrayOpExpr *node, static void deparseScalarArrayOpExpr(ScalarArrayOpExpr *node,
deparse_expr_cxt *context); deparse_expr_cxt *context);
static void deparseRelabelType(RelabelType *node, deparse_expr_cxt *context); static void deparseRelabelType(RelabelType *node, deparse_expr_cxt *context);
static void deparseBoolExpr(BoolExpr *node, deparse_expr_cxt *context); static void deparseBoolExpr(BoolExpr *node, deparse_expr_cxt *context);
static void deparseNullTest(NullTest *node, deparse_expr_cxt *context); static void deparseNullTest(NullTest *node, deparse_expr_cxt *context);
static void deparseArrayExpr(ArrayExpr *node, deparse_expr_cxt *context); static void deparseArrayExpr(ArrayExpr *node, deparse_expr_cxt *context);
static void printRemoteParam(int paramindex, Oid paramtype, int32 paramtypmod, static void printRemoteParam(int paramindex, Oid paramtype, int32 paramtypmod,
deparse_expr_cxt *context); deparse_expr_cxt *context);
static void printRemotePlaceholder(Oid paramtype, int32 paramtypmod, static void printRemotePlaceholder(Oid paramtype, int32 paramtypmod,
deparse_expr_cxt *context); deparse_expr_cxt *context);
static void deparseSelectSql(List *tlist, bool is_subquery, List **retrieved_attrs, static void deparseSelectSql(List *tlist, bool is_subquery, List **retrieved_attrs,
deparse_expr_cxt *context); deparse_expr_cxt *context);
static void deparseLockingClause(deparse_expr_cxt *context); static void deparseLockingClause(deparse_expr_cxt *context);
static void appendOrderByClause(List *pathkeys, bool has_final_sort, static void appendOrderByClause(List *pathkeys, bool has_final_sort,
deparse_expr_cxt *context); deparse_expr_cxt *context);
static void appendLimitClause(deparse_expr_cxt *context); static void appendLimitClause(deparse_expr_cxt *context);
static void appendConditions(List *exprs, deparse_expr_cxt *context); static void appendConditions(List *exprs, deparse_expr_cxt *context);
static void deparseFromExprForRel(StringInfo buf, PlannerInfo *root, static void deparseFromExprForRel(StringInfo buf, PlannerInfo *root,
RelOptInfo *foreignrel, bool use_alias, RelOptInfo *foreignrel, bool use_alias,
Index ignore_rel, List **ignore_conds, Index ignore_rel, List **ignore_conds,
List **params_list); List **params_list);
static void deparseFromExpr(List *quals, deparse_expr_cxt *context); static void deparseFromExpr(List *quals, deparse_expr_cxt *context);
static void deparseRangeTblRef(StringInfo buf, PlannerInfo *root, static void deparseRangeTblRef(StringInfo buf, PlannerInfo *root,
RelOptInfo *foreignrel, bool make_subquery, RelOptInfo *foreignrel, bool make_subquery,
Index ignore_rel, List **ignore_conds, List **params_list); Index ignore_rel, List **ignore_conds, List **params_list);
static void deparseAggref(Aggref *node, deparse_expr_cxt *context); static void deparseAggref(Aggref *node, deparse_expr_cxt *context);
static void appendGroupByClause(List *tlist, deparse_expr_cxt *context); static void appendGroupByClause(List *tlist, deparse_expr_cxt *context);
static void appendAggOrderBy(List *orderList, List *targetList, static void appendAggOrderBy(List *orderList, List *targetList,
deparse_expr_cxt *context); deparse_expr_cxt *context);
static void appendFunctionName(Oid funcid, deparse_expr_cxt *context); static void appendFunctionName(Oid funcid, deparse_expr_cxt *context);
static Node *deparseSortGroupClause(Index ref, List *tlist, bool force_colno, static Node *deparseSortGroupClause(Index ref, List *tlist, bool force_colno,
deparse_expr_cxt *context); deparse_expr_cxt *context);
/* /*
* Helper functions * Helper functions
*/ */
static bool is_subquery_var(Var *node, RelOptInfo *foreignrel, static bool is_subquery_var(Var *node, RelOptInfo *foreignrel,
int *relno, int *colno); int *relno, int *colno);
static void get_relation_column_alias_ids(Var *node, RelOptInfo *foreignrel, static void get_relation_column_alias_ids(Var *node, RelOptInfo *foreignrel,
int *relno, int *colno); int *relno, int *colno);
/* /*

View File

@ -309,199 +309,199 @@ PG_FUNCTION_INFO_V1(postgres_fdw_handler);
* FDW callback routines * FDW callback routines
*/ */
static void postgresGetForeignRelSize(PlannerInfo *root, static void postgresGetForeignRelSize(PlannerInfo *root,
RelOptInfo *baserel, RelOptInfo *baserel,
Oid foreigntableid); Oid foreigntableid);
static void postgresGetForeignPaths(PlannerInfo *root, static void postgresGetForeignPaths(PlannerInfo *root,
RelOptInfo *baserel, RelOptInfo *baserel,
Oid foreigntableid); Oid foreigntableid);
static ForeignScan *postgresGetForeignPlan(PlannerInfo *root, static ForeignScan *postgresGetForeignPlan(PlannerInfo *root,
RelOptInfo *foreignrel, RelOptInfo *foreignrel,
Oid foreigntableid, Oid foreigntableid,
ForeignPath *best_path, ForeignPath *best_path,
List *tlist, List *tlist,
List *scan_clauses, List *scan_clauses,
Plan *outer_plan); Plan *outer_plan);
static void postgresBeginForeignScan(ForeignScanState *node, int eflags); static void postgresBeginForeignScan(ForeignScanState *node, int eflags);
static TupleTableSlot *postgresIterateForeignScan(ForeignScanState *node); static TupleTableSlot *postgresIterateForeignScan(ForeignScanState *node);
static void postgresReScanForeignScan(ForeignScanState *node); static void postgresReScanForeignScan(ForeignScanState *node);
static void postgresEndForeignScan(ForeignScanState *node); static void postgresEndForeignScan(ForeignScanState *node);
static void postgresAddForeignUpdateTargets(Query *parsetree, static void postgresAddForeignUpdateTargets(Query *parsetree,
RangeTblEntry *target_rte, RangeTblEntry *target_rte,
Relation target_relation); Relation target_relation);
static List *postgresPlanForeignModify(PlannerInfo *root, static List *postgresPlanForeignModify(PlannerInfo *root,
ModifyTable *plan, ModifyTable *plan,
Index resultRelation, Index resultRelation,
int subplan_index); int subplan_index);
static void postgresBeginForeignModify(ModifyTableState *mtstate, static void postgresBeginForeignModify(ModifyTableState *mtstate,
ResultRelInfo *resultRelInfo, ResultRelInfo *resultRelInfo,
List *fdw_private, List *fdw_private,
int subplan_index, int subplan_index,
int eflags); int eflags);
static TupleTableSlot *postgresExecForeignInsert(EState *estate, static TupleTableSlot *postgresExecForeignInsert(EState *estate,
ResultRelInfo *resultRelInfo, ResultRelInfo *resultRelInfo,
TupleTableSlot *slot, TupleTableSlot *slot,
TupleTableSlot *planSlot); TupleTableSlot *planSlot);
static TupleTableSlot *postgresExecForeignUpdate(EState *estate, static TupleTableSlot *postgresExecForeignUpdate(EState *estate,
ResultRelInfo *resultRelInfo, ResultRelInfo *resultRelInfo,
TupleTableSlot *slot, TupleTableSlot *slot,
TupleTableSlot *planSlot); TupleTableSlot *planSlot);
static TupleTableSlot *postgresExecForeignDelete(EState *estate, static TupleTableSlot *postgresExecForeignDelete(EState *estate,
ResultRelInfo *resultRelInfo, ResultRelInfo *resultRelInfo,
TupleTableSlot *slot, TupleTableSlot *slot,
TupleTableSlot *planSlot); TupleTableSlot *planSlot);
static void postgresEndForeignModify(EState *estate, static void postgresEndForeignModify(EState *estate,
ResultRelInfo *resultRelInfo); ResultRelInfo *resultRelInfo);
static void postgresBeginForeignInsert(ModifyTableState *mtstate, static void postgresBeginForeignInsert(ModifyTableState *mtstate,
ResultRelInfo *resultRelInfo); ResultRelInfo *resultRelInfo);
static void postgresEndForeignInsert(EState *estate, static void postgresEndForeignInsert(EState *estate,
ResultRelInfo *resultRelInfo); ResultRelInfo *resultRelInfo);
static int postgresIsForeignRelUpdatable(Relation rel); static int postgresIsForeignRelUpdatable(Relation rel);
static bool postgresPlanDirectModify(PlannerInfo *root, static bool postgresPlanDirectModify(PlannerInfo *root,
ModifyTable *plan, ModifyTable *plan,
Index resultRelation, Index resultRelation,
int subplan_index); int subplan_index);
static void postgresBeginDirectModify(ForeignScanState *node, int eflags); static void postgresBeginDirectModify(ForeignScanState *node, int eflags);
static TupleTableSlot *postgresIterateDirectModify(ForeignScanState *node); static TupleTableSlot *postgresIterateDirectModify(ForeignScanState *node);
static void postgresEndDirectModify(ForeignScanState *node); static void postgresEndDirectModify(ForeignScanState *node);
static void postgresExplainForeignScan(ForeignScanState *node, static void postgresExplainForeignScan(ForeignScanState *node,
ExplainState *es); ExplainState *es);
static void postgresExplainForeignModify(ModifyTableState *mtstate, static void postgresExplainForeignModify(ModifyTableState *mtstate,
ResultRelInfo *rinfo, ResultRelInfo *rinfo,
List *fdw_private, List *fdw_private,
int subplan_index, int subplan_index,
ExplainState *es); ExplainState *es);
static void postgresExplainDirectModify(ForeignScanState *node, static void postgresExplainDirectModify(ForeignScanState *node,
ExplainState *es); ExplainState *es);
static bool postgresAnalyzeForeignTable(Relation relation, static bool postgresAnalyzeForeignTable(Relation relation,
AcquireSampleRowsFunc *func, AcquireSampleRowsFunc *func,
BlockNumber *totalpages); BlockNumber *totalpages);
static List *postgresImportForeignSchema(ImportForeignSchemaStmt *stmt, static List *postgresImportForeignSchema(ImportForeignSchemaStmt *stmt,
Oid serverOid); Oid serverOid);
static void postgresGetForeignJoinPaths(PlannerInfo *root, static void postgresGetForeignJoinPaths(PlannerInfo *root,
RelOptInfo *joinrel, RelOptInfo *joinrel,
RelOptInfo *outerrel, RelOptInfo *outerrel,
RelOptInfo *innerrel, RelOptInfo *innerrel,
JoinType jointype, JoinType jointype,
JoinPathExtraData *extra); JoinPathExtraData *extra);
static bool postgresRecheckForeignScan(ForeignScanState *node, static bool postgresRecheckForeignScan(ForeignScanState *node,
TupleTableSlot *slot); TupleTableSlot *slot);
static void postgresGetForeignUpperPaths(PlannerInfo *root, static void postgresGetForeignUpperPaths(PlannerInfo *root,
UpperRelationKind stage, UpperRelationKind stage,
RelOptInfo *input_rel, RelOptInfo *input_rel,
RelOptInfo *output_rel, RelOptInfo *output_rel,
void *extra); void *extra);
/* /*
* Helper functions * Helper functions
*/ */
static void estimate_path_cost_size(PlannerInfo *root, static void estimate_path_cost_size(PlannerInfo *root,
RelOptInfo *foreignrel, RelOptInfo *foreignrel,
List *param_join_conds, List *param_join_conds,
List *pathkeys, List *pathkeys,
PgFdwPathExtraData *fpextra, PgFdwPathExtraData *fpextra,
double *p_rows, int *p_width, double *p_rows, int *p_width,
Cost *p_startup_cost, Cost *p_total_cost); Cost *p_startup_cost, Cost *p_total_cost);
static void get_remote_estimate(const char *sql, static void get_remote_estimate(const char *sql,
PGconn *conn, PGconn *conn,
double *rows, double *rows,
int *width, int *width,
Cost *startup_cost, Cost *startup_cost,
Cost *total_cost); Cost *total_cost);
static void adjust_foreign_grouping_path_cost(PlannerInfo *root, static void adjust_foreign_grouping_path_cost(PlannerInfo *root,
List *pathkeys, List *pathkeys,
double retrieved_rows, double retrieved_rows,
double width, double width,
double limit_tuples, double limit_tuples,
Cost *p_startup_cost, Cost *p_startup_cost,
Cost *p_run_cost); Cost *p_run_cost);
static bool ec_member_matches_foreign(PlannerInfo *root, RelOptInfo *rel, static bool ec_member_matches_foreign(PlannerInfo *root, RelOptInfo *rel,
EquivalenceClass *ec, EquivalenceMember *em, EquivalenceClass *ec, EquivalenceMember *em,
void *arg); void *arg);
static void create_cursor(ForeignScanState *node); static void create_cursor(ForeignScanState *node);
static void fetch_more_data(ForeignScanState *node); static void fetch_more_data(ForeignScanState *node);
static void close_cursor(PGconn *conn, unsigned int cursor_number); static void close_cursor(PGconn *conn, unsigned int cursor_number);
static PgFdwModifyState *create_foreign_modify(EState *estate, static PgFdwModifyState *create_foreign_modify(EState *estate,
RangeTblEntry *rte, RangeTblEntry *rte,
ResultRelInfo *resultRelInfo, ResultRelInfo *resultRelInfo,
CmdType operation, CmdType operation,
Plan *subplan, Plan *subplan,
char *query, char *query,
List *target_attrs, List *target_attrs,
bool has_returning, bool has_returning,
List *retrieved_attrs); List *retrieved_attrs);
static TupleTableSlot *execute_foreign_modify(EState *estate, static TupleTableSlot *execute_foreign_modify(EState *estate,
ResultRelInfo *resultRelInfo, ResultRelInfo *resultRelInfo,
CmdType operation, CmdType operation,
TupleTableSlot *slot, TupleTableSlot *slot,
TupleTableSlot *planSlot); TupleTableSlot *planSlot);
static void prepare_foreign_modify(PgFdwModifyState *fmstate); static void prepare_foreign_modify(PgFdwModifyState *fmstate);
static const char **convert_prep_stmt_params(PgFdwModifyState *fmstate, static const char **convert_prep_stmt_params(PgFdwModifyState *fmstate,
ItemPointer tupleid, ItemPointer tupleid,
TupleTableSlot *slot); TupleTableSlot *slot);
static void store_returning_result(PgFdwModifyState *fmstate, static void store_returning_result(PgFdwModifyState *fmstate,
TupleTableSlot *slot, PGresult *res); TupleTableSlot *slot, PGresult *res);
static void finish_foreign_modify(PgFdwModifyState *fmstate); static void finish_foreign_modify(PgFdwModifyState *fmstate);
static List *build_remote_returning(Index rtindex, Relation rel, static List *build_remote_returning(Index rtindex, Relation rel,
List *returningList); List *returningList);
static void rebuild_fdw_scan_tlist(ForeignScan *fscan, List *tlist); static void rebuild_fdw_scan_tlist(ForeignScan *fscan, List *tlist);
static void execute_dml_stmt(ForeignScanState *node); static void execute_dml_stmt(ForeignScanState *node);
static TupleTableSlot *get_returning_data(ForeignScanState *node); static TupleTableSlot *get_returning_data(ForeignScanState *node);
static void init_returning_filter(PgFdwDirectModifyState *dmstate, static void init_returning_filter(PgFdwDirectModifyState *dmstate,
List *fdw_scan_tlist, List *fdw_scan_tlist,
Index rtindex); Index rtindex);
static TupleTableSlot *apply_returning_filter(PgFdwDirectModifyState *dmstate, static TupleTableSlot *apply_returning_filter(PgFdwDirectModifyState *dmstate,
TupleTableSlot *slot, TupleTableSlot *slot,
EState *estate); EState *estate);
static void prepare_query_params(PlanState *node, static void prepare_query_params(PlanState *node,
List *fdw_exprs, List *fdw_exprs,
int numParams, int numParams,
FmgrInfo **param_flinfo, FmgrInfo **param_flinfo,
List **param_exprs, List **param_exprs,
const char ***param_values); const char ***param_values);
static void process_query_params(ExprContext *econtext, static void process_query_params(ExprContext *econtext,
FmgrInfo *param_flinfo, FmgrInfo *param_flinfo,
List *param_exprs, List *param_exprs,
const char **param_values); const char **param_values);
static int postgresAcquireSampleRowsFunc(Relation relation, int elevel, static int postgresAcquireSampleRowsFunc(Relation relation, int elevel,
HeapTuple *rows, int targrows, HeapTuple *rows, int targrows,
double *totalrows, double *totalrows,
double *totaldeadrows); double *totaldeadrows);
static void analyze_row_processor(PGresult *res, int row, static void analyze_row_processor(PGresult *res, int row,
PgFdwAnalyzeState *astate); PgFdwAnalyzeState *astate);
static HeapTuple make_tuple_from_result_row(PGresult *res, static HeapTuple make_tuple_from_result_row(PGresult *res,
int row, int row,
Relation rel, Relation rel,
AttInMetadata *attinmeta, AttInMetadata *attinmeta,
List *retrieved_attrs, List *retrieved_attrs,
ForeignScanState *fsstate, ForeignScanState *fsstate,
MemoryContext temp_context); MemoryContext temp_context);
static void conversion_error_callback(void *arg); static void conversion_error_callback(void *arg);
static bool foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, static bool foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel,
JoinType jointype, RelOptInfo *outerrel, RelOptInfo *innerrel, JoinType jointype, RelOptInfo *outerrel, RelOptInfo *innerrel,
JoinPathExtraData *extra); JoinPathExtraData *extra);
static bool foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel, static bool foreign_grouping_ok(PlannerInfo *root, RelOptInfo *grouped_rel,
Node *havingQual); Node *havingQual);
static List *get_useful_pathkeys_for_relation(PlannerInfo *root, static List *get_useful_pathkeys_for_relation(PlannerInfo *root,
RelOptInfo *rel); RelOptInfo *rel);
static List *get_useful_ecs_for_relation(PlannerInfo *root, RelOptInfo *rel); static List *get_useful_ecs_for_relation(PlannerInfo *root, RelOptInfo *rel);
static void add_paths_with_pathkeys_for_rel(PlannerInfo *root, RelOptInfo *rel, static void add_paths_with_pathkeys_for_rel(PlannerInfo *root, RelOptInfo *rel,
Path *epq_path); Path *epq_path);
static void add_foreign_grouping_paths(PlannerInfo *root, static void add_foreign_grouping_paths(PlannerInfo *root,
RelOptInfo *input_rel, RelOptInfo *input_rel,
RelOptInfo *grouped_rel, RelOptInfo *grouped_rel,
GroupPathExtraData *extra); GroupPathExtraData *extra);
static void add_foreign_ordered_paths(PlannerInfo *root, static void add_foreign_ordered_paths(PlannerInfo *root,
RelOptInfo *input_rel, RelOptInfo *input_rel,
RelOptInfo *ordered_rel); RelOptInfo *ordered_rel);
static void add_foreign_final_paths(PlannerInfo *root, static void add_foreign_final_paths(PlannerInfo *root,
RelOptInfo *input_rel, RelOptInfo *input_rel,
RelOptInfo *final_rel, RelOptInfo *final_rel,
FinalPathExtraData *extra); FinalPathExtraData *extra);
static void apply_server_options(PgFdwRelationInfo *fpinfo); static void apply_server_options(PgFdwRelationInfo *fpinfo);
static void apply_table_options(PgFdwRelationInfo *fpinfo); static void apply_table_options(PgFdwRelationInfo *fpinfo);
static void merge_fdw_options(PgFdwRelationInfo *fpinfo, static void merge_fdw_options(PgFdwRelationInfo *fpinfo,
const PgFdwRelationInfo *fpinfo_o, const PgFdwRelationInfo *fpinfo_o,
const PgFdwRelationInfo *fpinfo_i); const PgFdwRelationInfo *fpinfo_i);
/* /*

View File

@ -128,72 +128,72 @@ extern unsigned int GetPrepStmtNumber(PGconn *conn);
extern PGresult *pgfdw_get_result(PGconn *conn, const char *query); extern PGresult *pgfdw_get_result(PGconn *conn, const char *query);
extern PGresult *pgfdw_exec_query(PGconn *conn, const char *query); extern PGresult *pgfdw_exec_query(PGconn *conn, const char *query);
extern void pgfdw_report_error(int elevel, PGresult *res, PGconn *conn, extern void pgfdw_report_error(int elevel, PGresult *res, PGconn *conn,
bool clear, const char *sql); bool clear, const char *sql);
/* in option.c */ /* in option.c */
extern int ExtractConnectionOptions(List *defelems, extern int ExtractConnectionOptions(List *defelems,
const char **keywords, const char **keywords,
const char **values); const char **values);
extern List *ExtractExtensionList(const char *extensionsString, extern List *ExtractExtensionList(const char *extensionsString,
bool warnOnMissing); bool warnOnMissing);
/* in deparse.c */ /* in deparse.c */
extern void classifyConditions(PlannerInfo *root, extern void classifyConditions(PlannerInfo *root,
RelOptInfo *baserel, RelOptInfo *baserel,
List *input_conds, List *input_conds,
List **remote_conds, List **remote_conds,
List **local_conds); List **local_conds);
extern bool is_foreign_expr(PlannerInfo *root, extern bool is_foreign_expr(PlannerInfo *root,
RelOptInfo *baserel, RelOptInfo *baserel,
Expr *expr); Expr *expr);
extern bool is_foreign_param(PlannerInfo *root, extern bool is_foreign_param(PlannerInfo *root,
RelOptInfo *baserel, RelOptInfo *baserel,
Expr *expr); Expr *expr);
extern void deparseInsertSql(StringInfo buf, RangeTblEntry *rte, extern void deparseInsertSql(StringInfo buf, RangeTblEntry *rte,
Index rtindex, Relation rel, Index rtindex, Relation rel,
List *targetAttrs, bool doNothing, List *targetAttrs, bool doNothing,
List *withCheckOptionList, List *returningList, List *withCheckOptionList, List *returningList,
List **retrieved_attrs); List **retrieved_attrs);
extern void deparseUpdateSql(StringInfo buf, RangeTblEntry *rte, extern void deparseUpdateSql(StringInfo buf, RangeTblEntry *rte,
Index rtindex, Relation rel, Index rtindex, Relation rel,
List *targetAttrs, List *targetAttrs,
List *withCheckOptionList, List *returningList, List *withCheckOptionList, List *returningList,
List **retrieved_attrs); List **retrieved_attrs);
extern void deparseDirectUpdateSql(StringInfo buf, PlannerInfo *root, extern void deparseDirectUpdateSql(StringInfo buf, PlannerInfo *root,
Index rtindex, Relation rel, Index rtindex, Relation rel,
RelOptInfo *foreignrel, RelOptInfo *foreignrel,
List *targetlist, List *targetlist,
List *targetAttrs, List *targetAttrs,
List *remote_conds, List *remote_conds,
List **params_list, List **params_list,
List *returningList, List *returningList,
List **retrieved_attrs); List **retrieved_attrs);
extern void deparseDeleteSql(StringInfo buf, RangeTblEntry *rte, extern void deparseDeleteSql(StringInfo buf, RangeTblEntry *rte,
Index rtindex, Relation rel, Index rtindex, Relation rel,
List *returningList, List *returningList,
List **retrieved_attrs); List **retrieved_attrs);
extern void deparseDirectDeleteSql(StringInfo buf, PlannerInfo *root, extern void deparseDirectDeleteSql(StringInfo buf, PlannerInfo *root,
Index rtindex, Relation rel, Index rtindex, Relation rel,
RelOptInfo *foreignrel, RelOptInfo *foreignrel,
List *remote_conds, List *remote_conds,
List **params_list, List **params_list,
List *returningList, List *returningList,
List **retrieved_attrs); List **retrieved_attrs);
extern void deparseAnalyzeSizeSql(StringInfo buf, Relation rel); extern void deparseAnalyzeSizeSql(StringInfo buf, Relation rel);
extern void deparseAnalyzeSql(StringInfo buf, Relation rel, extern void deparseAnalyzeSql(StringInfo buf, Relation rel,
List **retrieved_attrs); List **retrieved_attrs);
extern void deparseStringLiteral(StringInfo buf, const char *val); extern void deparseStringLiteral(StringInfo buf, const char *val);
extern Expr *find_em_expr_for_rel(EquivalenceClass *ec, RelOptInfo *rel); extern Expr *find_em_expr_for_rel(EquivalenceClass *ec, RelOptInfo *rel);
extern Expr *find_em_expr_for_input_target(PlannerInfo *root, extern Expr *find_em_expr_for_input_target(PlannerInfo *root,
EquivalenceClass *ec, EquivalenceClass *ec,
PathTarget *target); PathTarget *target);
extern List *build_tlist_to_deparse(RelOptInfo *foreignrel); extern List *build_tlist_to_deparse(RelOptInfo *foreignrel);
extern void deparseSelectStmtForRel(StringInfo buf, PlannerInfo *root, extern void deparseSelectStmtForRel(StringInfo buf, PlannerInfo *root,
RelOptInfo *foreignrel, List *tlist, RelOptInfo *foreignrel, List *tlist,
List *remote_conds, List *pathkeys, List *remote_conds, List *pathkeys,
bool has_final_sort, bool has_limit, bool has_final_sort, bool has_limit,
bool is_subquery, bool is_subquery,
List **retrieved_attrs, List **params_list); List **retrieved_attrs, List **params_list);
extern const char *get_jointype_name(JoinType jointype); extern const char *get_jointype_name(JoinType jointype);
/* in shippable.c */ /* in shippable.c */

View File

@ -226,43 +226,43 @@ extern int sepgsql_set_mode(int new_mode);
extern bool sepgsql_getenforce(void); extern bool sepgsql_getenforce(void);
extern void sepgsql_audit_log(bool denied, extern void sepgsql_audit_log(bool denied,
const char *scontext, const char *scontext,
const char *tcontext, const char *tcontext,
uint16 tclass, uint16 tclass,
uint32 audited, uint32 audited,
const char *audit_name); const char *audit_name);
extern void sepgsql_compute_avd(const char *scontext, extern void sepgsql_compute_avd(const char *scontext,
const char *tcontext, const char *tcontext,
uint16 tclass, uint16 tclass,
struct av_decision *avd); struct av_decision *avd);
extern char *sepgsql_compute_create(const char *scontext, extern char *sepgsql_compute_create(const char *scontext,
const char *tcontext, const char *tcontext,
uint16 tclass, uint16 tclass,
const char *objname); const char *objname);
extern bool sepgsql_check_perms(const char *scontext, extern bool sepgsql_check_perms(const char *scontext,
const char *tcontext, const char *tcontext,
uint16 tclass, uint16 tclass,
uint32 required, uint32 required,
const char *audit_name, const char *audit_name,
bool abort_on_violation); bool abort_on_violation);
/* /*
* uavc.c * uavc.c
*/ */
#define SEPGSQL_AVC_NOAUDIT ((void *)(-1)) #define SEPGSQL_AVC_NOAUDIT ((void *)(-1))
extern bool sepgsql_avc_check_perms_label(const char *tcontext, extern bool sepgsql_avc_check_perms_label(const char *tcontext,
uint16 tclass, uint16 tclass,
uint32 required, uint32 required,
const char *audit_name, const char *audit_name,
bool abort_on_violation); bool abort_on_violation);
extern bool sepgsql_avc_check_perms(const ObjectAddress *tobject, extern bool sepgsql_avc_check_perms(const ObjectAddress *tobject,
uint16 tclass, uint16 tclass,
uint32 required, uint32 required,
const char *audit_name, const char *audit_name,
bool abort_on_violation); bool abort_on_violation);
extern char *sepgsql_avc_trusted_proc(Oid functionId); extern char *sepgsql_avc_trusted_proc(Oid functionId);
extern void sepgsql_avc_init(void); extern void sepgsql_avc_init(void);
@ -274,7 +274,7 @@ extern void sepgsql_init_client_label(void);
extern char *sepgsql_get_label(Oid relOid, Oid objOid, int32 subId); extern char *sepgsql_get_label(Oid relOid, Oid objOid, int32 subId);
extern void sepgsql_object_relabel(const ObjectAddress *object, extern void sepgsql_object_relabel(const ObjectAddress *object,
const char *seclabel); const char *seclabel);
/* /*
* dml.c * dml.c
@ -285,7 +285,7 @@ extern bool sepgsql_dml_privileges(List *rangeTabls, bool abort_on_violation);
* database.c * database.c
*/ */
extern void sepgsql_database_post_create(Oid databaseId, extern void sepgsql_database_post_create(Oid databaseId,
const char *dtemplate); const char *dtemplate);
extern void sepgsql_database_drop(Oid databaseId); extern void sepgsql_database_drop(Oid databaseId);
extern void sepgsql_database_relabel(Oid databaseId, const char *seclabel); extern void sepgsql_database_relabel(Oid databaseId, const char *seclabel);
extern void sepgsql_database_setattr(Oid databaseId); extern void sepgsql_database_setattr(Oid databaseId);
@ -308,7 +308,7 @@ extern void sepgsql_schema_rename(Oid namespaceId);
extern void sepgsql_attribute_post_create(Oid relOid, AttrNumber attnum); extern void sepgsql_attribute_post_create(Oid relOid, AttrNumber attnum);
extern void sepgsql_attribute_drop(Oid relOid, AttrNumber attnum); extern void sepgsql_attribute_drop(Oid relOid, AttrNumber attnum);
extern void sepgsql_attribute_relabel(Oid relOid, AttrNumber attnum, extern void sepgsql_attribute_relabel(Oid relOid, AttrNumber attnum,
const char *seclabel); const char *seclabel);
extern void sepgsql_attribute_setattr(Oid relOid, AttrNumber attnum); extern void sepgsql_attribute_setattr(Oid relOid, AttrNumber attnum);
extern void sepgsql_relation_post_create(Oid relOid); extern void sepgsql_relation_post_create(Oid relOid);
extern void sepgsql_relation_drop(Oid relOid); extern void sepgsql_relation_drop(Oid relOid);

View File

@ -48,41 +48,41 @@ PG_MODULE_MAGIC;
static HTAB *load_categories_hash(char *cats_sql, MemoryContext per_query_ctx); static HTAB *load_categories_hash(char *cats_sql, MemoryContext per_query_ctx);
static Tuplestorestate *get_crosstab_tuplestore(char *sql, static Tuplestorestate *get_crosstab_tuplestore(char *sql,
HTAB *crosstab_hash, HTAB *crosstab_hash,
TupleDesc tupdesc, TupleDesc tupdesc,
MemoryContext per_query_ctx, MemoryContext per_query_ctx,
bool randomAccess); bool randomAccess);
static void validateConnectbyTupleDesc(TupleDesc tupdesc, bool show_branch, bool show_serial); static void validateConnectbyTupleDesc(TupleDesc tupdesc, bool show_branch, bool show_serial);
static bool compatCrosstabTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2); static bool compatCrosstabTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2);
static void compatConnectbyTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2); static void compatConnectbyTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2);
static void get_normal_pair(float8 *x1, float8 *x2); static void get_normal_pair(float8 *x1, float8 *x2);
static Tuplestorestate *connectby(char *relname, static Tuplestorestate *connectby(char *relname,
char *key_fld, char *key_fld,
char *parent_key_fld, char *parent_key_fld,
char *orderby_fld, char *orderby_fld,
char *branch_delim, char *branch_delim,
char *start_with, char *start_with,
int max_depth, int max_depth,
bool show_branch, bool show_branch,
bool show_serial, bool show_serial,
MemoryContext per_query_ctx, MemoryContext per_query_ctx,
bool randomAccess, bool randomAccess,
AttInMetadata *attinmeta); AttInMetadata *attinmeta);
static void build_tuplestore_recursively(char *key_fld, static void build_tuplestore_recursively(char *key_fld,
char *parent_key_fld, char *parent_key_fld,
char *relname, char *relname,
char *orderby_fld, char *orderby_fld,
char *branch_delim, char *branch_delim,
char *start_with, char *start_with,
char *branch, char *branch,
int level, int level,
int *serial, int *serial,
int max_depth, int max_depth,
bool show_branch, bool show_branch,
bool show_serial, bool show_serial,
MemoryContext per_query_ctx, MemoryContext per_query_ctx,
AttInMetadata *attinmeta, AttInMetadata *attinmeta,
Tuplestorestate *tupstore); Tuplestorestate *tupstore);
typedef struct typedef struct
{ {

View File

@ -39,29 +39,29 @@ typedef struct
} TestDecodingData; } TestDecodingData;
static void pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt, static void pg_decode_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
bool is_init); bool is_init);
static void pg_decode_shutdown(LogicalDecodingContext *ctx); static void pg_decode_shutdown(LogicalDecodingContext *ctx);
static void pg_decode_begin_txn(LogicalDecodingContext *ctx, static void pg_decode_begin_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn); ReorderBufferTXN *txn);
static void pg_output_begin(LogicalDecodingContext *ctx, static void pg_output_begin(LogicalDecodingContext *ctx,
TestDecodingData *data, TestDecodingData *data,
ReorderBufferTXN *txn, ReorderBufferTXN *txn,
bool last_write); bool last_write);
static void pg_decode_commit_txn(LogicalDecodingContext *ctx, static void pg_decode_commit_txn(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr commit_lsn); ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
static void pg_decode_change(LogicalDecodingContext *ctx, static void pg_decode_change(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, Relation rel, ReorderBufferTXN *txn, Relation rel,
ReorderBufferChange *change); ReorderBufferChange *change);
static void pg_decode_truncate(LogicalDecodingContext *ctx, static void pg_decode_truncate(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, ReorderBufferTXN *txn,
int nrelations, Relation relations[], int nrelations, Relation relations[],
ReorderBufferChange *change); ReorderBufferChange *change);
static bool pg_decode_filter(LogicalDecodingContext *ctx, static bool pg_decode_filter(LogicalDecodingContext *ctx,
RepOriginId origin_id); RepOriginId origin_id);
static void pg_decode_message(LogicalDecodingContext *ctx, static void pg_decode_message(LogicalDecodingContext *ctx,
ReorderBufferTXN *txn, XLogRecPtr message_lsn, ReorderBufferTXN *txn, XLogRecPtr message_lsn,
bool transactional, const char *prefix, bool transactional, const char *prefix,
Size sz, const char *message); Size sz, const char *message);
void void
_PG_init(void) _PG_init(void)

View File

@ -55,20 +55,20 @@ typedef struct
} SystemRowsSamplerData; } SystemRowsSamplerData;
static void system_rows_samplescangetsamplesize(PlannerInfo *root, static void system_rows_samplescangetsamplesize(PlannerInfo *root,
RelOptInfo *baserel, RelOptInfo *baserel,
List *paramexprs, List *paramexprs,
BlockNumber *pages, BlockNumber *pages,
double *tuples); double *tuples);
static void system_rows_initsamplescan(SampleScanState *node, static void system_rows_initsamplescan(SampleScanState *node,
int eflags); int eflags);
static void system_rows_beginsamplescan(SampleScanState *node, static void system_rows_beginsamplescan(SampleScanState *node,
Datum *params, Datum *params,
int nparams, int nparams,
uint32 seed); uint32 seed);
static BlockNumber system_rows_nextsampleblock(SampleScanState *node, BlockNumber nblocks); static BlockNumber system_rows_nextsampleblock(SampleScanState *node, BlockNumber nblocks);
static OffsetNumber system_rows_nextsampletuple(SampleScanState *node, static OffsetNumber system_rows_nextsampletuple(SampleScanState *node,
BlockNumber blockno, BlockNumber blockno,
OffsetNumber maxoffset); OffsetNumber maxoffset);
static uint32 random_relative_prime(uint32 n, SamplerRandomState randstate); static uint32 random_relative_prime(uint32 n, SamplerRandomState randstate);

View File

@ -55,20 +55,20 @@ typedef struct
} SystemTimeSamplerData; } SystemTimeSamplerData;
static void system_time_samplescangetsamplesize(PlannerInfo *root, static void system_time_samplescangetsamplesize(PlannerInfo *root,
RelOptInfo *baserel, RelOptInfo *baserel,
List *paramexprs, List *paramexprs,
BlockNumber *pages, BlockNumber *pages,
double *tuples); double *tuples);
static void system_time_initsamplescan(SampleScanState *node, static void system_time_initsamplescan(SampleScanState *node,
int eflags); int eflags);
static void system_time_beginsamplescan(SampleScanState *node, static void system_time_beginsamplescan(SampleScanState *node,
Datum *params, Datum *params,
int nparams, int nparams,
uint32 seed); uint32 seed);
static BlockNumber system_time_nextsampleblock(SampleScanState *node, BlockNumber nblocks); static BlockNumber system_time_nextsampleblock(SampleScanState *node, BlockNumber nblocks);
static OffsetNumber system_time_nextsampletuple(SampleScanState *node, static OffsetNumber system_time_nextsampletuple(SampleScanState *node,
BlockNumber blockno, BlockNumber blockno,
OffsetNumber maxoffset); OffsetNumber maxoffset);
static uint32 random_relative_prime(uint32 n, SamplerRandomState randstate); static uint32 random_relative_prime(uint32 n, SamplerRandomState randstate);

View File

@ -41,16 +41,16 @@ typedef struct
/* local declarations */ /* local declarations */
static xmlChar *pgxmlNodeSetToText(xmlNodeSetPtr nodeset, static xmlChar *pgxmlNodeSetToText(xmlNodeSetPtr nodeset,
xmlChar *toptagname, xmlChar *septagname, xmlChar *toptagname, xmlChar *septagname,
xmlChar *plainsep); xmlChar *plainsep);
static text *pgxml_result_to_text(xmlXPathObjectPtr res, xmlChar *toptag, static text *pgxml_result_to_text(xmlXPathObjectPtr res, xmlChar *toptag,
xmlChar *septag, xmlChar *plainsep); xmlChar *septag, xmlChar *plainsep);
static xmlChar *pgxml_texttoxmlchar(text *textstring); static xmlChar *pgxml_texttoxmlchar(text *textstring);
static xmlXPathObjectPtr pgxml_xpath(text *document, xmlChar *xpath, static xmlXPathObjectPtr pgxml_xpath(text *document, xmlChar *xpath,
xpath_workspace *workspace); xpath_workspace *workspace);
static void cleanup_workspace(xpath_workspace *workspace); static void cleanup_workspace(xpath_workspace *workspace);

View File

@ -67,13 +67,13 @@ typedef struct BrinOpaque
#define BRIN_ALL_BLOCKRANGES InvalidBlockNumber #define BRIN_ALL_BLOCKRANGES InvalidBlockNumber
static BrinBuildState *initialize_brin_buildstate(Relation idxRel, static BrinBuildState *initialize_brin_buildstate(Relation idxRel,
BrinRevmap *revmap, BlockNumber pagesPerRange); BrinRevmap *revmap, BlockNumber pagesPerRange);
static void terminate_brin_buildstate(BrinBuildState *state); static void terminate_brin_buildstate(BrinBuildState *state);
static void brinsummarize(Relation index, Relation heapRel, BlockNumber pageRange, static void brinsummarize(Relation index, Relation heapRel, BlockNumber pageRange,
bool include_partial, double *numSummarized, double *numExisting); bool include_partial, double *numSummarized, double *numExisting);
static void form_and_insert_tuple(BrinBuildState *state); static void form_and_insert_tuple(BrinBuildState *state);
static void union_tuples(BrinDesc *bdesc, BrinMemTuple *a, static void union_tuples(BrinDesc *bdesc, BrinMemTuple *a,
BrinTuple *b); BrinTuple *b);
static void brin_vacuum_scan(Relation idxrel, BufferAccessStrategy strategy); static void brin_vacuum_scan(Relation idxrel, BufferAccessStrategy strategy);

View File

@ -82,9 +82,9 @@ typedef struct InclusionOpaque
} InclusionOpaque; } InclusionOpaque;
static FmgrInfo *inclusion_get_procinfo(BrinDesc *bdesc, uint16 attno, static FmgrInfo *inclusion_get_procinfo(BrinDesc *bdesc, uint16 attno,
uint16 procnum); uint16 procnum);
static FmgrInfo *inclusion_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno, static FmgrInfo *inclusion_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno,
Oid subtype, uint16 strategynum); Oid subtype, uint16 strategynum);
/* /*

View File

@ -30,7 +30,7 @@ typedef struct MinmaxOpaque
} MinmaxOpaque; } MinmaxOpaque;
static FmgrInfo *minmax_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno, static FmgrInfo *minmax_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno,
Oid subtype, uint16 strategynum); Oid subtype, uint16 strategynum);
Datum Datum

View File

@ -34,7 +34,7 @@
MAXALIGN(sizeof(BrinSpecialSpace)))) MAXALIGN(sizeof(BrinSpecialSpace))))
static Buffer brin_getinsertbuffer(Relation irel, Buffer oldbuf, Size itemsz, static Buffer brin_getinsertbuffer(Relation irel, Buffer oldbuf, Size itemsz,
bool *extended); bool *extended);
static Size br_page_get_freespace(Page page); static Size br_page_get_freespace(Page page);
static void brin_initialize_empty_new_buffer(Relation idxrel, Buffer buffer); static void brin_initialize_empty_new_buffer(Relation idxrel, Buffer buffer);

View File

@ -57,10 +57,10 @@ struct BrinRevmap
static BlockNumber revmap_get_blkno(BrinRevmap *revmap, static BlockNumber revmap_get_blkno(BrinRevmap *revmap,
BlockNumber heapBlk); BlockNumber heapBlk);
static Buffer revmap_get_buffer(BrinRevmap *revmap, BlockNumber heapBlk); static Buffer revmap_get_buffer(BrinRevmap *revmap, BlockNumber heapBlk);
static BlockNumber revmap_extend_and_get_blkno(BrinRevmap *revmap, static BlockNumber revmap_extend_and_get_blkno(BrinRevmap *revmap,
BlockNumber heapBlk); BlockNumber heapBlk);
static void revmap_physical_extend(BrinRevmap *revmap); static void revmap_physical_extend(BrinRevmap *revmap);
/* /*

View File

@ -40,8 +40,8 @@
static inline void brin_deconstruct_tuple(BrinDesc *brdesc, static inline void brin_deconstruct_tuple(BrinDesc *brdesc,
char *tp, bits8 *nullbits, bool nulls, char *tp, bits8 *nullbits, bool nulls,
Datum *values, bool *allnulls, bool *hasnulls); Datum *values, bool *allnulls, bool *hasnulls);
/* /*

View File

@ -25,7 +25,7 @@
static void printtup_startup(DestReceiver *self, int operation, static void printtup_startup(DestReceiver *self, int operation,
TupleDesc typeinfo); TupleDesc typeinfo);
static bool printtup(TupleTableSlot *slot, DestReceiver *self); static bool printtup(TupleTableSlot *slot, DestReceiver *self);
static bool printtup_20(TupleTableSlot *slot, DestReceiver *self); static bool printtup_20(TupleTableSlot *slot, DestReceiver *self);
static bool printtup_internal_20(TupleTableSlot *slot, DestReceiver *self); static bool printtup_internal_20(TupleTableSlot *slot, DestReceiver *self);
@ -33,9 +33,9 @@ static void printtup_shutdown(DestReceiver *self);
static void printtup_destroy(DestReceiver *self); static void printtup_destroy(DestReceiver *self);
static void SendRowDescriptionCols_2(StringInfo buf, TupleDesc typeinfo, static void SendRowDescriptionCols_2(StringInfo buf, TupleDesc typeinfo,
List *targetlist, int16 *formats); List *targetlist, int16 *formats);
static void SendRowDescriptionCols_3(StringInfo buf, TupleDesc typeinfo, static void SendRowDescriptionCols_3(StringInfo buf, TupleDesc typeinfo,
List *targetlist, int16 *formats); List *targetlist, int16 *formats);
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* printtup / debugtup support * printtup / debugtup support

View File

@ -475,7 +475,7 @@ static bool need_initialization = true;
static void initialize_reloptions(void); static void initialize_reloptions(void);
static void parse_one_reloption(relopt_value *option, char *text_str, static void parse_one_reloption(relopt_value *option, char *text_str,
int text_len, bool validate); int text_len, bool validate);
/* /*
* initialize_reloptions * initialize_reloptions

View File

@ -24,10 +24,10 @@
static void ginFindParents(GinBtree btree, GinBtreeStack *stack); static void ginFindParents(GinBtree btree, GinBtreeStack *stack);
static bool ginPlaceToPage(GinBtree btree, GinBtreeStack *stack, static bool ginPlaceToPage(GinBtree btree, GinBtreeStack *stack,
void *insertdata, BlockNumber updateblkno, void *insertdata, BlockNumber updateblkno,
Buffer childbuf, GinStatsData *buildStats); Buffer childbuf, GinStatsData *buildStats);
static void ginFinishSplit(GinBtree btree, GinBtreeStack *stack, static void ginFinishSplit(GinBtree btree, GinBtreeStack *stack,
bool freestack, GinStatsData *buildStats); bool freestack, GinStatsData *buildStats);
/* /*
* Lock buffer by needed method for search. * Lock buffer by needed method for search.

View File

@ -104,20 +104,20 @@ typedef struct
static ItemPointer dataLeafPageGetUncompressed(Page page, int *nitems); static ItemPointer dataLeafPageGetUncompressed(Page page, int *nitems);
static void dataSplitPageInternal(GinBtree btree, Buffer origbuf, static void dataSplitPageInternal(GinBtree btree, Buffer origbuf,
GinBtreeStack *stack, GinBtreeStack *stack,
void *insertdata, BlockNumber updateblkno, void *insertdata, BlockNumber updateblkno,
Page *newlpage, Page *newrpage); Page *newlpage, Page *newrpage);
static disassembledLeaf *disassembleLeaf(Page page); static disassembledLeaf *disassembleLeaf(Page page);
static bool leafRepackItems(disassembledLeaf *leaf, ItemPointer remaining); static bool leafRepackItems(disassembledLeaf *leaf, ItemPointer remaining);
static bool addItemsToLeaf(disassembledLeaf *leaf, ItemPointer newItems, static bool addItemsToLeaf(disassembledLeaf *leaf, ItemPointer newItems,
int nNewItems); int nNewItems);
static void computeLeafRecompressWALData(disassembledLeaf *leaf); static void computeLeafRecompressWALData(disassembledLeaf *leaf);
static void dataPlaceToPageLeafRecompress(Buffer buf, disassembledLeaf *leaf); static void dataPlaceToPageLeafRecompress(Buffer buf, disassembledLeaf *leaf);
static void dataPlaceToPageLeafSplit(disassembledLeaf *leaf, static void dataPlaceToPageLeafSplit(disassembledLeaf *leaf,
ItemPointerData lbound, ItemPointerData rbound, ItemPointerData lbound, ItemPointerData rbound,
Page lpage, Page rpage); Page lpage, Page rpage);
/* /*
* Read TIDs from leaf data page to single uncompressed array. The TIDs are * Read TIDs from leaf data page to single uncompressed array. The TIDs are

View File

@ -21,10 +21,10 @@
#include "utils/rel.h" #include "utils/rel.h"
static void entrySplitPage(GinBtree btree, Buffer origbuf, static void entrySplitPage(GinBtree btree, Buffer origbuf,
GinBtreeStack *stack, GinBtreeStack *stack,
GinBtreeEntryInsertData *insertData, GinBtreeEntryInsertData *insertData,
BlockNumber updateblkno, BlockNumber updateblkno,
Page *newlpage, Page *newrpage); Page *newlpage, Page *newrpage);
/* /*
* Form a tuple for entry tree. * Form a tuple for entry tree.

View File

@ -30,16 +30,16 @@
/* non-export function prototypes */ /* non-export function prototypes */
static void gistfixsplit(GISTInsertState *state, GISTSTATE *giststate); static void gistfixsplit(GISTInsertState *state, GISTSTATE *giststate);
static bool gistinserttuple(GISTInsertState *state, GISTInsertStack *stack, static bool gistinserttuple(GISTInsertState *state, GISTInsertStack *stack,
GISTSTATE *giststate, IndexTuple tuple, OffsetNumber oldoffnum); GISTSTATE *giststate, IndexTuple tuple, OffsetNumber oldoffnum);
static bool gistinserttuples(GISTInsertState *state, GISTInsertStack *stack, static bool gistinserttuples(GISTInsertState *state, GISTInsertStack *stack,
GISTSTATE *giststate, GISTSTATE *giststate,
IndexTuple *tuples, int ntup, OffsetNumber oldoffnum, IndexTuple *tuples, int ntup, OffsetNumber oldoffnum,
Buffer leftchild, Buffer rightchild, Buffer leftchild, Buffer rightchild,
bool unlockbuf, bool unlockleftchild); bool unlockbuf, bool unlockleftchild);
static void gistfinishsplit(GISTInsertState *state, GISTInsertStack *stack, static void gistfinishsplit(GISTInsertState *state, GISTInsertStack *stack,
GISTSTATE *giststate, List *splitinfo, bool releasebuf); GISTSTATE *giststate, List *splitinfo, bool releasebuf);
static void gistprunepage(Relation rel, Page page, Buffer buffer, static void gistprunepage(Relation rel, Page page, Buffer buffer,
Relation heapRel); Relation heapRel);
#define ROTATEDIST(d) do { \ #define ROTATEDIST(d) do { \

View File

@ -80,30 +80,30 @@ typedef struct
static void gistInitBuffering(GISTBuildState *buildstate); static void gistInitBuffering(GISTBuildState *buildstate);
static int calculatePagesPerBuffer(GISTBuildState *buildstate, int levelStep); static int calculatePagesPerBuffer(GISTBuildState *buildstate, int levelStep);
static void gistBuildCallback(Relation index, static void gistBuildCallback(Relation index,
HeapTuple htup, HeapTuple htup,
Datum *values, Datum *values,
bool *isnull, bool *isnull,
bool tupleIsAlive, bool tupleIsAlive,
void *state); void *state);
static void gistBufferingBuildInsert(GISTBuildState *buildstate, static void gistBufferingBuildInsert(GISTBuildState *buildstate,
IndexTuple itup); IndexTuple itup);
static bool gistProcessItup(GISTBuildState *buildstate, IndexTuple itup, static bool gistProcessItup(GISTBuildState *buildstate, IndexTuple itup,
BlockNumber startblkno, int startlevel); BlockNumber startblkno, int startlevel);
static BlockNumber gistbufferinginserttuples(GISTBuildState *buildstate, static BlockNumber gistbufferinginserttuples(GISTBuildState *buildstate,
Buffer buffer, int level, Buffer buffer, int level,
IndexTuple *itup, int ntup, OffsetNumber oldoffnum, IndexTuple *itup, int ntup, OffsetNumber oldoffnum,
BlockNumber parentblk, OffsetNumber downlinkoffnum); BlockNumber parentblk, OffsetNumber downlinkoffnum);
static Buffer gistBufferingFindCorrectParent(GISTBuildState *buildstate, static Buffer gistBufferingFindCorrectParent(GISTBuildState *buildstate,
BlockNumber childblkno, int level, BlockNumber childblkno, int level,
BlockNumber *parentblk, BlockNumber *parentblk,
OffsetNumber *downlinkoffnum); OffsetNumber *downlinkoffnum);
static void gistProcessEmptyingQueue(GISTBuildState *buildstate); static void gistProcessEmptyingQueue(GISTBuildState *buildstate);
static void gistEmptyAllBuffers(GISTBuildState *buildstate); static void gistEmptyAllBuffers(GISTBuildState *buildstate);
static int gistGetMaxLevel(Relation index); static int gistGetMaxLevel(Relation index);
static void gistInitParentMap(GISTBuildState *buildstate); static void gistInitParentMap(GISTBuildState *buildstate);
static void gistMemorizeParent(GISTBuildState *buildstate, BlockNumber child, static void gistMemorizeParent(GISTBuildState *buildstate, BlockNumber child,
BlockNumber parent); BlockNumber parent);
static void gistMemorizeAllDownlinks(GISTBuildState *buildstate, Buffer parent); static void gistMemorizeAllDownlinks(GISTBuildState *buildstate, Buffer parent);
static BlockNumber gistGetParent(GISTBuildState *buildstate, BlockNumber child); static BlockNumber gistGetParent(GISTBuildState *buildstate, BlockNumber child);

View File

@ -25,15 +25,15 @@
static GISTNodeBufferPage *gistAllocateNewPageBuffer(GISTBuildBuffers *gfbb); static GISTNodeBufferPage *gistAllocateNewPageBuffer(GISTBuildBuffers *gfbb);
static void gistAddLoadedBuffer(GISTBuildBuffers *gfbb, static void gistAddLoadedBuffer(GISTBuildBuffers *gfbb,
GISTNodeBuffer *nodeBuffer); GISTNodeBuffer *nodeBuffer);
static void gistLoadNodeBuffer(GISTBuildBuffers *gfbb, static void gistLoadNodeBuffer(GISTBuildBuffers *gfbb,
GISTNodeBuffer *nodeBuffer); GISTNodeBuffer *nodeBuffer);
static void gistUnloadNodeBuffer(GISTBuildBuffers *gfbb, static void gistUnloadNodeBuffer(GISTBuildBuffers *gfbb,
GISTNodeBuffer *nodeBuffer); GISTNodeBuffer *nodeBuffer);
static void gistPlaceItupToPage(GISTNodeBufferPage *pageBuffer, static void gistPlaceItupToPage(GISTNodeBufferPage *pageBuffer,
IndexTuple item); IndexTuple item);
static void gistGetItupFromPage(GISTNodeBufferPage *pageBuffer, static void gistGetItupFromPage(GISTNodeBufferPage *pageBuffer,
IndexTuple *item); IndexTuple *item);
static long gistBuffersGetFreeBlock(GISTBuildBuffers *gfbb); static long gistBuffersGetFreeBlock(GISTBuildBuffers *gfbb);
static void gistBuffersReleaseBlock(GISTBuildBuffers *gfbb, long blocknum); static void gistBuffersReleaseBlock(GISTBuildBuffers *gfbb, long blocknum);

View File

@ -27,9 +27,9 @@
static bool gist_box_leaf_consistent(BOX *key, BOX *query, static bool gist_box_leaf_consistent(BOX *key, BOX *query,
StrategyNumber strategy); StrategyNumber strategy);
static bool rtree_internal_consistent(BOX *key, BOX *query, static bool rtree_internal_consistent(BOX *key, BOX *query,
StrategyNumber strategy); StrategyNumber strategy);
/* Minimum accepted ratio of split */ /* Minimum accepted ratio of split */
#define LIMIT_RATIO 0.3 #define LIMIT_RATIO 0.3

View File

@ -52,14 +52,14 @@ typedef struct
} GistVacState; } GistVacState;
static void gistvacuumscan(IndexVacuumInfo *info, GistBulkDeleteResult *stats, static void gistvacuumscan(IndexVacuumInfo *info, GistBulkDeleteResult *stats,
IndexBulkDeleteCallback callback, void *callback_state); IndexBulkDeleteCallback callback, void *callback_state);
static void gistvacuumpage(GistVacState *vstate, BlockNumber blkno, static void gistvacuumpage(GistVacState *vstate, BlockNumber blkno,
BlockNumber orig_blkno); BlockNumber orig_blkno);
static void gistvacuum_delete_empty_pages(IndexVacuumInfo *info, static void gistvacuum_delete_empty_pages(IndexVacuumInfo *info,
GistBulkDeleteResult *stats); GistBulkDeleteResult *stats);
static bool gistdeletepage(IndexVacuumInfo *info, GistBulkDeleteResult *stats, static bool gistdeletepage(IndexVacuumInfo *info, GistBulkDeleteResult *stats,
Buffer buffer, OffsetNumber downlink, Buffer buffer, OffsetNumber downlink,
Buffer leafBuffer); Buffer leafBuffer);
/* allocate the 'stats' struct that's kept over vacuum stages */ /* allocate the 'stats' struct that's kept over vacuum stages */
static GistBulkDeleteResult * static GistBulkDeleteResult *

View File

@ -43,11 +43,11 @@ typedef struct
} HashBuildState; } HashBuildState;
static void hashbuildCallback(Relation index, static void hashbuildCallback(Relation index,
HeapTuple htup, HeapTuple htup,
Datum *values, Datum *values,
bool *isnull, bool *isnull,
bool tupleIsAlive, bool tupleIsAlive,
void *state); void *state);
/* /*

View File

@ -24,7 +24,7 @@
#include "storage/predicate.h" #include "storage/predicate.h"
static void _hash_vacuum_one_page(Relation rel, Relation hrel, static void _hash_vacuum_one_page(Relation rel, Relation hrel,
Buffer metabuf, Buffer buf); Buffer metabuf, Buffer buf);
/* /*
* _hash_doinsert() -- Handle insertion of a single index tuple. * _hash_doinsert() -- Handle insertion of a single index tuple.

View File

@ -37,14 +37,14 @@
static bool _hash_alloc_buckets(Relation rel, BlockNumber firstblock, static bool _hash_alloc_buckets(Relation rel, BlockNumber firstblock,
uint32 nblocks); uint32 nblocks);
static void _hash_splitbucket(Relation rel, Buffer metabuf, static void _hash_splitbucket(Relation rel, Buffer metabuf,
Bucket obucket, Bucket nbucket, Bucket obucket, Bucket nbucket,
Buffer obuf, Buffer obuf,
Buffer nbuf, Buffer nbuf,
HTAB *htab, HTAB *htab,
uint32 maxbucket, uint32 maxbucket,
uint32 highmask, uint32 lowmask); uint32 highmask, uint32 lowmask);
static void log_split_page(Relation rel, Buffer buf); static void log_split_page(Relation rel, Buffer buf);

View File

@ -22,13 +22,13 @@
#include "storage/predicate.h" #include "storage/predicate.h"
static bool _hash_readpage(IndexScanDesc scan, Buffer *bufP, static bool _hash_readpage(IndexScanDesc scan, Buffer *bufP,
ScanDirection dir); ScanDirection dir);
static int _hash_load_qualified_items(IndexScanDesc scan, Page page, static int _hash_load_qualified_items(IndexScanDesc scan, Page page,
OffsetNumber offnum, ScanDirection dir); OffsetNumber offnum, ScanDirection dir);
static inline void _hash_saveitem(HashScanOpaque so, int itemIndex, static inline void _hash_saveitem(HashScanOpaque so, int itemIndex,
OffsetNumber offnum, IndexTuple itup); OffsetNumber offnum, IndexTuple itup);
static void _hash_readnext(IndexScanDesc scan, Buffer *bufp, static void _hash_readnext(IndexScanDesc scan, Buffer *bufp,
Page *pagep, HashPageOpaque *opaquep); Page *pagep, HashPageOpaque *opaquep);
/* /*
* _hash_next() -- Get the next item in a scan. * _hash_next() -- Get the next item in a scan.

View File

@ -71,39 +71,39 @@
static HeapTuple heap_prepare_insert(Relation relation, HeapTuple tup, static HeapTuple heap_prepare_insert(Relation relation, HeapTuple tup,
TransactionId xid, CommandId cid, int options); TransactionId xid, CommandId cid, int options);
static XLogRecPtr log_heap_update(Relation reln, Buffer oldbuf, static XLogRecPtr log_heap_update(Relation reln, Buffer oldbuf,
Buffer newbuf, HeapTuple oldtup, Buffer newbuf, HeapTuple oldtup,
HeapTuple newtup, HeapTuple old_key_tup, HeapTuple newtup, HeapTuple old_key_tup,
bool all_visible_cleared, bool new_all_visible_cleared); bool all_visible_cleared, bool new_all_visible_cleared);
static Bitmapset *HeapDetermineModifiedColumns(Relation relation, static Bitmapset *HeapDetermineModifiedColumns(Relation relation,
Bitmapset *interesting_cols, Bitmapset *interesting_cols,
HeapTuple oldtup, HeapTuple newtup); HeapTuple oldtup, HeapTuple newtup);
static bool heap_acquire_tuplock(Relation relation, ItemPointer tid, static bool heap_acquire_tuplock(Relation relation, ItemPointer tid,
LockTupleMode mode, LockWaitPolicy wait_policy, LockTupleMode mode, LockWaitPolicy wait_policy,
bool *have_tuple_lock); bool *have_tuple_lock);
static void compute_new_xmax_infomask(TransactionId xmax, uint16 old_infomask, static void compute_new_xmax_infomask(TransactionId xmax, uint16 old_infomask,
uint16 old_infomask2, TransactionId add_to_xmax, uint16 old_infomask2, TransactionId add_to_xmax,
LockTupleMode mode, bool is_update, LockTupleMode mode, bool is_update,
TransactionId *result_xmax, uint16 *result_infomask, TransactionId *result_xmax, uint16 *result_infomask,
uint16 *result_infomask2); uint16 *result_infomask2);
static TM_Result heap_lock_updated_tuple(Relation rel, HeapTuple tuple, static TM_Result heap_lock_updated_tuple(Relation rel, HeapTuple tuple,
ItemPointer ctid, TransactionId xid, ItemPointer ctid, TransactionId xid,
LockTupleMode mode); LockTupleMode mode);
static void GetMultiXactIdHintBits(MultiXactId multi, uint16 *new_infomask, static void GetMultiXactIdHintBits(MultiXactId multi, uint16 *new_infomask,
uint16 *new_infomask2); uint16 *new_infomask2);
static TransactionId MultiXactIdGetUpdateXid(TransactionId xmax, static TransactionId MultiXactIdGetUpdateXid(TransactionId xmax,
uint16 t_infomask); uint16 t_infomask);
static bool DoesMultiXactIdConflict(MultiXactId multi, uint16 infomask, static bool DoesMultiXactIdConflict(MultiXactId multi, uint16 infomask,
LockTupleMode lockmode); LockTupleMode lockmode);
static void MultiXactIdWait(MultiXactId multi, MultiXactStatus status, uint16 infomask, static void MultiXactIdWait(MultiXactId multi, MultiXactStatus status, uint16 infomask,
Relation rel, ItemPointer ctid, XLTW_Oper oper, Relation rel, ItemPointer ctid, XLTW_Oper oper,
int *remaining); int *remaining);
static bool ConditionalMultiXactIdWait(MultiXactId multi, MultiXactStatus status, static bool ConditionalMultiXactIdWait(MultiXactId multi, MultiXactStatus status,
uint16 infomask, Relation rel, int *remaining); uint16 infomask, Relation rel, int *remaining);
static XLogRecPtr log_heap_new_cid(Relation relation, HeapTuple tup); static XLogRecPtr log_heap_new_cid(Relation relation, HeapTuple tup);
static HeapTuple ExtractReplicaIdentity(Relation rel, HeapTuple tup, bool key_modified, static HeapTuple ExtractReplicaIdentity(Relation rel, HeapTuple tup, bool key_modified,
bool *copy); bool *copy);
/* /*

View File

@ -51,12 +51,12 @@
static void reform_and_rewrite_tuple(HeapTuple tuple, static void reform_and_rewrite_tuple(HeapTuple tuple,
Relation OldHeap, Relation NewHeap, Relation OldHeap, Relation NewHeap,
Datum *values, bool *isnull, RewriteState rwstate); Datum *values, bool *isnull, RewriteState rwstate);
static bool SampleHeapTupleVisible(TableScanDesc scan, Buffer buffer, static bool SampleHeapTupleVisible(TableScanDesc scan, Buffer buffer,
HeapTuple tuple, HeapTuple tuple,
OffsetNumber tupoffset); OffsetNumber tupoffset);
static BlockNumber heapam_scan_get_blocks_done(HeapScanDesc hscan); static BlockNumber heapam_scan_get_blocks_done(HeapScanDesc hscan);

View File

@ -43,13 +43,13 @@ typedef struct
} PruneState; } PruneState;
/* Local functions */ /* Local functions */
static int heap_prune_chain(Relation relation, Buffer buffer, static int heap_prune_chain(Relation relation, Buffer buffer,
OffsetNumber rootoffnum, OffsetNumber rootoffnum,
TransactionId OldestXmin, TransactionId OldestXmin,
PruneState *prstate); PruneState *prstate);
static void heap_prune_record_prunable(PruneState *prstate, TransactionId xid); static void heap_prune_record_prunable(PruneState *prstate, TransactionId xid);
static void heap_prune_record_redirect(PruneState *prstate, static void heap_prune_record_redirect(PruneState *prstate,
OffsetNumber offnum, OffsetNumber rdoffnum); OffsetNumber offnum, OffsetNumber rdoffnum);
static void heap_prune_record_dead(PruneState *prstate, OffsetNumber offnum); static void heap_prune_record_dead(PruneState *prstate, OffsetNumber offnum);
static void heap_prune_record_unused(PruneState *prstate, OffsetNumber offnum); static void heap_prune_record_unused(PruneState *prstate, OffsetNumber offnum);

View File

@ -116,7 +116,7 @@ static ss_scan_locations_t *scan_locations;
/* prototypes for internal functions */ /* prototypes for internal functions */
static BlockNumber ss_search(RelFileNode relfilenode, static BlockNumber ss_search(RelFileNode relfilenode,
BlockNumber location, bool set); BlockNumber location, bool set);
/* /*

View File

@ -68,20 +68,20 @@ typedef struct toast_compress_header
static void toast_delete_datum(Relation rel, Datum value, bool is_speculative); static void toast_delete_datum(Relation rel, Datum value, bool is_speculative);
static Datum toast_save_datum(Relation rel, Datum value, static Datum toast_save_datum(Relation rel, Datum value,
struct varlena *oldexternal, int options); struct varlena *oldexternal, int options);
static bool toastrel_valueid_exists(Relation toastrel, Oid valueid); static bool toastrel_valueid_exists(Relation toastrel, Oid valueid);
static bool toastid_valueid_exists(Oid toastrelid, Oid valueid); static bool toastid_valueid_exists(Oid toastrelid, Oid valueid);
static struct varlena *toast_fetch_datum(struct varlena *attr); static struct varlena *toast_fetch_datum(struct varlena *attr);
static struct varlena *toast_fetch_datum_slice(struct varlena *attr, static struct varlena *toast_fetch_datum_slice(struct varlena *attr,
int32 sliceoffset, int32 length); int32 sliceoffset, int32 length);
static struct varlena *toast_decompress_datum(struct varlena *attr); static struct varlena *toast_decompress_datum(struct varlena *attr);
static struct varlena *toast_decompress_datum_slice(struct varlena *attr, int32 slicelength); static struct varlena *toast_decompress_datum_slice(struct varlena *attr, int32 slicelength);
static int toast_open_indexes(Relation toastrel, static int toast_open_indexes(Relation toastrel,
LOCKMODE lock, LOCKMODE lock,
Relation **toastidxs, Relation **toastidxs,
int *num_indexes); int *num_indexes);
static void toast_close_indexes(Relation *toastidxs, int num_indexes, static void toast_close_indexes(Relation *toastidxs, int num_indexes,
LOCKMODE lock); LOCKMODE lock);
static void init_toast_snapshot(Snapshot toast_snapshot); static void init_toast_snapshot(Snapshot toast_snapshot);

View File

@ -151,30 +151,30 @@ static BufferAccessStrategy vac_strategy;
/* non-export function prototypes */ /* non-export function prototypes */
static void lazy_scan_heap(Relation onerel, VacuumParams *params, static void lazy_scan_heap(Relation onerel, VacuumParams *params,
LVRelStats *vacrelstats, Relation *Irel, int nindexes, LVRelStats *vacrelstats, Relation *Irel, int nindexes,
bool aggressive); bool aggressive);
static void lazy_vacuum_heap(Relation onerel, LVRelStats *vacrelstats); static void lazy_vacuum_heap(Relation onerel, LVRelStats *vacrelstats);
static bool lazy_check_needs_freeze(Buffer buf, bool *hastup); static bool lazy_check_needs_freeze(Buffer buf, bool *hastup);
static void lazy_vacuum_index(Relation indrel, static void lazy_vacuum_index(Relation indrel,
IndexBulkDeleteResult **stats, IndexBulkDeleteResult **stats,
LVRelStats *vacrelstats); LVRelStats *vacrelstats);
static void lazy_cleanup_index(Relation indrel, static void lazy_cleanup_index(Relation indrel,
IndexBulkDeleteResult *stats, IndexBulkDeleteResult *stats,
LVRelStats *vacrelstats); LVRelStats *vacrelstats);
static int lazy_vacuum_page(Relation onerel, BlockNumber blkno, Buffer buffer, static int lazy_vacuum_page(Relation onerel, BlockNumber blkno, Buffer buffer,
int tupindex, LVRelStats *vacrelstats, Buffer *vmbuffer); int tupindex, LVRelStats *vacrelstats, Buffer *vmbuffer);
static bool should_attempt_truncation(VacuumParams *params, static bool should_attempt_truncation(VacuumParams *params,
LVRelStats *vacrelstats); LVRelStats *vacrelstats);
static void lazy_truncate_heap(Relation onerel, LVRelStats *vacrelstats); static void lazy_truncate_heap(Relation onerel, LVRelStats *vacrelstats);
static BlockNumber count_nondeletable_pages(Relation onerel, static BlockNumber count_nondeletable_pages(Relation onerel,
LVRelStats *vacrelstats); LVRelStats *vacrelstats);
static void lazy_space_alloc(LVRelStats *vacrelstats, BlockNumber relblocks); static void lazy_space_alloc(LVRelStats *vacrelstats, BlockNumber relblocks);
static void lazy_record_dead_tuple(LVRelStats *vacrelstats, static void lazy_record_dead_tuple(LVRelStats *vacrelstats,
ItemPointer itemptr); ItemPointer itemptr);
static bool lazy_tid_reaped(ItemPointer itemptr, void *state); static bool lazy_tid_reaped(ItemPointer itemptr, void *state);
static int vac_cmp_itemptr(const void *left, const void *right); static int vac_cmp_itemptr(const void *left, const void *right);
static bool heap_page_is_all_visible(Relation rel, Buffer buf, static bool heap_page_is_all_visible(Relation rel, Buffer buf,
TransactionId *visibility_cutoff_xid, bool *all_frozen); TransactionId *visibility_cutoff_xid, bool *all_frozen);
/* /*

View File

@ -99,8 +99,8 @@ do { \
} while(0) } while(0)
static IndexScanDesc index_beginscan_internal(Relation indexRelation, static IndexScanDesc index_beginscan_internal(Relation indexRelation,
int nkeys, int norderbys, Snapshot snapshot, int nkeys, int norderbys, Snapshot snapshot,
ParallelIndexScanDesc pscan, bool temp_snap); ParallelIndexScanDesc pscan, bool temp_snap);
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------

View File

@ -32,29 +32,29 @@
static Buffer _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf); static Buffer _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf);
static TransactionId _bt_check_unique(Relation rel, BTInsertState insertstate, static TransactionId _bt_check_unique(Relation rel, BTInsertState insertstate,
Relation heapRel, Relation heapRel,
IndexUniqueCheck checkUnique, bool *is_unique, IndexUniqueCheck checkUnique, bool *is_unique,
uint32 *speculativeToken); uint32 *speculativeToken);
static OffsetNumber _bt_findinsertloc(Relation rel, static OffsetNumber _bt_findinsertloc(Relation rel,
BTInsertState insertstate, BTInsertState insertstate,
bool checkingunique, bool checkingunique,
BTStack stack, BTStack stack,
Relation heapRel); Relation heapRel);
static void _bt_stepright(Relation rel, BTInsertState insertstate, BTStack stack); static void _bt_stepright(Relation rel, BTInsertState insertstate, BTStack stack);
static void _bt_insertonpg(Relation rel, BTScanInsert itup_key, static void _bt_insertonpg(Relation rel, BTScanInsert itup_key,
Buffer buf, Buffer buf,
Buffer cbuf, Buffer cbuf,
BTStack stack, BTStack stack,
IndexTuple itup, IndexTuple itup,
OffsetNumber newitemoff, OffsetNumber newitemoff,
bool split_only_page); bool split_only_page);
static Buffer _bt_split(Relation rel, BTScanInsert itup_key, Buffer buf, static Buffer _bt_split(Relation rel, BTScanInsert itup_key, Buffer buf,
Buffer cbuf, OffsetNumber newitemoff, Size newitemsz, Buffer cbuf, OffsetNumber newitemoff, Size newitemsz,
IndexTuple newitem); IndexTuple newitem);
static void _bt_insert_parent(Relation rel, Buffer buf, Buffer rbuf, static void _bt_insert_parent(Relation rel, Buffer buf, Buffer rbuf,
BTStack stack, bool is_root, bool is_only); BTStack stack, bool is_root, bool is_only);
static bool _bt_pgaddtup(Page page, Size itemsize, IndexTuple itup, static bool _bt_pgaddtup(Page page, Size itemsize, IndexTuple itup,
OffsetNumber itup_off); OffsetNumber itup_off);
static void _bt_vacuum_one_page(Relation rel, Buffer buffer, Relation heapRel); static void _bt_vacuum_one_page(Relation rel, Buffer buffer, Relation heapRel);
/* /*

View File

@ -37,12 +37,12 @@ static void _bt_cachemetadata(Relation rel, BTMetaPageData *input);
static BTMetaPageData *_bt_getmeta(Relation rel, Buffer metabuf); static BTMetaPageData *_bt_getmeta(Relation rel, Buffer metabuf);
static bool _bt_mark_page_halfdead(Relation rel, Buffer buf, BTStack stack); static bool _bt_mark_page_halfdead(Relation rel, Buffer buf, BTStack stack);
static bool _bt_unlink_halfdead_page(Relation rel, Buffer leafbuf, static bool _bt_unlink_halfdead_page(Relation rel, Buffer leafbuf,
bool *rightsib_empty); bool *rightsib_empty);
static bool _bt_lock_branch_parent(Relation rel, BlockNumber child, static bool _bt_lock_branch_parent(Relation rel, BlockNumber child,
BTStack stack, Buffer *topparent, OffsetNumber *topoff, BTStack stack, Buffer *topparent, OffsetNumber *topoff,
BlockNumber *target, BlockNumber *rightsib); BlockNumber *target, BlockNumber *rightsib);
static void _bt_log_reuse_page(Relation rel, BlockNumber blkno, static void _bt_log_reuse_page(Relation rel, BlockNumber blkno,
TransactionId latestRemovedXid); TransactionId latestRemovedXid);
/* /*
* _bt_initmetapage() -- Fill a page buffer with a correct metapage image * _bt_initmetapage() -- Fill a page buffer with a correct metapage image

View File

@ -93,10 +93,10 @@ typedef struct BTParallelScanDescData *BTParallelScanDesc;
static void btvacuumscan(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, static void btvacuumscan(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
IndexBulkDeleteCallback callback, void *callback_state, IndexBulkDeleteCallback callback, void *callback_state,
BTCycleId cycleid, TransactionId *oldestBtpoXact); BTCycleId cycleid, TransactionId *oldestBtpoXact);
static void btvacuumpage(BTVacState *vstate, BlockNumber blkno, static void btvacuumpage(BTVacState *vstate, BlockNumber blkno,
BlockNumber orig_blkno); BlockNumber orig_blkno);
/* /*

View File

@ -27,13 +27,13 @@
static void _bt_drop_lock_and_maybe_pin(IndexScanDesc scan, BTScanPos sp); static void _bt_drop_lock_and_maybe_pin(IndexScanDesc scan, BTScanPos sp);
static OffsetNumber _bt_binsrch(Relation rel, BTScanInsert key, Buffer buf); static OffsetNumber _bt_binsrch(Relation rel, BTScanInsert key, Buffer buf);
static bool _bt_readpage(IndexScanDesc scan, ScanDirection dir, static bool _bt_readpage(IndexScanDesc scan, ScanDirection dir,
OffsetNumber offnum); OffsetNumber offnum);
static void _bt_saveitem(BTScanOpaque so, int itemIndex, static void _bt_saveitem(BTScanOpaque so, int itemIndex,
OffsetNumber offnum, IndexTuple itup); OffsetNumber offnum, IndexTuple itup);
static bool _bt_steppage(IndexScanDesc scan, ScanDirection dir); static bool _bt_steppage(IndexScanDesc scan, ScanDirection dir);
static bool _bt_readnextpage(IndexScanDesc scan, BlockNumber blkno, ScanDirection dir); static bool _bt_readnextpage(IndexScanDesc scan, BlockNumber blkno, ScanDirection dir);
static bool _bt_parallel_readpage(IndexScanDesc scan, BlockNumber blkno, static bool _bt_parallel_readpage(IndexScanDesc scan, BlockNumber blkno,
ScanDirection dir); ScanDirection dir);
static Buffer _bt_walk_left(Relation rel, Buffer buf, Snapshot snapshot); static Buffer _bt_walk_left(Relation rel, Buffer buf, Snapshot snapshot);
static bool _bt_endpoint(IndexScanDesc scan, ScanDirection dir); static bool _bt_endpoint(IndexScanDesc scan, ScanDirection dir);
static inline void _bt_initialize_more_data(BTScanOpaque so, ScanDirection dir); static inline void _bt_initialize_more_data(BTScanOpaque so, ScanDirection dir);

View File

@ -273,34 +273,34 @@ typedef struct BTWriteState
static double _bt_spools_heapscan(Relation heap, Relation index, static double _bt_spools_heapscan(Relation heap, Relation index,
BTBuildState *buildstate, IndexInfo *indexInfo); BTBuildState *buildstate, IndexInfo *indexInfo);
static void _bt_spooldestroy(BTSpool *btspool); static void _bt_spooldestroy(BTSpool *btspool);
static void _bt_spool(BTSpool *btspool, ItemPointer self, static void _bt_spool(BTSpool *btspool, ItemPointer self,
Datum *values, bool *isnull); Datum *values, bool *isnull);
static void _bt_leafbuild(BTSpool *btspool, BTSpool *btspool2); static void _bt_leafbuild(BTSpool *btspool, BTSpool *btspool2);
static void _bt_build_callback(Relation index, HeapTuple htup, Datum *values, static void _bt_build_callback(Relation index, HeapTuple htup, Datum *values,
bool *isnull, bool tupleIsAlive, void *state); bool *isnull, bool tupleIsAlive, void *state);
static Page _bt_blnewpage(uint32 level); static Page _bt_blnewpage(uint32 level);
static BTPageState *_bt_pagestate(BTWriteState *wstate, uint32 level); static BTPageState *_bt_pagestate(BTWriteState *wstate, uint32 level);
static void _bt_slideleft(Page page); static void _bt_slideleft(Page page);
static void _bt_sortaddtup(Page page, Size itemsize, static void _bt_sortaddtup(Page page, Size itemsize,
IndexTuple itup, OffsetNumber itup_off); IndexTuple itup, OffsetNumber itup_off);
static void _bt_buildadd(BTWriteState *wstate, BTPageState *state, static void _bt_buildadd(BTWriteState *wstate, BTPageState *state,
IndexTuple itup); IndexTuple itup);
static void _bt_uppershutdown(BTWriteState *wstate, BTPageState *state); static void _bt_uppershutdown(BTWriteState *wstate, BTPageState *state);
static void _bt_load(BTWriteState *wstate, static void _bt_load(BTWriteState *wstate,
BTSpool *btspool, BTSpool *btspool2); BTSpool *btspool, BTSpool *btspool2);
static void _bt_begin_parallel(BTBuildState *buildstate, bool isconcurrent, static void _bt_begin_parallel(BTBuildState *buildstate, bool isconcurrent,
int request); int request);
static void _bt_end_parallel(BTLeader *btleader); static void _bt_end_parallel(BTLeader *btleader);
static Size _bt_parallel_estimate_shared(Relation heap, Snapshot snapshot); static Size _bt_parallel_estimate_shared(Relation heap, Snapshot snapshot);
static double _bt_parallel_heapscan(BTBuildState *buildstate, static double _bt_parallel_heapscan(BTBuildState *buildstate,
bool *brokenhotchain); bool *brokenhotchain);
static void _bt_leader_participate_as_worker(BTBuildState *buildstate); static void _bt_leader_participate_as_worker(BTBuildState *buildstate);
static void _bt_parallel_scan_and_sort(BTSpool *btspool, BTSpool *btspool2, static void _bt_parallel_scan_and_sort(BTSpool *btspool, BTSpool *btspool2,
BTShared *btshared, Sharedsort *sharedsort, BTShared *btshared, Sharedsort *sharedsort,
Sharedsort *sharedsort2, int sortmem, Sharedsort *sharedsort2, int sortmem,
bool progress); bool progress);
/* /*

View File

@ -65,25 +65,25 @@ typedef struct
} FindSplitData; } FindSplitData;
static void _bt_recsplitloc(FindSplitData *state, static void _bt_recsplitloc(FindSplitData *state,
OffsetNumber firstoldonright, bool newitemonleft, OffsetNumber firstoldonright, bool newitemonleft,
int olddataitemstoleft, Size firstoldonrightsz); int olddataitemstoleft, Size firstoldonrightsz);
static void _bt_deltasortsplits(FindSplitData *state, double fillfactormult, static void _bt_deltasortsplits(FindSplitData *state, double fillfactormult,
bool usemult); bool usemult);
static int _bt_splitcmp(const void *arg1, const void *arg2); static int _bt_splitcmp(const void *arg1, const void *arg2);
static bool _bt_afternewitemoff(FindSplitData *state, OffsetNumber maxoff, static bool _bt_afternewitemoff(FindSplitData *state, OffsetNumber maxoff,
int leaffillfactor, bool *usemult); int leaffillfactor, bool *usemult);
static bool _bt_adjacenthtid(ItemPointer lowhtid, ItemPointer highhtid); static bool _bt_adjacenthtid(ItemPointer lowhtid, ItemPointer highhtid);
static OffsetNumber _bt_bestsplitloc(FindSplitData *state, int perfectpenalty, static OffsetNumber _bt_bestsplitloc(FindSplitData *state, int perfectpenalty,
bool *newitemonleft); bool *newitemonleft);
static int _bt_strategy(FindSplitData *state, SplitPoint *leftpage, static int _bt_strategy(FindSplitData *state, SplitPoint *leftpage,
SplitPoint *rightpage, FindSplitStrat *strategy); SplitPoint *rightpage, FindSplitStrat *strategy);
static void _bt_interval_edges(FindSplitData *state, static void _bt_interval_edges(FindSplitData *state,
SplitPoint **leftinterval, SplitPoint **rightinterval); SplitPoint **leftinterval, SplitPoint **rightinterval);
static inline int _bt_split_penalty(FindSplitData *state, SplitPoint *split); static inline int _bt_split_penalty(FindSplitData *state, SplitPoint *split);
static inline IndexTuple _bt_split_lastleft(FindSplitData *state, static inline IndexTuple _bt_split_lastleft(FindSplitData *state,
SplitPoint *split); SplitPoint *split);
static inline IndexTuple _bt_split_firstright(FindSplitData *state, static inline IndexTuple _bt_split_firstright(FindSplitData *state,
SplitPoint *split); SplitPoint *split);
/* /*

View File

@ -37,22 +37,22 @@ typedef struct BTSortArrayContext
} BTSortArrayContext; } BTSortArrayContext;
static Datum _bt_find_extreme_element(IndexScanDesc scan, ScanKey skey, static Datum _bt_find_extreme_element(IndexScanDesc scan, ScanKey skey,
StrategyNumber strat, StrategyNumber strat,
Datum *elems, int nelems); Datum *elems, int nelems);
static int _bt_sort_array_elements(IndexScanDesc scan, ScanKey skey, static int _bt_sort_array_elements(IndexScanDesc scan, ScanKey skey,
bool reverse, bool reverse,
Datum *elems, int nelems); Datum *elems, int nelems);
static int _bt_compare_array_elements(const void *a, const void *b, void *arg); static int _bt_compare_array_elements(const void *a, const void *b, void *arg);
static bool _bt_compare_scankey_args(IndexScanDesc scan, ScanKey op, static bool _bt_compare_scankey_args(IndexScanDesc scan, ScanKey op,
ScanKey leftarg, ScanKey rightarg, ScanKey leftarg, ScanKey rightarg,
bool *result); bool *result);
static bool _bt_fix_scankey_strategy(ScanKey skey, int16 *indoption); static bool _bt_fix_scankey_strategy(ScanKey skey, int16 *indoption);
static void _bt_mark_scankey_required(ScanKey skey); static void _bt_mark_scankey_required(ScanKey skey);
static bool _bt_check_rowcompare(ScanKey skey, static bool _bt_check_rowcompare(ScanKey skey,
IndexTuple tuple, int tupnatts, TupleDesc tupdesc, IndexTuple tuple, int tupnatts, TupleDesc tupdesc,
ScanDirection dir, bool *continuescan); ScanDirection dir, bool *continuescan);
static int _bt_keep_natts(Relation rel, IndexTuple lastleft, static int _bt_keep_natts(Relation rel, IndexTuple lastleft,
IndexTuple firstright, BTScanInsert itup_key); IndexTuple firstright, BTScanInsert itup_key);
/* /*

View File

@ -43,19 +43,19 @@ typedef struct
static void bernoulli_samplescangetsamplesize(PlannerInfo *root, static void bernoulli_samplescangetsamplesize(PlannerInfo *root,
RelOptInfo *baserel, RelOptInfo *baserel,
List *paramexprs, List *paramexprs,
BlockNumber *pages, BlockNumber *pages,
double *tuples); double *tuples);
static void bernoulli_initsamplescan(SampleScanState *node, static void bernoulli_initsamplescan(SampleScanState *node,
int eflags); int eflags);
static void bernoulli_beginsamplescan(SampleScanState *node, static void bernoulli_beginsamplescan(SampleScanState *node,
Datum *params, Datum *params,
int nparams, int nparams,
uint32 seed); uint32 seed);
static OffsetNumber bernoulli_nextsampletuple(SampleScanState *node, static OffsetNumber bernoulli_nextsampletuple(SampleScanState *node,
BlockNumber blockno, BlockNumber blockno,
OffsetNumber maxoffset); OffsetNumber maxoffset);
/* /*

View File

@ -45,20 +45,20 @@ typedef struct
static void system_samplescangetsamplesize(PlannerInfo *root, static void system_samplescangetsamplesize(PlannerInfo *root,
RelOptInfo *baserel, RelOptInfo *baserel,
List *paramexprs, List *paramexprs,
BlockNumber *pages, BlockNumber *pages,
double *tuples); double *tuples);
static void system_initsamplescan(SampleScanState *node, static void system_initsamplescan(SampleScanState *node,
int eflags); int eflags);
static void system_beginsamplescan(SampleScanState *node, static void system_beginsamplescan(SampleScanState *node,
Datum *params, Datum *params,
int nparams, int nparams,
uint32 seed); uint32 seed);
static BlockNumber system_nextsampleblock(SampleScanState *node, BlockNumber nblocks); static BlockNumber system_nextsampleblock(SampleScanState *node, BlockNumber nblocks);
static OffsetNumber system_nextsampletuple(SampleScanState *node, static OffsetNumber system_nextsampletuple(SampleScanState *node,
BlockNumber blockno, BlockNumber blockno,
OffsetNumber maxoffset); OffsetNumber maxoffset);
/* /*

View File

@ -92,20 +92,20 @@ static int ZeroCLOGPage(int pageno, bool writeXlog);
static bool CLOGPagePrecedes(int page1, int page2); static bool CLOGPagePrecedes(int page1, int page2);
static void WriteZeroPageXlogRec(int pageno); static void WriteZeroPageXlogRec(int pageno);
static void WriteTruncateXlogRec(int pageno, TransactionId oldestXact, static void WriteTruncateXlogRec(int pageno, TransactionId oldestXact,
Oid oldestXidDb); Oid oldestXidDb);
static void TransactionIdSetPageStatus(TransactionId xid, int nsubxids, static void TransactionIdSetPageStatus(TransactionId xid, int nsubxids,
TransactionId *subxids, XidStatus status, TransactionId *subxids, XidStatus status,
XLogRecPtr lsn, int pageno, XLogRecPtr lsn, int pageno,
bool all_xact_same_page); bool all_xact_same_page);
static void TransactionIdSetStatusBit(TransactionId xid, XidStatus status, static void TransactionIdSetStatusBit(TransactionId xid, XidStatus status,
XLogRecPtr lsn, int slotno); XLogRecPtr lsn, int slotno);
static void set_status_by_pages(int nsubxids, TransactionId *subxids, static void set_status_by_pages(int nsubxids, TransactionId *subxids,
XidStatus status, XLogRecPtr lsn); XidStatus status, XLogRecPtr lsn);
static bool TransactionGroupUpdateXidStatus(TransactionId xid, static bool TransactionGroupUpdateXidStatus(TransactionId xid,
XidStatus status, XLogRecPtr lsn, int pageno); XidStatus status, XLogRecPtr lsn, int pageno);
static void TransactionIdSetPageStatusInternal(TransactionId xid, int nsubxids, static void TransactionIdSetPageStatusInternal(TransactionId xid, int nsubxids,
TransactionId *subxids, XidStatus status, TransactionId *subxids, XidStatus status,
XLogRecPtr lsn, int pageno); XLogRecPtr lsn, int pageno);
/* /*

View File

@ -103,10 +103,10 @@ CommitTimestampShared *commitTsShared;
bool track_commit_timestamp; bool track_commit_timestamp;
static void SetXidCommitTsInPage(TransactionId xid, int nsubxids, static void SetXidCommitTsInPage(TransactionId xid, int nsubxids,
TransactionId *subxids, TimestampTz ts, TransactionId *subxids, TimestampTz ts,
RepOriginId nodeid, int pageno); RepOriginId nodeid, int pageno);
static void TransactionIdSetCommitTs(TransactionId xid, TimestampTz ts, static void TransactionIdSetCommitTs(TransactionId xid, TimestampTz ts,
RepOriginId nodeid, int slotno); RepOriginId nodeid, int slotno);
static void error_commit_ts_disabled(void); static void error_commit_ts_disabled(void);
static int ZeroCommitTsPage(int pageno, bool writeXlog); static int ZeroCommitTsPage(int pageno, bool writeXlog);
static bool CommitTsPagePrecedes(int page1, int page2); static bool CommitTsPagePrecedes(int page1, int page2);
@ -115,8 +115,8 @@ static void DeactivateCommitTs(void);
static void WriteZeroPageXlogRec(int pageno); static void WriteZeroPageXlogRec(int pageno);
static void WriteTruncateXlogRec(int pageno, TransactionId oldestXid); static void WriteTruncateXlogRec(int pageno, TransactionId oldestXid);
static void WriteSetTimestampXlogRec(TransactionId mainxid, int nsubxids, static void WriteSetTimestampXlogRec(TransactionId mainxid, int nsubxids,
TransactionId *subxids, TimestampTz timestamp, TransactionId *subxids, TimestampTz timestamp,
RepOriginId nodeid); RepOriginId nodeid);
/* /*
* TransactionTreeSetCommitTsData * TransactionTreeSetCommitTsData

View File

@ -69,11 +69,11 @@ struct GenericXLogState
}; };
static void writeFragment(PageData *pageData, OffsetNumber offset, static void writeFragment(PageData *pageData, OffsetNumber offset,
OffsetNumber len, const char *data); OffsetNumber len, const char *data);
static void computeRegionDelta(PageData *pageData, static void computeRegionDelta(PageData *pageData,
const char *curpage, const char *targetpage, const char *curpage, const char *targetpage,
int targetStart, int targetEnd, int targetStart, int targetEnd,
int validStart, int validEnd); int validStart, int validEnd);
static void computeDelta(PageData *pageData, Page curpage, Page targetpage); static void computeDelta(PageData *pageData, Page curpage, Page targetpage);
static void applyPageRedo(Page page, const char *delta, Size deltaSize); static void applyPageRedo(Page page, const char *delta, Size deltaSize);

View File

@ -340,7 +340,7 @@ static MemoryContext MXactContext = NULL;
/* internal MultiXactId management */ /* internal MultiXactId management */
static void MultiXactIdSetOldestVisible(void); static void MultiXactIdSetOldestVisible(void);
static void RecordNewMultiXact(MultiXactId multi, MultiXactOffset offset, static void RecordNewMultiXact(MultiXactId multi, MultiXactOffset offset,
int nmembers, MultiXactMember *members); int nmembers, MultiXactMember *members);
static MultiXactId GetNewMultiXactId(int nmembers, MultiXactOffset *offset); static MultiXactId GetNewMultiXactId(int nmembers, MultiXactOffset *offset);
/* MultiXact cache management */ /* MultiXact cache management */
@ -348,7 +348,7 @@ static int mxactMemberComparator(const void *arg1, const void *arg2);
static MultiXactId mXactCacheGetBySet(int nmembers, MultiXactMember *members); static MultiXactId mXactCacheGetBySet(int nmembers, MultiXactMember *members);
static int mXactCacheGetById(MultiXactId multi, MultiXactMember **members); static int mXactCacheGetById(MultiXactId multi, MultiXactMember **members);
static void mXactCachePut(MultiXactId multi, int nmembers, static void mXactCachePut(MultiXactId multi, int nmembers,
MultiXactMember *members); MultiXactMember *members);
static char *mxstatus_to_string(MultiXactStatus status); static char *mxstatus_to_string(MultiXactStatus status);
@ -358,17 +358,17 @@ static int ZeroMultiXactMemberPage(int pageno, bool writeXlog);
static bool MultiXactOffsetPagePrecedes(int page1, int page2); static bool MultiXactOffsetPagePrecedes(int page1, int page2);
static bool MultiXactMemberPagePrecedes(int page1, int page2); static bool MultiXactMemberPagePrecedes(int page1, int page2);
static bool MultiXactOffsetPrecedes(MultiXactOffset offset1, static bool MultiXactOffsetPrecedes(MultiXactOffset offset1,
MultiXactOffset offset2); MultiXactOffset offset2);
static void ExtendMultiXactOffset(MultiXactId multi); static void ExtendMultiXactOffset(MultiXactId multi);
static void ExtendMultiXactMember(MultiXactOffset offset, int nmembers); static void ExtendMultiXactMember(MultiXactOffset offset, int nmembers);
static bool MultiXactOffsetWouldWrap(MultiXactOffset boundary, static bool MultiXactOffsetWouldWrap(MultiXactOffset boundary,
MultiXactOffset start, uint32 distance); MultiXactOffset start, uint32 distance);
static bool SetOffsetVacuumLimit(bool is_startup); static bool SetOffsetVacuumLimit(bool is_startup);
static bool find_multixact_start(MultiXactId multi, MultiXactOffset *result); static bool find_multixact_start(MultiXactId multi, MultiXactOffset *result);
static void WriteMZeroPageXlogRec(int pageno, uint8 info); static void WriteMZeroPageXlogRec(int pageno, uint8 info);
static void WriteMTruncateXlogRec(Oid oldestMultiDB, static void WriteMTruncateXlogRec(Oid oldestMultiDB,
MultiXactId startOff, MultiXactId endOff, MultiXactId startOff, MultiXactId endOff,
MultiXactOffset startMemb, MultiXactOffset endMemb); MultiXactOffset startMemb, MultiXactOffset endMemb);
/* /*

View File

@ -129,12 +129,12 @@ static void SimpleLruWaitIO(SlruCtl ctl, int slotno);
static void SlruInternalWritePage(SlruCtl ctl, int slotno, SlruFlush fdata); static void SlruInternalWritePage(SlruCtl ctl, int slotno, SlruFlush fdata);
static bool SlruPhysicalReadPage(SlruCtl ctl, int pageno, int slotno); static bool SlruPhysicalReadPage(SlruCtl ctl, int pageno, int slotno);
static bool SlruPhysicalWritePage(SlruCtl ctl, int pageno, int slotno, static bool SlruPhysicalWritePage(SlruCtl ctl, int pageno, int slotno,
SlruFlush fdata); SlruFlush fdata);
static void SlruReportIOError(SlruCtl ctl, int pageno, TransactionId xid); static void SlruReportIOError(SlruCtl ctl, int pageno, TransactionId xid);
static int SlruSelectLRUPage(SlruCtl ctl, int pageno); static int SlruSelectLRUPage(SlruCtl ctl, int pageno);
static bool SlruScanDirCbDeleteCutoff(SlruCtl ctl, char *filename, static bool SlruScanDirCbDeleteCutoff(SlruCtl ctl, char *filename,
int segpage, void *data); int segpage, void *data);
static void SlruInternalDeleteSegment(SlruCtl ctl, char *filename); static void SlruInternalDeleteSegment(SlruCtl ctl, char *filename);
/* /*

View File

@ -202,31 +202,31 @@ static GlobalTransaction MyLockedGxact = NULL;
static bool twophaseExitRegistered = false; static bool twophaseExitRegistered = false;
static void RecordTransactionCommitPrepared(TransactionId xid, static void RecordTransactionCommitPrepared(TransactionId xid,
int nchildren, int nchildren,
TransactionId *children, TransactionId *children,
int nrels, int nrels,
RelFileNode *rels, RelFileNode *rels,
int ninvalmsgs, int ninvalmsgs,
SharedInvalidationMessage *invalmsgs, SharedInvalidationMessage *invalmsgs,
bool initfileinval, bool initfileinval,
const char *gid); const char *gid);
static void RecordTransactionAbortPrepared(TransactionId xid, static void RecordTransactionAbortPrepared(TransactionId xid,
int nchildren, int nchildren,
TransactionId *children, TransactionId *children,
int nrels, int nrels,
RelFileNode *rels, RelFileNode *rels,
const char *gid); const char *gid);
static void ProcessRecords(char *bufptr, TransactionId xid, static void ProcessRecords(char *bufptr, TransactionId xid,
const TwoPhaseCallback callbacks[]); const TwoPhaseCallback callbacks[]);
static void RemoveGXact(GlobalTransaction gxact); static void RemoveGXact(GlobalTransaction gxact);
static void XlogReadTwoPhaseData(XLogRecPtr lsn, char **buf, int *len); static void XlogReadTwoPhaseData(XLogRecPtr lsn, char **buf, int *len);
static char *ProcessTwoPhaseBuffer(TransactionId xid, static char *ProcessTwoPhaseBuffer(TransactionId xid,
XLogRecPtr prepare_start_lsn, XLogRecPtr prepare_start_lsn,
bool fromdisk, bool setParent, bool setNextXid); bool fromdisk, bool setParent, bool setNextXid);
static void MarkAsPreparingGuts(GlobalTransaction gxact, TransactionId xid, static void MarkAsPreparingGuts(GlobalTransaction gxact, TransactionId xid,
const char *gid, TimestampTz prepared_at, Oid owner, const char *gid, TimestampTz prepared_at, Oid owner,
Oid databaseid); Oid databaseid);
static void RemoveTwoPhaseFile(TransactionId xid, bool giveWarning); static void RemoveTwoPhaseFile(TransactionId xid, bool giveWarning);
static void RecreateTwoPhaseFile(TransactionId xid, void *content, int len); static void RecreateTwoPhaseFile(TransactionId xid, void *content, int len);

View File

@ -312,11 +312,11 @@ static void AtStart_Memory(void);
static void AtStart_ResourceOwner(void); static void AtStart_ResourceOwner(void);
static void CallXactCallbacks(XactEvent event); static void CallXactCallbacks(XactEvent event);
static void CallSubXactCallbacks(SubXactEvent event, static void CallSubXactCallbacks(SubXactEvent event,
SubTransactionId mySubid, SubTransactionId mySubid,
SubTransactionId parentSubid); SubTransactionId parentSubid);
static void CleanupTransaction(void); static void CleanupTransaction(void);
static void CheckTransactionBlock(bool isTopLevel, bool throwError, static void CheckTransactionBlock(bool isTopLevel, bool throwError,
const char *stmtType); const char *stmtType);
static void CommitTransaction(void); static void CommitTransaction(void);
static TransactionId RecordTransactionAbort(bool isSubXact); static TransactionId RecordTransactionAbort(bool isSubXact);
static void StartTransaction(void); static void StartTransaction(void);

View File

@ -869,7 +869,7 @@ static void SetCurrentChunkStartTime(TimestampTz xtime);
static void CheckRequiredParameterValues(void); static void CheckRequiredParameterValues(void);
static void XLogReportParameters(void); static void XLogReportParameters(void);
static void checkTimeLineSwitch(XLogRecPtr lsn, TimeLineID newTLI, static void checkTimeLineSwitch(XLogRecPtr lsn, TimeLineID newTLI,
TimeLineID prevTLI); TimeLineID prevTLI);
static void LocalSetXLogInsertAllowed(void); static void LocalSetXLogInsertAllowed(void);
static void CreateEndOfRecoveryRecord(void); static void CreateEndOfRecoveryRecord(void);
static void CheckPointGuts(XLogRecPtr checkPointRedo, int flags); static void CheckPointGuts(XLogRecPtr checkPointRedo, int flags);
@ -880,16 +880,16 @@ static void AdvanceXLInsertBuffer(XLogRecPtr upto, bool opportunistic);
static bool XLogCheckpointNeeded(XLogSegNo new_segno); static bool XLogCheckpointNeeded(XLogSegNo new_segno);
static void XLogWrite(XLogwrtRqst WriteRqst, bool flexible); static void XLogWrite(XLogwrtRqst WriteRqst, bool flexible);
static bool InstallXLogFileSegment(XLogSegNo *segno, char *tmppath, static bool InstallXLogFileSegment(XLogSegNo *segno, char *tmppath,
bool find_free, XLogSegNo max_segno, bool find_free, XLogSegNo max_segno,
bool use_lock); bool use_lock);
static int XLogFileRead(XLogSegNo segno, int emode, TimeLineID tli, static int XLogFileRead(XLogSegNo segno, int emode, TimeLineID tli,
int source, bool notfoundOk); int source, bool notfoundOk);
static int XLogFileReadAnyTLI(XLogSegNo segno, int emode, int source); static int XLogFileReadAnyTLI(XLogSegNo segno, int emode, int source);
static int XLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr, static int XLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr,
int reqLen, XLogRecPtr targetRecPtr, char *readBuf, int reqLen, XLogRecPtr targetRecPtr, char *readBuf,
TimeLineID *readTLI); TimeLineID *readTLI);
static bool WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess, static bool WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
bool fetching_ckpt, XLogRecPtr tliRecPtr); bool fetching_ckpt, XLogRecPtr tliRecPtr);
static int emode_for_corrupt_record(int emode, XLogRecPtr RecPtr); static int emode_for_corrupt_record(int emode, XLogRecPtr RecPtr);
static void XLogFileClose(void); static void XLogFileClose(void);
static void PreallocXlogFiles(XLogRecPtr endptr); static void PreallocXlogFiles(XLogRecPtr endptr);
@ -901,10 +901,10 @@ static void ValidateXLOGDirectoryStructure(void);
static void CleanupBackupHistory(void); static void CleanupBackupHistory(void);
static void UpdateMinRecoveryPoint(XLogRecPtr lsn, bool force); static void UpdateMinRecoveryPoint(XLogRecPtr lsn, bool force);
static XLogRecord *ReadRecord(XLogReaderState *xlogreader, XLogRecPtr RecPtr, static XLogRecord *ReadRecord(XLogReaderState *xlogreader, XLogRecPtr RecPtr,
int emode, bool fetching_ckpt); int emode, bool fetching_ckpt);
static void CheckRecoveryConsistency(void); static void CheckRecoveryConsistency(void);
static XLogRecord *ReadCheckpointRecord(XLogReaderState *xlogreader, static XLogRecord *ReadCheckpointRecord(XLogReaderState *xlogreader,
XLogRecPtr RecPtr, int whichChkpti, bool report); XLogRecPtr RecPtr, int whichChkpti, bool report);
static bool rescanLatestTimeLine(void); static bool rescanLatestTimeLine(void);
static void WriteControlFile(void); static void WriteControlFile(void);
static void ReadControlFile(void); static void ReadControlFile(void);
@ -918,19 +918,19 @@ static void xlog_outdesc(StringInfo buf, XLogReaderState *record);
static void pg_start_backup_callback(int code, Datum arg); static void pg_start_backup_callback(int code, Datum arg);
static void pg_stop_backup_callback(int code, Datum arg); static void pg_stop_backup_callback(int code, Datum arg);
static bool read_backup_label(XLogRecPtr *checkPointLoc, static bool read_backup_label(XLogRecPtr *checkPointLoc,
bool *backupEndRequired, bool *backupFromStandby); bool *backupEndRequired, bool *backupFromStandby);
static bool read_tablespace_map(List **tablespaces); static bool read_tablespace_map(List **tablespaces);
static void rm_redo_error_callback(void *arg); static void rm_redo_error_callback(void *arg);
static int get_sync_bit(int method); static int get_sync_bit(int method);
static void CopyXLogRecordToWAL(int write_len, bool isLogSwitch, static void CopyXLogRecordToWAL(int write_len, bool isLogSwitch,
XLogRecData *rdata, XLogRecData *rdata,
XLogRecPtr StartPos, XLogRecPtr EndPos); XLogRecPtr StartPos, XLogRecPtr EndPos);
static void ReserveXLogInsertLocation(int size, XLogRecPtr *StartPos, static void ReserveXLogInsertLocation(int size, XLogRecPtr *StartPos,
XLogRecPtr *EndPos, XLogRecPtr *PrevPtr); XLogRecPtr *EndPos, XLogRecPtr *PrevPtr);
static bool ReserveXLogSwitch(XLogRecPtr *StartPos, XLogRecPtr *EndPos, static bool ReserveXLogSwitch(XLogRecPtr *StartPos, XLogRecPtr *EndPos,
XLogRecPtr *PrevPtr); XLogRecPtr *PrevPtr);
static XLogRecPtr WaitXLogInsertionsToFinish(XLogRecPtr upto); static XLogRecPtr WaitXLogInsertionsToFinish(XLogRecPtr upto);
static char *GetXLogBuffer(XLogRecPtr ptr); static char *GetXLogBuffer(XLogRecPtr ptr);
static XLogRecPtr XLogBytePosToRecPtr(uint64 bytepos); static XLogRecPtr XLogBytePosToRecPtr(uint64 bytepos);

View File

@ -107,10 +107,10 @@ static bool begininsert_called = false;
static MemoryContext xloginsert_cxt; static MemoryContext xloginsert_cxt;
static XLogRecData *XLogRecordAssemble(RmgrId rmid, uint8 info, static XLogRecData *XLogRecordAssemble(RmgrId rmid, uint8 info,
XLogRecPtr RedoRecPtr, bool doPageWrites, XLogRecPtr RedoRecPtr, bool doPageWrites,
XLogRecPtr *fpw_lsn); XLogRecPtr *fpw_lsn);
static bool XLogCompressBackupBlock(char *page, uint16 hole_offset, static bool XLogCompressBackupBlock(char *page, uint16 hole_offset,
uint16 hole_length, char *dest, uint16 *dlen); uint16 hole_length, char *dest, uint16 *dlen);
/* /*
* Begin constructing a WAL record. This must be called before the * Begin constructing a WAL record. This must be called before the

View File

@ -32,11 +32,11 @@
static bool allocate_recordbuf(XLogReaderState *state, uint32 reclength); static bool allocate_recordbuf(XLogReaderState *state, uint32 reclength);
static bool ValidXLogRecordHeader(XLogReaderState *state, XLogRecPtr RecPtr, static bool ValidXLogRecordHeader(XLogReaderState *state, XLogRecPtr RecPtr,
XLogRecPtr PrevRecPtr, XLogRecord *record, bool randAccess); XLogRecPtr PrevRecPtr, XLogRecord *record, bool randAccess);
static bool ValidXLogRecord(XLogReaderState *state, XLogRecord *record, static bool ValidXLogRecord(XLogReaderState *state, XLogRecord *record,
XLogRecPtr recptr); XLogRecPtr recptr);
static int ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr, static int ReadPageInternal(XLogReaderState *state, XLogRecPtr pageptr,
int reqLen); int reqLen);
static void report_invalid_record(XLogReaderState *state, const char *fmt,...) pg_attribute_printf(2, 3); static void report_invalid_record(XLogReaderState *state, const char *fmt,...) pg_attribute_printf(2, 3);
static void ResetDecoder(XLogReaderState *state); static void ResetDecoder(XLogReaderState *state);

View File

@ -120,26 +120,26 @@ static List *objectNamesToOids(ObjectType objtype, List *objnames);
static List *objectsInSchemaToOids(ObjectType objtype, List *nspnames); static List *objectsInSchemaToOids(ObjectType objtype, List *nspnames);
static List *getRelationsInNamespace(Oid namespaceId, char relkind); static List *getRelationsInNamespace(Oid namespaceId, char relkind);
static void expand_col_privileges(List *colnames, Oid table_oid, static void expand_col_privileges(List *colnames, Oid table_oid,
AclMode this_privileges, AclMode this_privileges,
AclMode *col_privileges, AclMode *col_privileges,
int num_col_privileges); int num_col_privileges);
static void expand_all_col_privileges(Oid table_oid, Form_pg_class classForm, static void expand_all_col_privileges(Oid table_oid, Form_pg_class classForm,
AclMode this_privileges, AclMode this_privileges,
AclMode *col_privileges, AclMode *col_privileges,
int num_col_privileges); int num_col_privileges);
static AclMode string_to_privilege(const char *privname); static AclMode string_to_privilege(const char *privname);
static const char *privilege_to_string(AclMode privilege); static const char *privilege_to_string(AclMode privilege);
static AclMode restrict_and_check_grant(bool is_grant, AclMode avail_goptions, static AclMode restrict_and_check_grant(bool is_grant, AclMode avail_goptions,
bool all_privs, AclMode privileges, bool all_privs, AclMode privileges,
Oid objectId, Oid grantorId, Oid objectId, Oid grantorId,
ObjectType objtype, const char *objname, ObjectType objtype, const char *objname,
AttrNumber att_number, const char *colname); AttrNumber att_number, const char *colname);
static AclMode pg_aclmask(ObjectType objtype, Oid table_oid, AttrNumber attnum, static AclMode pg_aclmask(ObjectType objtype, Oid table_oid, AttrNumber attnum,
Oid roleid, AclMode mask, AclMaskHow how); Oid roleid, AclMode mask, AclMaskHow how);
static void recordExtensionInitPriv(Oid objoid, Oid classoid, int objsubid, static void recordExtensionInitPriv(Oid objoid, Oid classoid, int objsubid,
Acl *new_acl); Acl *new_acl);
static void recordExtensionInitPrivWorker(Oid objoid, Oid classoid, int objsubid, static void recordExtensionInitPrivWorker(Oid objoid, Oid classoid, int objsubid,
Acl *new_acl); Acl *new_acl);
#ifdef ACLDEBUG #ifdef ACLDEBUG

View File

@ -186,36 +186,36 @@ static const Oid object_classes[] = {
static void findDependentObjects(const ObjectAddress *object, static void findDependentObjects(const ObjectAddress *object,
int objflags, int objflags,
int flags, int flags,
ObjectAddressStack *stack, ObjectAddressStack *stack,
ObjectAddresses *targetObjects, ObjectAddresses *targetObjects,
const ObjectAddresses *pendingObjects, const ObjectAddresses *pendingObjects,
Relation *depRel); Relation *depRel);
static void reportDependentObjects(const ObjectAddresses *targetObjects, static void reportDependentObjects(const ObjectAddresses *targetObjects,
DropBehavior behavior, DropBehavior behavior,
int flags, int flags,
const ObjectAddress *origObject); const ObjectAddress *origObject);
static void deleteOneObject(const ObjectAddress *object, static void deleteOneObject(const ObjectAddress *object,
Relation *depRel, int32 flags); Relation *depRel, int32 flags);
static void doDeletion(const ObjectAddress *object, int flags); static void doDeletion(const ObjectAddress *object, int flags);
static void AcquireDeletionLock(const ObjectAddress *object, int flags); static void AcquireDeletionLock(const ObjectAddress *object, int flags);
static void ReleaseDeletionLock(const ObjectAddress *object); static void ReleaseDeletionLock(const ObjectAddress *object);
static bool find_expr_references_walker(Node *node, static bool find_expr_references_walker(Node *node,
find_expr_references_context *context); find_expr_references_context *context);
static void eliminate_duplicate_dependencies(ObjectAddresses *addrs); static void eliminate_duplicate_dependencies(ObjectAddresses *addrs);
static int object_address_comparator(const void *a, const void *b); static int object_address_comparator(const void *a, const void *b);
static void add_object_address(ObjectClass oclass, Oid objectId, int32 subId, static void add_object_address(ObjectClass oclass, Oid objectId, int32 subId,
ObjectAddresses *addrs);
static void add_exact_object_address_extra(const ObjectAddress *object,
const ObjectAddressExtra *extra,
ObjectAddresses *addrs); ObjectAddresses *addrs);
static void add_exact_object_address_extra(const ObjectAddress *object,
const ObjectAddressExtra *extra,
ObjectAddresses *addrs);
static bool object_address_present_add_flags(const ObjectAddress *object, static bool object_address_present_add_flags(const ObjectAddress *object,
int flags, int flags,
ObjectAddresses *addrs); ObjectAddresses *addrs);
static bool stack_address_present_add_flags(const ObjectAddress *object, static bool stack_address_present_add_flags(const ObjectAddress *object,
int flags, int flags,
ObjectAddressStack *stack); ObjectAddressStack *stack);
static void DeleteInitPrivs(const ObjectAddress *object); static void DeleteInitPrivs(const ObjectAddress *object);

View File

@ -94,37 +94,37 @@ Oid binary_upgrade_next_heap_pg_class_oid = InvalidOid;
Oid binary_upgrade_next_toast_pg_class_oid = InvalidOid; Oid binary_upgrade_next_toast_pg_class_oid = InvalidOid;
static void AddNewRelationTuple(Relation pg_class_desc, static void AddNewRelationTuple(Relation pg_class_desc,
Relation new_rel_desc, Relation new_rel_desc,
Oid new_rel_oid, Oid new_rel_oid,
Oid new_type_oid, Oid new_type_oid,
Oid reloftype, Oid reloftype,
Oid relowner, Oid relowner,
char relkind, char relkind,
TransactionId relfrozenxid, TransactionId relfrozenxid,
TransactionId relminmxid, TransactionId relminmxid,
Datum relacl, Datum relacl,
Datum reloptions); Datum reloptions);
static ObjectAddress AddNewRelationType(const char *typeName, static ObjectAddress AddNewRelationType(const char *typeName,
Oid typeNamespace, Oid typeNamespace,
Oid new_rel_oid, Oid new_rel_oid,
char new_rel_kind, char new_rel_kind,
Oid ownerid, Oid ownerid,
Oid new_row_type, Oid new_row_type,
Oid new_array_type); Oid new_array_type);
static void RelationRemoveInheritance(Oid relid); static void RelationRemoveInheritance(Oid relid);
static Oid StoreRelCheck(Relation rel, const char *ccname, Node *expr, static Oid StoreRelCheck(Relation rel, const char *ccname, Node *expr,
bool is_validated, bool is_local, int inhcount, bool is_validated, bool is_local, int inhcount,
bool is_no_inherit, bool is_internal); bool is_no_inherit, bool is_internal);
static void StoreConstraints(Relation rel, List *cooked_constraints, static void StoreConstraints(Relation rel, List *cooked_constraints,
bool is_internal); bool is_internal);
static bool MergeWithExistingConstraint(Relation rel, const char *ccname, Node *expr, static bool MergeWithExistingConstraint(Relation rel, const char *ccname, Node *expr,
bool allow_merge, bool is_local, bool allow_merge, bool is_local,
bool is_initially_valid, bool is_initially_valid,
bool is_no_inherit); bool is_no_inherit);
static void SetRelationNumChecks(Relation rel, int numchecks); static void SetRelationNumChecks(Relation rel, int numchecks);
static Node *cookConstraint(ParseState *pstate, static Node *cookConstraint(ParseState *pstate,
Node *raw_constraint, Node *raw_constraint,
char *relname); char *relname);
static List *insert_ordered_unique_oid(List *list, Oid datum); static List *insert_ordered_unique_oid(List *list, Oid datum);

View File

@ -99,31 +99,31 @@ typedef struct
/* non-export function prototypes */ /* non-export function prototypes */
static bool relationHasPrimaryKey(Relation rel); static bool relationHasPrimaryKey(Relation rel);
static TupleDesc ConstructTupleDescriptor(Relation heapRelation, static TupleDesc ConstructTupleDescriptor(Relation heapRelation,
IndexInfo *indexInfo, IndexInfo *indexInfo,
List *indexColNames, List *indexColNames,
Oid accessMethodObjectId, Oid accessMethodObjectId,
Oid *collationObjectId, Oid *collationObjectId,
Oid *classObjectId); Oid *classObjectId);
static void InitializeAttributeOids(Relation indexRelation, static void InitializeAttributeOids(Relation indexRelation,
int numatts, Oid indexoid); int numatts, Oid indexoid);
static void AppendAttributeTuples(Relation indexRelation, int numatts); static void AppendAttributeTuples(Relation indexRelation, int numatts);
static void UpdateIndexRelation(Oid indexoid, Oid heapoid, static void UpdateIndexRelation(Oid indexoid, Oid heapoid,
Oid parentIndexId, Oid parentIndexId,
IndexInfo *indexInfo, IndexInfo *indexInfo,
Oid *collationOids, Oid *collationOids,
Oid *classOids, Oid *classOids,
int16 *coloptions, int16 *coloptions,
bool primary, bool primary,
bool isexclusion, bool isexclusion,
bool immediate, bool immediate,
bool isvalid, bool isvalid,
bool isready); bool isready);
static void index_update_stats(Relation rel, static void index_update_stats(Relation rel,
bool hasindex, bool hasindex,
double reltuples); double reltuples);
static void IndexCheckExclusion(Relation heapRelation, static void IndexCheckExclusion(Relation heapRelation,
Relation indexRelation, Relation indexRelation,
IndexInfo *indexInfo); IndexInfo *indexInfo);
static bool validate_index_callback(ItemPointer itemptr, void *opaque); static bool validate_index_callback(ItemPointer itemptr, void *opaque);
static bool ReindexIsCurrentlyProcessingIndex(Oid indexOid); static bool ReindexIsCurrentlyProcessingIndex(Oid indexOid);
static void SetReindexProcessing(Oid heapOid, Oid indexOid); static void SetReindexProcessing(Oid heapOid, Oid indexOid);

View File

@ -198,7 +198,7 @@ static void RemoveTempRelations(Oid tempNamespaceId);
static void RemoveTempRelationsCallback(int code, Datum arg); static void RemoveTempRelationsCallback(int code, Datum arg);
static void NamespaceCallback(Datum arg, int cacheid, uint32 hashvalue); static void NamespaceCallback(Datum arg, int cacheid, uint32 hashvalue);
static bool MatchNamedCall(HeapTuple proctup, int nargs, List *argnames, static bool MatchNamedCall(HeapTuple proctup, int nargs, List *argnames,
int **argnumbers); int **argnumbers);
/* /*

View File

@ -761,38 +761,38 @@ const ObjectAddress InvalidObjectAddress =
}; };
static ObjectAddress get_object_address_unqualified(ObjectType objtype, static ObjectAddress get_object_address_unqualified(ObjectType objtype,
Value *strval, bool missing_ok); Value *strval, bool missing_ok);
static ObjectAddress get_relation_by_qualified_name(ObjectType objtype, static ObjectAddress get_relation_by_qualified_name(ObjectType objtype,
List *object, Relation *relp, List *object, Relation *relp,
LOCKMODE lockmode, bool missing_ok); LOCKMODE lockmode, bool missing_ok);
static ObjectAddress get_object_address_relobject(ObjectType objtype, static ObjectAddress get_object_address_relobject(ObjectType objtype,
List *object, Relation *relp, bool missing_ok); List *object, Relation *relp, bool missing_ok);
static ObjectAddress get_object_address_attribute(ObjectType objtype, static ObjectAddress get_object_address_attribute(ObjectType objtype,
List *object, Relation *relp, List *object, Relation *relp,
LOCKMODE lockmode, bool missing_ok); LOCKMODE lockmode, bool missing_ok);
static ObjectAddress get_object_address_attrdef(ObjectType objtype, static ObjectAddress get_object_address_attrdef(ObjectType objtype,
List *object, Relation *relp, LOCKMODE lockmode, List *object, Relation *relp, LOCKMODE lockmode,
bool missing_ok); bool missing_ok);
static ObjectAddress get_object_address_type(ObjectType objtype, static ObjectAddress get_object_address_type(ObjectType objtype,
TypeName *typename, bool missing_ok); TypeName *typename, bool missing_ok);
static ObjectAddress get_object_address_opcf(ObjectType objtype, List *object, static ObjectAddress get_object_address_opcf(ObjectType objtype, List *object,
bool missing_ok); bool missing_ok);
static ObjectAddress get_object_address_opf_member(ObjectType objtype, static ObjectAddress get_object_address_opf_member(ObjectType objtype,
List *object, bool missing_ok); List *object, bool missing_ok);
static ObjectAddress get_object_address_usermapping(List *object, static ObjectAddress get_object_address_usermapping(List *object,
bool missing_ok); bool missing_ok);
static ObjectAddress get_object_address_publication_rel(List *object, static ObjectAddress get_object_address_publication_rel(List *object,
Relation *relp, Relation *relp,
bool missing_ok); bool missing_ok);
static ObjectAddress get_object_address_defacl(List *object, static ObjectAddress get_object_address_defacl(List *object,
bool missing_ok); bool missing_ok);
static const ObjectPropertyType *get_object_property_data(Oid class_id); static const ObjectPropertyType *get_object_property_data(Oid class_id);
static void getRelationDescription(StringInfo buffer, Oid relid); static void getRelationDescription(StringInfo buffer, Oid relid);
static void getOpFamilyDescription(StringInfo buffer, Oid opfid); static void getOpFamilyDescription(StringInfo buffer, Oid opfid);
static void getRelationTypeDescription(StringInfo buffer, Oid relid, static void getRelationTypeDescription(StringInfo buffer, Oid relid,
int32 objectSubId); int32 objectSubId);
static void getProcedureTypeDescription(StringInfo buffer, Oid procid); static void getProcedureTypeDescription(StringInfo buffer, Oid procid);
static void getConstraintTypeDescription(StringInfo buffer, Oid constroid); static void getConstraintTypeDescription(StringInfo buffer, Oid constroid);
static void getOpFamilyIdentity(StringInfo buffer, Oid opfid, List **object); static void getOpFamilyIdentity(StringInfo buffer, Oid opfid, List **object);

View File

@ -35,7 +35,7 @@
static Oid get_partition_parent_worker(Relation inhRel, Oid relid); static Oid get_partition_parent_worker(Relation inhRel, Oid relid);
static void get_partition_ancestors_worker(Relation inhRel, Oid relid, static void get_partition_ancestors_worker(Relation inhRel, Oid relid,
List **ancestors); List **ancestors);
/* /*
* get_partition_parent * get_partition_parent

View File

@ -34,9 +34,9 @@
#include "utils/syscache.h" #include "utils/syscache.h"
static Oid lookup_agg_function(List *fnName, int nargs, Oid *input_types, static Oid lookup_agg_function(List *fnName, int nargs, Oid *input_types,
Oid variadicArgType, Oid variadicArgType,
Oid *rettype); Oid *rettype);
/* /*

View File

@ -38,27 +38,27 @@
#include "utils/syscache.h" #include "utils/syscache.h"
static Oid OperatorGet(const char *operatorName, static Oid OperatorGet(const char *operatorName,
Oid operatorNamespace, Oid operatorNamespace,
Oid leftObjectId, Oid leftObjectId,
Oid rightObjectId, Oid rightObjectId,
bool *defined); bool *defined);
static Oid OperatorLookup(List *operatorName, static Oid OperatorLookup(List *operatorName,
Oid leftObjectId, Oid leftObjectId,
Oid rightObjectId, Oid rightObjectId,
bool *defined); bool *defined);
static Oid OperatorShellMake(const char *operatorName, static Oid OperatorShellMake(const char *operatorName,
Oid operatorNamespace, Oid operatorNamespace,
Oid leftTypeId, Oid leftTypeId,
Oid rightTypeId); Oid rightTypeId);
static Oid get_other_operator(List *otherOp, static Oid get_other_operator(List *otherOp,
Oid otherLeftTypeId, Oid otherRightTypeId, Oid otherLeftTypeId, Oid otherRightTypeId,
const char *operatorName, Oid operatorNamespace, const char *operatorName, Oid operatorNamespace,
Oid leftTypeId, Oid rightTypeId, Oid leftTypeId, Oid rightTypeId,
bool isCommutator); bool isCommutator);
/* /*

View File

@ -50,10 +50,10 @@ typedef struct
} parse_error_callback_arg; } parse_error_callback_arg;
static void sql_function_parse_error_callback(void *arg); static void sql_function_parse_error_callback(void *arg);
static int match_prosrc_to_query(const char *prosrc, const char *queryText, static int match_prosrc_to_query(const char *prosrc, const char *queryText,
int cursorpos); int cursorpos);
static bool match_prosrc_to_literal(const char *prosrc, const char *literal, static bool match_prosrc_to_literal(const char *prosrc, const char *literal,
int cursorpos, int *newcursorpos); int cursorpos, int *newcursorpos);
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------

View File

@ -84,23 +84,23 @@ typedef struct
static void getOidListDiff(Oid *list1, int *nlist1, Oid *list2, int *nlist2); static void getOidListDiff(Oid *list1, int *nlist1, Oid *list2, int *nlist2);
static Oid classIdGetDbId(Oid classId); static Oid classIdGetDbId(Oid classId);
static void shdepChangeDep(Relation sdepRel, static void shdepChangeDep(Relation sdepRel,
Oid classid, Oid objid, int32 objsubid, Oid classid, Oid objid, int32 objsubid,
Oid refclassid, Oid refobjid, Oid refclassid, Oid refobjid,
SharedDependencyType deptype); SharedDependencyType deptype);
static void shdepAddDependency(Relation sdepRel, static void shdepAddDependency(Relation sdepRel,
Oid classId, Oid objectId, int32 objsubId, Oid classId, Oid objectId, int32 objsubId,
Oid refclassId, Oid refobjId, Oid refclassId, Oid refobjId,
SharedDependencyType deptype); SharedDependencyType deptype);
static void shdepDropDependency(Relation sdepRel, static void shdepDropDependency(Relation sdepRel,
Oid classId, Oid objectId, int32 objsubId, Oid classId, Oid objectId, int32 objsubId,
bool drop_subobjects, bool drop_subobjects,
Oid refclassId, Oid refobjId, Oid refclassId, Oid refobjId,
SharedDependencyType deptype); SharedDependencyType deptype);
static void storeObjectDescription(StringInfo descs, static void storeObjectDescription(StringInfo descs,
SharedDependencyObjectType type, SharedDependencyObjectType type,
ObjectAddress *object, ObjectAddress *object,
SharedDependencyType deptype, SharedDependencyType deptype,
int count); int count);
static bool isSharedObjectPinned(Oid classId, Oid objectId, Relation sdepRel); static bool isSharedObjectPinned(Oid classId, Oid objectId, Relation sdepRel);

View File

@ -38,9 +38,9 @@
Oid binary_upgrade_next_toast_pg_type_oid = InvalidOid; Oid binary_upgrade_next_toast_pg_type_oid = InvalidOid;
static void CheckAndCreateToastTable(Oid relOid, Datum reloptions, static void CheckAndCreateToastTable(Oid relOid, Datum reloptions,
LOCKMODE lockmode, bool check); LOCKMODE lockmode, bool check);
static bool create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid, static bool create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
Datum reloptions, LOCKMODE lockmode, bool check); Datum reloptions, LOCKMODE lockmode, bool check);
static bool needs_toast_table(Relation rel); static bool needs_toast_table(Relation rel);

View File

@ -85,24 +85,24 @@ static BufferAccessStrategy vac_strategy;
static void do_analyze_rel(Relation onerel, static void do_analyze_rel(Relation onerel,
VacuumParams *params, List *va_cols, VacuumParams *params, List *va_cols,
AcquireSampleRowsFunc acquirefunc, BlockNumber relpages, AcquireSampleRowsFunc acquirefunc, BlockNumber relpages,
bool inh, bool in_outer_xact, int elevel); bool inh, bool in_outer_xact, int elevel);
static void compute_index_stats(Relation onerel, double totalrows, static void compute_index_stats(Relation onerel, double totalrows,
AnlIndexData *indexdata, int nindexes, AnlIndexData *indexdata, int nindexes,
HeapTuple *rows, int numrows, HeapTuple *rows, int numrows,
MemoryContext col_context); MemoryContext col_context);
static VacAttrStats *examine_attribute(Relation onerel, int attnum, static VacAttrStats *examine_attribute(Relation onerel, int attnum,
Node *index_expr); Node *index_expr);
static int acquire_sample_rows(Relation onerel, int elevel, static int acquire_sample_rows(Relation onerel, int elevel,
HeapTuple *rows, int targrows, HeapTuple *rows, int targrows,
double *totalrows, double *totaldeadrows); double *totalrows, double *totaldeadrows);
static int compare_rows(const void *a, const void *b); static int compare_rows(const void *a, const void *b);
static int acquire_inherited_sample_rows(Relation onerel, int elevel, static int acquire_inherited_sample_rows(Relation onerel, int elevel,
HeapTuple *rows, int targrows, HeapTuple *rows, int targrows,
double *totalrows, double *totaldeadrows); double *totalrows, double *totaldeadrows);
static void update_attstats(Oid relid, bool inh, static void update_attstats(Oid relid, bool inh,
int natts, VacAttrStats **vacattrstats); int natts, VacAttrStats **vacattrstats);
static Datum std_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); static Datum std_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull);
static Datum ind_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull); static Datum ind_fetch_func(VacAttrStatsP stats, int rownum, bool *isNull);
@ -1615,25 +1615,25 @@ typedef struct
static void compute_trivial_stats(VacAttrStatsP stats, static void compute_trivial_stats(VacAttrStatsP stats,
AnalyzeAttrFetchFunc fetchfunc, AnalyzeAttrFetchFunc fetchfunc,
int samplerows, int samplerows,
double totalrows); double totalrows);
static void compute_distinct_stats(VacAttrStatsP stats, static void compute_distinct_stats(VacAttrStatsP stats,
AnalyzeAttrFetchFunc fetchfunc, AnalyzeAttrFetchFunc fetchfunc,
int samplerows, int samplerows,
double totalrows); double totalrows);
static void compute_scalar_stats(VacAttrStatsP stats, static void compute_scalar_stats(VacAttrStatsP stats,
AnalyzeAttrFetchFunc fetchfunc, AnalyzeAttrFetchFunc fetchfunc,
int samplerows, int samplerows,
double totalrows); double totalrows);
static int compare_scalars(const void *a, const void *b, void *arg); static int compare_scalars(const void *a, const void *b, void *arg);
static int compare_mcvs(const void *a, const void *b); static int compare_mcvs(const void *a, const void *b);
static int analyze_mcv_list(int *mcv_counts, static int analyze_mcv_list(int *mcv_counts,
int num_mcv, int num_mcv,
double stadistinct, double stadistinct,
double stanullfrac, double stanullfrac,
int samplerows, int samplerows,
double totalrows); double totalrows);
/* /*

View File

@ -387,9 +387,9 @@ static void asyncQueueFillWarning(void);
static bool SignalBackends(void); static bool SignalBackends(void);
static void asyncQueueReadAllNotifications(void); static void asyncQueueReadAllNotifications(void);
static bool asyncQueueProcessPageEntries(volatile QueuePosition *current, static bool asyncQueueProcessPageEntries(volatile QueuePosition *current,
QueuePosition stop, QueuePosition stop,
char *page_buffer, char *page_buffer,
Snapshot snapshot); Snapshot snapshot);
static void asyncQueueAdvanceTail(void); static void asyncQueueAdvanceTail(void);
static void ProcessIncomingNotify(void); static void ProcessIncomingNotify(void);
static bool AsyncExistsPendingNotify(const char *channel, const char *payload); static bool AsyncExistsPendingNotify(const char *channel, const char *payload);

View File

@ -70,8 +70,8 @@ typedef struct
static void rebuild_relation(Relation OldHeap, Oid indexOid, bool verbose); static void rebuild_relation(Relation OldHeap, Oid indexOid, bool verbose);
static void copy_table_data(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex, static void copy_table_data(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex,
bool verbose, bool *pSwapToastByContent, bool verbose, bool *pSwapToastByContent,
TransactionId *pFreezeXid, MultiXactId *pCutoffMulti); TransactionId *pFreezeXid, MultiXactId *pCutoffMulti);
static List *get_tables_to_cluster(MemoryContext cluster_context); static List *get_tables_to_cluster(MemoryContext cluster_context);

View File

@ -354,13 +354,13 @@ static const char BinarySignature[11] = "PGCOPY\n\377\r\n\0";
/* non-export function prototypes */ /* non-export function prototypes */
static CopyState BeginCopy(ParseState *pstate, bool is_from, Relation rel, static CopyState BeginCopy(ParseState *pstate, bool is_from, Relation rel,
RawStmt *raw_query, Oid queryRelId, List *attnamelist, RawStmt *raw_query, Oid queryRelId, List *attnamelist,
List *options); List *options);
static void EndCopy(CopyState cstate); static void EndCopy(CopyState cstate);
static void ClosePipeToProgram(CopyState cstate); static void ClosePipeToProgram(CopyState cstate);
static CopyState BeginCopyTo(ParseState *pstate, Relation rel, RawStmt *query, static CopyState BeginCopyTo(ParseState *pstate, Relation rel, RawStmt *query,
Oid queryRelId, const char *filename, bool is_program, Oid queryRelId, const char *filename, bool is_program,
List *attnamelist, List *options); List *attnamelist, List *options);
static void EndCopyTo(CopyState cstate); static void EndCopyTo(CopyState cstate);
static uint64 DoCopyTo(CopyState cstate); static uint64 DoCopyTo(CopyState cstate);
static uint64 CopyTo(CopyState cstate); static uint64 CopyTo(CopyState cstate);
@ -370,14 +370,14 @@ static bool CopyReadLineText(CopyState cstate);
static int CopyReadAttributesText(CopyState cstate); static int CopyReadAttributesText(CopyState cstate);
static int CopyReadAttributesCSV(CopyState cstate); static int CopyReadAttributesCSV(CopyState cstate);
static Datum CopyReadBinaryAttribute(CopyState cstate, static Datum CopyReadBinaryAttribute(CopyState cstate,
int column_no, FmgrInfo *flinfo, int column_no, FmgrInfo *flinfo,
Oid typioparam, int32 typmod, Oid typioparam, int32 typmod,
bool *isnull); bool *isnull);
static void CopyAttributeOutText(CopyState cstate, char *string); static void CopyAttributeOutText(CopyState cstate, char *string);
static void CopyAttributeOutCSV(CopyState cstate, char *string, static void CopyAttributeOutCSV(CopyState cstate, char *string,
bool use_quote, bool single_attr); bool use_quote, bool single_attr);
static List *CopyGetAttnums(TupleDesc tupDesc, Relation rel, static List *CopyGetAttnums(TupleDesc tupDesc, Relation rel,
List *attnamelist); List *attnamelist);
static char *limit_printout_length(const char *str); static char *limit_printout_length(const char *str);
/* Low-level communications functions */ /* Low-level communications functions */
@ -388,8 +388,8 @@ static void CopySendData(CopyState cstate, const void *databuf, int datasize);
static void CopySendString(CopyState cstate, const char *str); static void CopySendString(CopyState cstate, const char *str);
static void CopySendChar(CopyState cstate, char c); static void CopySendChar(CopyState cstate, char c);
static void CopySendEndOfRow(CopyState cstate); static void CopySendEndOfRow(CopyState cstate);
static int CopyGetData(CopyState cstate, void *databuf, static int CopyGetData(CopyState cstate, void *databuf,
int minread, int maxread); int minread, int maxread);
static void CopySendInt32(CopyState cstate, int32 val); static void CopySendInt32(CopyState cstate, int32 val);
static bool CopyGetInt32(CopyState cstate, int32 *val); static bool CopyGetInt32(CopyState cstate, int32 *val);
static void CopySendInt16(CopyState cstate, int16 val); static void CopySendInt16(CopyState cstate, int16 val);

View File

@ -82,11 +82,11 @@ static void createdb_failure_callback(int code, Datum arg);
static void movedb(const char *dbname, const char *tblspcname); static void movedb(const char *dbname, const char *tblspcname);
static void movedb_failure_callback(int code, Datum arg); static void movedb_failure_callback(int code, Datum arg);
static bool get_db_info(const char *name, LOCKMODE lockmode, static bool get_db_info(const char *name, LOCKMODE lockmode,
Oid *dbIdP, Oid *ownerIdP, Oid *dbIdP, Oid *ownerIdP,
int *encodingP, bool *dbIsTemplateP, bool *dbAllowConnP, int *encodingP, bool *dbIsTemplateP, bool *dbAllowConnP,
Oid *dbLastSysOidP, TransactionId *dbFrozenXidP, Oid *dbLastSysOidP, TransactionId *dbFrozenXidP,
MultiXactId *dbMinMultiP, MultiXactId *dbMinMultiP,
Oid *dbTablespace, char **dbCollate, char **dbCtype); Oid *dbTablespace, char **dbCollate, char **dbCtype);
static bool have_createdb_privilege(void); static bool have_createdb_privilege(void);
static void remove_dbtablespaces(Oid db_id); static void remove_dbtablespaces(Oid db_id);
static bool check_db_file_conflict(Oid db_id); static bool check_db_file_conflict(Oid db_id);

View File

@ -32,13 +32,13 @@
static void does_not_exist_skipping(ObjectType objtype, static void does_not_exist_skipping(ObjectType objtype,
Node *object); Node *object);
static bool owningrel_does_not_exist_skipping(List *object, static bool owningrel_does_not_exist_skipping(List *object,
const char **msg, char **name); const char **msg, char **name);
static bool schema_does_not_exist_skipping(List *object, static bool schema_does_not_exist_skipping(List *object,
const char **msg, char **name); const char **msg, char **name);
static bool type_in_list_does_not_exist_skipping(List *typenames, static bool type_in_list_does_not_exist_skipping(List *typenames,
const char **msg, char **name); const char **msg, char **name);
/* /*

View File

@ -148,15 +148,15 @@ typedef struct SQLDropObject
} SQLDropObject; } SQLDropObject;
static void AlterEventTriggerOwner_internal(Relation rel, static void AlterEventTriggerOwner_internal(Relation rel,
HeapTuple tup, HeapTuple tup,
Oid newOwnerId); Oid newOwnerId);
static event_trigger_command_tag_check_result check_ddl_tag(const char *tag); static event_trigger_command_tag_check_result check_ddl_tag(const char *tag);
static event_trigger_command_tag_check_result check_table_rewrite_ddl_tag( static event_trigger_command_tag_check_result check_table_rewrite_ddl_tag(
const char *tag); const char *tag);
static void error_duplicate_filter_variable(const char *defname); static void error_duplicate_filter_variable(const char *defname);
static Datum filter_list_to_array(List *filterlist); static Datum filter_list_to_array(List *filterlist);
static Oid insert_event_trigger_tuple(const char *trigname, const char *eventname, static Oid insert_event_trigger_tuple(const char *trigname, const char *eventname,
Oid evtOwner, Oid funcoid, List *tags); Oid evtOwner, Oid funcoid, List *tags);
static void validate_ddl_tags(const char *filtervar, List *taglist); static void validate_ddl_tags(const char *filtervar, List *taglist);
static void validate_table_rewrite_tags(const char *filtervar, List *taglist); static void validate_table_rewrite_tags(const char *filtervar, List *taglist);
static void EventTriggerInvoke(List *fn_oid_list, EventTriggerData *trigdata); static void EventTriggerInvoke(List *fn_oid_list, EventTriggerData *trigdata);

View File

@ -54,79 +54,79 @@ explain_get_index_name_hook_type explain_get_index_name_hook = NULL;
#define X_NOWHITESPACE 4 #define X_NOWHITESPACE 4
static void ExplainOneQuery(Query *query, int cursorOptions, static void ExplainOneQuery(Query *query, int cursorOptions,
IntoClause *into, ExplainState *es, IntoClause *into, ExplainState *es,
const char *queryString, ParamListInfo params, const char *queryString, ParamListInfo params,
QueryEnvironment *queryEnv); QueryEnvironment *queryEnv);
static void report_triggers(ResultRelInfo *rInfo, bool show_relname, static void report_triggers(ResultRelInfo *rInfo, bool show_relname,
ExplainState *es); ExplainState *es);
static double elapsed_time(instr_time *starttime); static double elapsed_time(instr_time *starttime);
static bool ExplainPreScanNode(PlanState *planstate, Bitmapset **rels_used); static bool ExplainPreScanNode(PlanState *planstate, Bitmapset **rels_used);
static void ExplainNode(PlanState *planstate, List *ancestors, static void ExplainNode(PlanState *planstate, List *ancestors,
const char *relationship, const char *plan_name, const char *relationship, const char *plan_name,
ExplainState *es); ExplainState *es);
static void show_plan_tlist(PlanState *planstate, List *ancestors, static void show_plan_tlist(PlanState *planstate, List *ancestors,
ExplainState *es); ExplainState *es);
static void show_expression(Node *node, const char *qlabel, static void show_expression(Node *node, const char *qlabel,
PlanState *planstate, List *ancestors, PlanState *planstate, List *ancestors,
bool useprefix, ExplainState *es); bool useprefix, ExplainState *es);
static void show_qual(List *qual, const char *qlabel, static void show_qual(List *qual, const char *qlabel,
PlanState *planstate, List *ancestors, PlanState *planstate, List *ancestors,
bool useprefix, ExplainState *es); bool useprefix, ExplainState *es);
static void show_scan_qual(List *qual, const char *qlabel, static void show_scan_qual(List *qual, const char *qlabel,
PlanState *planstate, List *ancestors, PlanState *planstate, List *ancestors,
ExplainState *es); ExplainState *es);
static void show_upper_qual(List *qual, const char *qlabel, static void show_upper_qual(List *qual, const char *qlabel,
PlanState *planstate, List *ancestors, PlanState *planstate, List *ancestors,
ExplainState *es); ExplainState *es);
static void show_sort_keys(SortState *sortstate, List *ancestors, static void show_sort_keys(SortState *sortstate, List *ancestors,
ExplainState *es); ExplainState *es);
static void show_merge_append_keys(MergeAppendState *mstate, List *ancestors, static void show_merge_append_keys(MergeAppendState *mstate, List *ancestors,
ExplainState *es); ExplainState *es);
static void show_agg_keys(AggState *astate, List *ancestors, static void show_agg_keys(AggState *astate, List *ancestors,
ExplainState *es); ExplainState *es);
static void show_grouping_sets(PlanState *planstate, Agg *agg, static void show_grouping_sets(PlanState *planstate, Agg *agg,
List *ancestors, ExplainState *es); List *ancestors, ExplainState *es);
static void show_grouping_set_keys(PlanState *planstate, static void show_grouping_set_keys(PlanState *planstate,
Agg *aggnode, Sort *sortnode, Agg *aggnode, Sort *sortnode,
List *context, bool useprefix, List *context, bool useprefix,
List *ancestors, ExplainState *es); List *ancestors, ExplainState *es);
static void show_group_keys(GroupState *gstate, List *ancestors, static void show_group_keys(GroupState *gstate, List *ancestors,
ExplainState *es); ExplainState *es);
static void show_sort_group_keys(PlanState *planstate, const char *qlabel, static void show_sort_group_keys(PlanState *planstate, const char *qlabel,
int nkeys, AttrNumber *keycols, int nkeys, AttrNumber *keycols,
Oid *sortOperators, Oid *collations, bool *nullsFirst, Oid *sortOperators, Oid *collations, bool *nullsFirst,
List *ancestors, ExplainState *es); List *ancestors, ExplainState *es);
static void show_sortorder_options(StringInfo buf, Node *sortexpr, static void show_sortorder_options(StringInfo buf, Node *sortexpr,
Oid sortOperator, Oid collation, bool nullsFirst); Oid sortOperator, Oid collation, bool nullsFirst);
static void show_tablesample(TableSampleClause *tsc, PlanState *planstate, static void show_tablesample(TableSampleClause *tsc, PlanState *planstate,
List *ancestors, ExplainState *es); List *ancestors, ExplainState *es);
static void show_sort_info(SortState *sortstate, ExplainState *es); static void show_sort_info(SortState *sortstate, ExplainState *es);
static void show_hash_info(HashState *hashstate, ExplainState *es); static void show_hash_info(HashState *hashstate, ExplainState *es);
static void show_tidbitmap_info(BitmapHeapScanState *planstate, static void show_tidbitmap_info(BitmapHeapScanState *planstate,
ExplainState *es); ExplainState *es);
static void show_instrumentation_count(const char *qlabel, int which, static void show_instrumentation_count(const char *qlabel, int which,
PlanState *planstate, ExplainState *es); PlanState *planstate, ExplainState *es);
static void show_foreignscan_info(ForeignScanState *fsstate, ExplainState *es); static void show_foreignscan_info(ForeignScanState *fsstate, ExplainState *es);
static void show_eval_params(Bitmapset *bms_params, ExplainState *es); static void show_eval_params(Bitmapset *bms_params, ExplainState *es);
static const char *explain_get_index_name(Oid indexId); static const char *explain_get_index_name(Oid indexId);
static void show_buffer_usage(ExplainState *es, const BufferUsage *usage); static void show_buffer_usage(ExplainState *es, const BufferUsage *usage);
static void ExplainIndexScanDetails(Oid indexid, ScanDirection indexorderdir, static void ExplainIndexScanDetails(Oid indexid, ScanDirection indexorderdir,
ExplainState *es); ExplainState *es);
static void ExplainScanTarget(Scan *plan, ExplainState *es); static void ExplainScanTarget(Scan *plan, ExplainState *es);
static void ExplainModifyTarget(ModifyTable *plan, ExplainState *es); static void ExplainModifyTarget(ModifyTable *plan, ExplainState *es);
static void ExplainTargetRel(Plan *plan, Index rti, ExplainState *es); static void ExplainTargetRel(Plan *plan, Index rti, ExplainState *es);
static void show_modifytable_info(ModifyTableState *mtstate, List *ancestors, static void show_modifytable_info(ModifyTableState *mtstate, List *ancestors,
ExplainState *es); ExplainState *es);
static void ExplainMemberNodes(PlanState **planstates, int nsubnodes, static void ExplainMemberNodes(PlanState **planstates, int nsubnodes,
int nplans, List *ancestors, ExplainState *es); int nplans, List *ancestors, ExplainState *es);
static void ExplainSubPlans(List *plans, List *ancestors, static void ExplainSubPlans(List *plans, List *ancestors,
const char *relationship, ExplainState *es); const char *relationship, ExplainState *es);
static void ExplainCustomChildren(CustomScanState *css, static void ExplainCustomChildren(CustomScanState *css,
List *ancestors, ExplainState *es); List *ancestors, ExplainState *es);
static void ExplainProperty(const char *qlabel, const char *unit, static void ExplainProperty(const char *qlabel, const char *unit,
const char *value, bool numeric, ExplainState *es); const char *value, bool numeric, ExplainState *es);
static void ExplainDummyGroup(const char *objtype, const char *labelname, static void ExplainDummyGroup(const char *objtype, const char *labelname,
ExplainState *es); ExplainState *es);
static void ExplainXMLTag(const char *tagname, int flags, ExplainState *es); static void ExplainXMLTag(const char *tagname, int flags, ExplainState *es);
static void ExplainJSONLineEnding(ExplainState *es); static void ExplainJSONLineEnding(ExplainState *es);
static void ExplainYAMLLineStarting(ExplainState *es); static void ExplainYAMLLineStarting(ExplainState *es);

View File

@ -104,27 +104,27 @@ typedef struct ExtensionVersionInfo
/* Local functions */ /* Local functions */
static List *find_update_path(List *evi_list, static List *find_update_path(List *evi_list,
ExtensionVersionInfo *evi_start, ExtensionVersionInfo *evi_start,
ExtensionVersionInfo *evi_target, ExtensionVersionInfo *evi_target,
bool reject_indirect, bool reject_indirect,
bool reinitialize); bool reinitialize);
static Oid get_required_extension(char *reqExtensionName, static Oid get_required_extension(char *reqExtensionName,
char *extensionName, char *extensionName,
char *origSchemaName, char *origSchemaName,
bool cascade, bool cascade,
List *parents, List *parents,
bool is_create); bool is_create);
static void get_available_versions_for_extension(ExtensionControlFile *pcontrol, static void get_available_versions_for_extension(ExtensionControlFile *pcontrol,
Tuplestorestate *tupstore, Tuplestorestate *tupstore,
TupleDesc tupdesc); TupleDesc tupdesc);
static Datum convert_requires_to_datum(List *requires); static Datum convert_requires_to_datum(List *requires);
static void ApplyExtensionUpdates(Oid extensionOid, static void ApplyExtensionUpdates(Oid extensionOid,
ExtensionControlFile *pcontrol, ExtensionControlFile *pcontrol,
const char *initialVersion, const char *initialVersion,
List *updateVersions, List *updateVersions,
char *origSchemaName, char *origSchemaName,
bool cascade, bool cascade,
bool is_create); bool is_create);
static char *read_whole_file(const char *filename, int *length); static char *read_whole_file(const char *filename, int *length);

Some files were not shown because too many files have changed in this diff Show More