PostgreSQL Source Code  git master
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * tlist.h
4  * prototypes for tlist.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/optimizer/tlist.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef TLIST_H
15 #define TLIST_H
17 #include "nodes/pathnodes.h"
20 extern TargetEntry *tlist_member(Expr *node, List *targetlist);
21 extern TargetEntry *tlist_member_ignore_relabel(Expr *node, List *targetlist);
23 extern List *add_to_flat_tlist(List *tlist, List *exprs);
25 extern List *get_tlist_exprs(List *tlist, bool includeJunk);
27 extern bool tlist_same_exprs(List *tlist1, List *tlist2);
29 extern bool tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK);
30 extern bool tlist_same_collations(List *tlist, List *colCollations, bool junkOK);
32 extern void apply_tlist_labeling(List *dest_tlist, List *src_tlist);
34 extern Oid *extract_grouping_ops(List *groupClause);
35 extern Oid *extract_grouping_collations(List *groupClause, List *tlist);
36 extern AttrNumber *extract_grouping_cols(List *groupClause, List *tlist);
37 extern bool grouping_is_sortable(List *groupClause);
38 extern bool grouping_is_hashable(List *groupClause);
44 extern void add_column_to_pathtarget(PathTarget *target,
45  Expr *expr, Index sortgroupref);
46 extern void add_new_column_to_pathtarget(PathTarget *target, Expr *expr);
47 extern void add_new_columns_to_pathtarget(PathTarget *target, List *exprs);
48 extern void apply_pathtarget_labeling_to_tlist(List *tlist, PathTarget *target);
49 extern void split_pathtarget_at_srfs(PlannerInfo *root,
50  PathTarget *target, PathTarget *input_target,
51  List **targets, List **targets_contain_srfs);
53 /* Convenience macro to get a PathTarget with valid cost/width fields */
54 #define create_pathtarget(root, tlist) \
55  set_pathtarget_cost_width(root, make_pathtarget_from_tlist(tlist))
57 #endif /* TLIST_H */
bool grouping_is_hashable(List *groupClause)
Definition: tlist.c:577
List * get_tlist_exprs(List *tlist, bool includeJunk)
Definition: tlist.c:180
AttrNumber * extract_grouping_cols(List *groupClause, List *tlist)
Definition: tlist.c:531
bool grouping_is_sortable(List *groupClause)
Definition: tlist.c:557
void add_new_column_to_pathtarget(PathTarget *target, Expr *expr)
Definition: tlist.c:741
void add_new_columns_to_pathtarget(PathTarget *target, List *exprs)
Definition: tlist.c:752
TargetEntry * tlist_member(Expr *node, List *targetlist)
Definition: tlist.c:68
unsigned int Oid
Definition: postgres_ext.h:31
bool tlist_same_collations(List *tlist, List *colCollations, bool junkOK)
Definition: tlist.c:299
PathTarget * make_pathtarget_from_tlist(List *tlist)
Definition: tlist.c:608
void apply_pathtarget_labeling_to_tlist(List *tlist, PathTarget *target)
Definition: tlist.c:774
void apply_tlist_labeling(List *dest_tlist, List *src_tlist)
Definition: tlist.c:335
List * make_tlist_from_pathtarget(PathTarget *target)
Definition: tlist.c:634
bool tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK)
Definition: tlist.c:265
Oid * extract_grouping_ops(List *groupClause)
Definition: tlist.c:480
Oid * extract_grouping_collations(List *groupClause, List *tlist)
Definition: tlist.c:506
bool tlist_same_exprs(List *tlist1, List *tlist2)
Definition: tlist.c:235
PathTarget * create_empty_pathtarget(void)
Definition: tlist.c:691
PathTarget * copy_pathtarget(PathTarget *src)
Definition: tlist.c:667
unsigned int Index
Definition: c.h:549
TargetEntry * tlist_member_ignore_relabel(Expr *node, List *targetlist)
Definition: tlist.c:89
void add_column_to_pathtarget(PathTarget *target, Expr *expr, Index sortgroupref)
Definition: tlist.c:705
Definition: pg_list.h:50
List * add_to_flat_tlist(List *tlist, List *exprs)
Definition: tlist.c:149
int16 AttrNumber
Definition: attnum.h:21
void split_pathtarget_at_srfs(PlannerInfo *root, PathTarget *target, PathTarget *input_target, List **targets, List **targets_contain_srfs)
Definition: tlist.c:881