PostgreSQL Source Code  git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tlist.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * tlist.h
4  * prototypes for tlist.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2024, 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
16 
17 #include "nodes/pathnodes.h"
18 
19 
20 extern TargetEntry *tlist_member(Expr *node, List *targetlist);
21 
22 extern List *add_to_flat_tlist(List *tlist, List *exprs);
23 
24 extern List *get_tlist_exprs(List *tlist, bool includeJunk);
25 
26 extern bool tlist_same_exprs(List *tlist1, List *tlist2);
27 
28 extern bool tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK);
29 extern bool tlist_same_collations(List *tlist, List *colCollations, bool junkOK);
30 
31 extern void apply_tlist_labeling(List *dest_tlist, List *src_tlist);
32 
33 extern Oid *extract_grouping_ops(List *groupClause);
34 extern Oid *extract_grouping_collations(List *groupClause, List *tlist);
35 extern AttrNumber *extract_grouping_cols(List *groupClause, List *tlist);
36 extern bool grouping_is_sortable(List *groupClause);
37 extern bool grouping_is_hashable(List *groupClause);
38 
43 extern void add_column_to_pathtarget(PathTarget *target,
44  Expr *expr, Index sortgroupref);
45 extern void add_new_column_to_pathtarget(PathTarget *target, Expr *expr);
46 extern void add_new_columns_to_pathtarget(PathTarget *target, List *exprs);
47 extern void apply_pathtarget_labeling_to_tlist(List *tlist, PathTarget *target);
49  PathTarget *target, PathTarget *input_target,
50  List **targets, List **targets_contain_srfs);
51 
52 /* Convenience macro to get a PathTarget with valid cost/width fields */
53 #define create_pathtarget(root, tlist) \
54  set_pathtarget_cost_width(root, make_pathtarget_from_tlist(tlist))
55 
56 #endif /* TLIST_H */
int16 AttrNumber
Definition: attnum.h:21
unsigned int Index
Definition: c.h:619
unsigned int Oid
Definition: postgres_ext.h:31
tree ctl root
Definition: radixtree.h:1886
Definition: pg_list.h:54
bool tlist_same_collations(List *tlist, List *colCollations, bool junkOK)
Definition: tlist.c:282
bool tlist_same_exprs(List *tlist1, List *tlist2)
Definition: tlist.c:218
void apply_tlist_labeling(List *dest_tlist, List *src_tlist)
Definition: tlist.c:318
Oid * extract_grouping_collations(List *groupClause, List *tlist)
Definition: tlist.c:489
PathTarget * copy_pathtarget(PathTarget *src)
Definition: tlist.c:657
void apply_pathtarget_labeling_to_tlist(List *tlist, PathTarget *target)
Definition: tlist.c:774
List * get_tlist_exprs(List *tlist, bool includeJunk)
Definition: tlist.c:163
bool grouping_is_sortable(List *groupClause)
Definition: tlist.c:540
List * add_to_flat_tlist(List *tlist, List *exprs)
Definition: tlist.c:132
void add_new_columns_to_pathtarget(PathTarget *target, List *exprs)
Definition: tlist.c:752
PathTarget * create_empty_pathtarget(void)
Definition: tlist.c:681
Oid * extract_grouping_ops(List *groupClause)
Definition: tlist.c:463
AttrNumber * extract_grouping_cols(List *groupClause, List *tlist)
Definition: tlist.c:514
void add_new_column_to_pathtarget(PathTarget *target, Expr *expr)
Definition: tlist.c:741
List * make_tlist_from_pathtarget(PathTarget *target)
Definition: tlist.c:624
TargetEntry * tlist_member(Expr *node, List *targetlist)
Definition: tlist.c:79
void split_pathtarget_at_srfs(PlannerInfo *root, PathTarget *target, PathTarget *input_target, List **targets, List **targets_contain_srfs)
Definition: tlist.c:881
PathTarget * make_pathtarget_from_tlist(List *tlist)
Definition: tlist.c:591
bool grouping_is_hashable(List *groupClause)
Definition: tlist.c:560
void add_column_to_pathtarget(PathTarget *target, Expr *expr, Index sortgroupref)
Definition: tlist.c:695
bool tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK)
Definition: tlist.c:248