PostgreSQL Source Code  git master
pg_list.h File Reference
#include "nodes/nodes.h"
Include dependency graph for pg_list.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  ListCell
 
struct  List
 
struct  ForEachState
 
struct  ForBothState
 
struct  ForBothCellState
 
struct  ForThreeState
 
struct  ForFourState
 
struct  ForFiveState
 

Macros

#define NIL   ((List *) NULL)
 
#define lfirst(lc)   ((lc)->ptr_value)
 
#define lfirst_int(lc)   ((lc)->int_value)
 
#define lfirst_oid(lc)   ((lc)->oid_value)
 
#define lfirst_node(type, lc)   castNode(type, lfirst(lc))
 
#define linitial(l)   lfirst(list_nth_cell(l, 0))
 
#define linitial_int(l)   lfirst_int(list_nth_cell(l, 0))
 
#define linitial_oid(l)   lfirst_oid(list_nth_cell(l, 0))
 
#define linitial_node(type, l)   castNode(type, linitial(l))
 
#define lsecond(l)   lfirst(list_nth_cell(l, 1))
 
#define lsecond_int(l)   lfirst_int(list_nth_cell(l, 1))
 
#define lsecond_oid(l)   lfirst_oid(list_nth_cell(l, 1))
 
#define lsecond_node(type, l)   castNode(type, lsecond(l))
 
#define lthird(l)   lfirst(list_nth_cell(l, 2))
 
#define lthird_int(l)   lfirst_int(list_nth_cell(l, 2))
 
#define lthird_oid(l)   lfirst_oid(list_nth_cell(l, 2))
 
#define lthird_node(type, l)   castNode(type, lthird(l))
 
#define lfourth(l)   lfirst(list_nth_cell(l, 3))
 
#define lfourth_int(l)   lfirst_int(list_nth_cell(l, 3))
 
#define lfourth_oid(l)   lfirst_oid(list_nth_cell(l, 3))
 
#define lfourth_node(type, l)   castNode(type, lfourth(l))
 
#define llast(l)   lfirst(list_last_cell(l))
 
#define llast_int(l)   lfirst_int(list_last_cell(l))
 
#define llast_oid(l)   lfirst_oid(list_last_cell(l))
 
#define llast_node(type, l)   castNode(type, llast(l))
 
#define list_make_ptr_cell(v)   ((ListCell) {.ptr_value = (v)})
 
#define list_make_int_cell(v)   ((ListCell) {.int_value = (v)})
 
#define list_make_oid_cell(v)   ((ListCell) {.oid_value = (v)})
 
#define list_make1(x1)    list_make1_impl(T_List, list_make_ptr_cell(x1))
 
#define list_make2(x1, x2)    list_make2_impl(T_List, list_make_ptr_cell(x1), list_make_ptr_cell(x2))
 
#define list_make3(x1, x2, x3)
 
#define list_make4(x1, x2, x3, x4)
 
#define list_make5(x1, x2, x3, x4, x5)
 
#define list_make1_int(x1)    list_make1_impl(T_IntList, list_make_int_cell(x1))
 
#define list_make2_int(x1, x2)    list_make2_impl(T_IntList, list_make_int_cell(x1), list_make_int_cell(x2))
 
#define list_make3_int(x1, x2, x3)
 
#define list_make4_int(x1, x2, x3, x4)
 
#define list_make5_int(x1, x2, x3, x4, x5)
 
#define list_make1_oid(x1)    list_make1_impl(T_OidList, list_make_oid_cell(x1))
 
#define list_make2_oid(x1, x2)    list_make2_impl(T_OidList, list_make_oid_cell(x1), list_make_oid_cell(x2))
 
#define list_make3_oid(x1, x2, x3)
 
#define list_make4_oid(x1, x2, x3, x4)
 
#define list_make5_oid(x1, x2, x3, x4, x5)
 
#define list_nth_node(type, list, n)   castNode(type, list_nth(list, n))
 
#define foreach(cell, lst)
 
#define foreach_delete_current(lst, cell)
 
#define foreach_current_index(cell)   (cell##__state.i)
 
#define for_each_from(cell, lst, N)
 
#define for_each_cell(cell, lst, initcell)
 
#define forboth(cell1, list1, cell2, list2)
 
#define multi_for_advance_cell(cell, state, l, i)
 
#define for_both_cell(cell1, list1, initcell1, cell2, list2, initcell2)
 
#define forthree(cell1, list1, cell2, list2, cell3, list3)
 
#define forfour(cell1, list1, cell2, list2, cell3, list3, cell4, list4)
 
#define forfive(cell1, list1, cell2, list2, cell3, list3, cell4, list4, cell5, list5)
 

Typedefs

typedef union ListCell ListCell
 
typedef struct List List
 
typedef struct ForEachState ForEachState
 
typedef struct ForBothState ForBothState
 
typedef struct ForBothCellState ForBothCellState
 
typedef struct ForThreeState ForThreeState
 
typedef struct ForFourState ForFourState
 
typedef struct ForFiveState ForFiveState
 
typedef int(* list_sort_comparator) (const ListCell *a, const ListCell *b)
 

Functions

static ListCelllist_head (const List *l)
 
static ListCelllist_tail (const List *l)
 
static ListCelllist_second_cell (const List *l)
 
static int list_length (const List *l)
 
static ListCelllist_nth_cell (const List *list, int n)
 
static ListCelllist_last_cell (const List *list)
 
static void * list_nth (const List *list, int n)
 
static int list_nth_int (const List *list, int n)
 
static Oid list_nth_oid (const List *list, int n)
 
static int list_cell_number (const List *l, const ListCell *c)
 
static ListCelllnext (const List *l, const ListCell *c)
 
static ForEachState for_each_from_setup (const List *lst, int N)
 
static ForEachState for_each_cell_setup (const List *lst, const ListCell *initcell)
 
static ForBothCellState for_both_cell_setup (const List *list1, const ListCell *initcell1, const List *list2, const ListCell *initcell2)
 
Listlist_make1_impl (NodeTag t, ListCell datum1)
 
Listlist_make2_impl (NodeTag t, ListCell datum1, ListCell datum2)
 
Listlist_make3_impl (NodeTag t, ListCell datum1, ListCell datum2, ListCell datum3)
 
Listlist_make4_impl (NodeTag t, ListCell datum1, ListCell datum2, ListCell datum3, ListCell datum4)
 
Listlist_make5_impl (NodeTag t, ListCell datum1, ListCell datum2, ListCell datum3, ListCell datum4, ListCell datum5)
 
pg_nodiscard Listlappend (List *list, void *datum)
 
pg_nodiscard Listlappend_int (List *list, int datum)
 
pg_nodiscard Listlappend_oid (List *list, Oid datum)
 
pg_nodiscard Listlist_insert_nth (List *list, int pos, void *datum)
 
pg_nodiscard Listlist_insert_nth_int (List *list, int pos, int datum)
 
pg_nodiscard Listlist_insert_nth_oid (List *list, int pos, Oid datum)
 
pg_nodiscard Listlcons (void *datum, List *list)
 
pg_nodiscard Listlcons_int (int datum, List *list)
 
pg_nodiscard Listlcons_oid (Oid datum, List *list)
 
pg_nodiscard Listlist_concat (List *list1, const List *list2)
 
pg_nodiscard Listlist_concat_copy (const List *list1, const List *list2)
 
pg_nodiscard Listlist_truncate (List *list, int new_size)
 
bool list_member (const List *list, const void *datum)
 
bool list_member_ptr (const List *list, const void *datum)
 
bool list_member_int (const List *list, int datum)
 
bool list_member_oid (const List *list, Oid datum)
 
pg_nodiscard Listlist_delete (List *list, void *datum)
 
pg_nodiscard Listlist_delete_ptr (List *list, void *datum)
 
pg_nodiscard Listlist_delete_int (List *list, int datum)
 
pg_nodiscard Listlist_delete_oid (List *list, Oid datum)
 
pg_nodiscard Listlist_delete_first (List *list)
 
pg_nodiscard Listlist_delete_last (List *list)
 
pg_nodiscard Listlist_delete_first_n (List *list, int n)
 
pg_nodiscard Listlist_delete_nth_cell (List *list, int n)
 
pg_nodiscard Listlist_delete_cell (List *list, ListCell *cell)
 
Listlist_union (const List *list1, const List *list2)
 
Listlist_union_ptr (const List *list1, const List *list2)
 
Listlist_union_int (const List *list1, const List *list2)
 
Listlist_union_oid (const List *list1, const List *list2)
 
Listlist_intersection (const List *list1, const List *list2)
 
Listlist_intersection_int (const List *list1, const List *list2)
 
Listlist_difference (const List *list1, const List *list2)
 
Listlist_difference_ptr (const List *list1, const List *list2)
 
Listlist_difference_int (const List *list1, const List *list2)
 
Listlist_difference_oid (const List *list1, const List *list2)
 
pg_nodiscard Listlist_append_unique (List *list, void *datum)
 
pg_nodiscard Listlist_append_unique_ptr (List *list, void *datum)
 
pg_nodiscard Listlist_append_unique_int (List *list, int datum)
 
pg_nodiscard Listlist_append_unique_oid (List *list, Oid datum)
 
pg_nodiscard Listlist_concat_unique (List *list1, const List *list2)
 
pg_nodiscard Listlist_concat_unique_ptr (List *list1, const List *list2)
 
pg_nodiscard Listlist_concat_unique_int (List *list1, const List *list2)
 
pg_nodiscard Listlist_concat_unique_oid (List *list1, const List *list2)
 
void list_deduplicate_oid (List *list)
 
void list_free (List *list)
 
void list_free_deep (List *list)
 
pg_nodiscard Listlist_copy (const List *list)
 
pg_nodiscard Listlist_copy_tail (const List *list, int nskip)
 
pg_nodiscard Listlist_copy_deep (const List *oldlist)
 
void list_sort (List *list, list_sort_comparator cmp)
 
int list_int_cmp (const ListCell *p1, const ListCell *p2)
 
int list_oid_cmp (const ListCell *p1, const ListCell *p2)
 

Macro Definition Documentation

◆ for_both_cell

#define for_both_cell (   cell1,
  list1,
  initcell1,
  cell2,
  list2,
  initcell2 
)
Value:
for (ForBothCellState cell1##__state = \
for_both_cell_setup(list1, initcell1, list2, initcell2); \
multi_for_advance_cell(cell1, cell1##__state, l1, i1), \
multi_for_advance_cell(cell2, cell1##__state, l2, i2), \
(cell1 != NULL && cell2 != NULL); \
cell1##__state.i1++, cell1##__state.i2++)
static ForBothCellState for_both_cell_setup(const List *list1, const ListCell *initcell1, const List *list2, const ListCell *initcell2)
Definition: pg_list.h:477

Definition at line 468 of file pg_list.h.

◆ for_each_cell

#define for_each_cell (   cell,
  lst,
  initcell 
)
Value:
for (ForEachState cell##__state = for_each_cell_setup(lst, initcell); \
(cell##__state.l != NIL && \
cell##__state.i < cell##__state.l->length) ? \
(cell = &cell##__state.l->elements[cell##__state.i], true) : \
(cell = NULL, false); \
cell##__state.i++)
#define NIL
Definition: pg_list.h:65
static ForEachState for_each_cell_setup(const List *lst, const ListCell *initcell)
Definition: pg_list.h:426

Definition at line 417 of file pg_list.h.

◆ for_each_from

#define for_each_from (   cell,
  lst,
 
)
Value:
for (ForEachState cell##__state = for_each_from_setup(lst, N); \
(cell##__state.l != NIL && \
cell##__state.i < cell##__state.l->length) ? \
(cell = &cell##__state.l->elements[cell##__state.i], true) : \
(cell = NULL, false); \
cell##__state.i++)
static ForEachState for_each_from_setup(const List *lst, int N)
Definition: pg_list.h:402

Definition at line 393 of file pg_list.h.

◆ forboth

#define forboth (   cell1,
  list1,
  cell2,
  list2 
)
Value:
for (ForBothState cell1##__state = {(list1), (list2), 0}; \
multi_for_advance_cell(cell1, cell1##__state, l1, i), \
multi_for_advance_cell(cell2, cell1##__state, l2, i), \
(cell1 != NULL && cell2 != NULL); \
cell1##__state.i++)
int i
Definition: isn.c:73

Definition at line 446 of file pg_list.h.

◆ foreach

#define foreach (   cell,
  lst 
)
Value:
for (ForEachState cell##__state = {(lst), 0}; \
(cell##__state.l != NIL && \
cell##__state.i < cell##__state.l->length) ? \
(cell = &cell##__state.l->elements[cell##__state.i], true) : \
(cell = NULL, false); \
cell##__state.i++)

Definition at line 352 of file pg_list.h.

◆ foreach_current_index

#define foreach_current_index (   cell)    (cell##__state.i)

Definition at line 382 of file pg_list.h.

◆ foreach_delete_current

#define foreach_delete_current (   lst,
  cell 
)
Value:
(cell##__state.i--, \
(List *) (cell##__state.l = list_delete_cell(lst, cell)))
pg_nodiscard List * list_delete_cell(List *list, ListCell *cell)
Definition: list.c:800
Definition: pg_list.h:51

Definition at line 369 of file pg_list.h.

◆ forfive

#define forfive (   cell1,
  list1,
  cell2,
  list2,
  cell3,
  list3,
  cell4,
  list4,
  cell5,
  list5 
)
Value:
for (ForFiveState cell1##__state = {(list1), (list2), (list3), (list4), (list5), 0}; \
multi_for_advance_cell(cell1, cell1##__state, l1, i), \
multi_for_advance_cell(cell2, cell1##__state, l2, i), \
multi_for_advance_cell(cell3, cell1##__state, l3, i), \
multi_for_advance_cell(cell4, cell1##__state, l4, i), \
multi_for_advance_cell(cell5, cell1##__state, l5, i), \
(cell1 != NULL && cell2 != NULL && cell3 != NULL && \
cell4 != NULL && cell5 != NULL); \
cell1##__state.i++)

Definition at line 516 of file pg_list.h.

◆ forfour

#define forfour (   cell1,
  list1,
  cell2,
  list2,
  cell3,
  list3,
  cell4,
  list4 
)
Value:
for (ForFourState cell1##__state = {(list1), (list2), (list3), (list4), 0}; \
multi_for_advance_cell(cell1, cell1##__state, l1, i), \
multi_for_advance_cell(cell2, cell1##__state, l2, i), \
multi_for_advance_cell(cell3, cell1##__state, l3, i), \
multi_for_advance_cell(cell4, cell1##__state, l4, i), \
(cell1 != NULL && cell2 != NULL && cell3 != NULL && cell4 != NULL); \
cell1##__state.i++)

Definition at line 503 of file pg_list.h.

◆ forthree

#define forthree (   cell1,
  list1,
  cell2,
  list2,
  cell3,
  list3 
)
Value:
for (ForThreeState cell1##__state = {(list1), (list2), (list3), 0}; \
multi_for_advance_cell(cell1, cell1##__state, l1, i), \
multi_for_advance_cell(cell2, cell1##__state, l2, i), \
multi_for_advance_cell(cell3, cell1##__state, l3, i), \
(cell1 != NULL && cell2 != NULL && cell3 != NULL); \
cell1##__state.i++)

Definition at line 491 of file pg_list.h.

◆ lfirst

#define lfirst (   lc)    ((lc)->ptr_value)

Definition at line 169 of file pg_list.h.

◆ lfirst_int

#define lfirst_int (   lc)    ((lc)->int_value)

Definition at line 170 of file pg_list.h.

◆ lfirst_node

#define lfirst_node (   type,
  lc 
)    castNode(type, lfirst(lc))

Definition at line 172 of file pg_list.h.

◆ lfirst_oid

#define lfirst_oid (   lc)    ((lc)->oid_value)

Definition at line 171 of file pg_list.h.

◆ lfourth

#define lfourth (   l)    lfirst(list_nth_cell(l, 3))

Definition at line 189 of file pg_list.h.

◆ lfourth_int

#define lfourth_int (   l)    lfirst_int(list_nth_cell(l, 3))

Definition at line 190 of file pg_list.h.

◆ lfourth_node

#define lfourth_node (   type,
 
)    castNode(type, lfourth(l))

Definition at line 192 of file pg_list.h.

◆ lfourth_oid

#define lfourth_oid (   l)    lfirst_oid(list_nth_cell(l, 3))

Definition at line 191 of file pg_list.h.

◆ linitial

#define linitial (   l)    lfirst(list_nth_cell(l, 0))

Definition at line 174 of file pg_list.h.

◆ linitial_int

#define linitial_int (   l)    lfirst_int(list_nth_cell(l, 0))

Definition at line 175 of file pg_list.h.

◆ linitial_node

#define linitial_node (   type,
 
)    castNode(type, linitial(l))

Definition at line 177 of file pg_list.h.

◆ linitial_oid

#define linitial_oid (   l)    lfirst_oid(list_nth_cell(l, 0))

Definition at line 176 of file pg_list.h.

◆ list_make1

#define list_make1 (   x1)     list_make1_impl(T_List, list_make_ptr_cell(x1))

Definition at line 206 of file pg_list.h.

◆ list_make1_int

#define list_make1_int (   x1)     list_make1_impl(T_IntList, list_make_int_cell(x1))

Definition at line 221 of file pg_list.h.

◆ list_make1_oid

#define list_make1_oid (   x1)     list_make1_impl(T_OidList, list_make_oid_cell(x1))

Definition at line 236 of file pg_list.h.

◆ list_make2

#define list_make2 (   x1,
  x2 
)     list_make2_impl(T_List, list_make_ptr_cell(x1), list_make_ptr_cell(x2))

Definition at line 208 of file pg_list.h.

◆ list_make2_int

#define list_make2_int (   x1,
  x2 
)     list_make2_impl(T_IntList, list_make_int_cell(x1), list_make_int_cell(x2))

Definition at line 223 of file pg_list.h.

◆ list_make2_oid

#define list_make2_oid (   x1,
  x2 
)     list_make2_impl(T_OidList, list_make_oid_cell(x1), list_make_oid_cell(x2))

Definition at line 238 of file pg_list.h.

◆ list_make3

#define list_make3 (   x1,
  x2,
  x3 
)
Value:
@ T_List
Definition: nodes.h:302
#define list_make_ptr_cell(v)
Definition: pg_list.h:202
List * list_make3_impl(NodeTag t, ListCell datum1, ListCell datum2, ListCell datum3)
Definition: list.c:254

Definition at line 210 of file pg_list.h.

◆ list_make3_int

#define list_make3_int (   x1,
  x2,
  x3 
)
Value:
@ T_IntList
Definition: nodes.h:303
#define list_make_int_cell(v)
Definition: pg_list.h:203

Definition at line 225 of file pg_list.h.

◆ list_make3_oid

#define list_make3_oid (   x1,
  x2,
  x3 
)
Value:
@ T_OidList
Definition: nodes.h:304
#define list_make_oid_cell(v)
Definition: pg_list.h:204

Definition at line 240 of file pg_list.h.

◆ list_make4

#define list_make4 (   x1,
  x2,
  x3,
  x4 
)
Value:
List * list_make4_impl(NodeTag t, ListCell datum1, ListCell datum2, ListCell datum3, ListCell datum4)
Definition: list.c:267

Definition at line 213 of file pg_list.h.

◆ list_make4_int

#define list_make4_int (   x1,
  x2,
  x3,
  x4 
)

◆ list_make4_oid

#define list_make4_oid (   x1,
  x2,
  x3,
  x4 
)

◆ list_make5

#define list_make5 (   x1,
  x2,
  x3,
  x4,
  x5 
)
Value:
List * list_make5_impl(NodeTag t, ListCell datum1, ListCell datum2, ListCell datum3, ListCell datum4, ListCell datum5)
Definition: list.c:281

Definition at line 216 of file pg_list.h.

◆ list_make5_int

#define list_make5_int (   x1,
  x2,
  x3,
  x4,
  x5 
)

◆ list_make5_oid

#define list_make5_oid (   x1,
  x2,
  x3,
  x4,
  x5 
)

◆ list_make_int_cell

#define list_make_int_cell (   v)    ((ListCell) {.int_value = (v)})

Definition at line 203 of file pg_list.h.

◆ list_make_oid_cell

#define list_make_oid_cell (   v)    ((ListCell) {.oid_value = (v)})

Definition at line 204 of file pg_list.h.

◆ list_make_ptr_cell

#define list_make_ptr_cell (   v)    ((ListCell) {.ptr_value = (v)})

Definition at line 202 of file pg_list.h.

◆ list_nth_node

#define list_nth_node (   type,
  list,
 
)    castNode(type, list_nth(list, n))

Definition at line 306 of file pg_list.h.

◆ llast

#define llast (   l)    lfirst(list_last_cell(l))

Definition at line 194 of file pg_list.h.

◆ llast_int

#define llast_int (   l)    lfirst_int(list_last_cell(l))

Definition at line 195 of file pg_list.h.

◆ llast_node

#define llast_node (   type,
 
)    castNode(type, llast(l))

Definition at line 197 of file pg_list.h.

◆ llast_oid

#define llast_oid (   l)    lfirst_oid(list_last_cell(l))

Definition at line 196 of file pg_list.h.

◆ lsecond

#define lsecond (   l)    lfirst(list_nth_cell(l, 1))

Definition at line 179 of file pg_list.h.

◆ lsecond_int

#define lsecond_int (   l)    lfirst_int(list_nth_cell(l, 1))

Definition at line 180 of file pg_list.h.

◆ lsecond_node

#define lsecond_node (   type,
 
)    castNode(type, lsecond(l))

Definition at line 182 of file pg_list.h.

◆ lsecond_oid

#define lsecond_oid (   l)    lfirst_oid(list_nth_cell(l, 1))

Definition at line 181 of file pg_list.h.

◆ lthird

#define lthird (   l)    lfirst(list_nth_cell(l, 2))

Definition at line 184 of file pg_list.h.

◆ lthird_int

#define lthird_int (   l)    lfirst_int(list_nth_cell(l, 2))

Definition at line 185 of file pg_list.h.

◆ lthird_node

#define lthird_node (   type,
 
)    castNode(type, lthird(l))

Definition at line 187 of file pg_list.h.

◆ lthird_oid

#define lthird_oid (   l)    lfirst_oid(list_nth_cell(l, 2))

Definition at line 186 of file pg_list.h.

◆ multi_for_advance_cell

#define multi_for_advance_cell (   cell,
  state,
  l,
  i 
)
Value:
(cell = (state.l != NIL && state.i < state.l->length) ? \
&state.l->elements[state.i] : NULL)
Definition: regguts.h:318

Definition at line 453 of file pg_list.h.

◆ NIL

#define NIL   ((List *) NULL)

Definition at line 65 of file pg_list.h.

Typedef Documentation

◆ ForBothCellState

◆ ForBothState

typedef struct ForBothState ForBothState

◆ ForEachState

typedef struct ForEachState ForEachState

◆ ForFiveState

typedef struct ForFiveState ForFiveState

◆ ForFourState

typedef struct ForFourState ForFourState

◆ ForThreeState

typedef struct ForThreeState ForThreeState

◆ List

typedef struct List List

◆ list_sort_comparator

typedef int(* list_sort_comparator) (const ListCell *a, const ListCell *b)

Definition at line 605 of file pg_list.h.

◆ ListCell

typedef union ListCell ListCell

Function Documentation

◆ for_both_cell_setup()

static ForBothCellState for_both_cell_setup ( const List list1,
const ListCell initcell1,
const List list2,
const ListCell initcell2 
)
inlinestatic

Definition at line 477 of file pg_list.h.

479 {
480  ForBothCellState r = {list1, list2,
481  initcell1 ? list_cell_number(list1, initcell1) : list_length(list1),
482  initcell2 ? list_cell_number(list2, initcell2) : list_length(list2)};
483 
484  return r;
485 }
static int list_length(const List *l)
Definition: pg_list.h:149
static int list_cell_number(const List *l, const ListCell *c)
Definition: pg_list.h:312

References list_cell_number(), and list_length().

◆ for_each_cell_setup()

static ForEachState for_each_cell_setup ( const List lst,
const ListCell initcell 
)
inlinestatic

Definition at line 426 of file pg_list.h.

427 {
428  ForEachState r = {lst,
429  initcell ? list_cell_number(lst, initcell) : list_length(lst)};
430 
431  return r;
432 }

References list_cell_number(), and list_length().

◆ for_each_from_setup()

static ForEachState for_each_from_setup ( const List lst,
int  N 
)
inlinestatic

Definition at line 402 of file pg_list.h.

403 {
404  ForEachState r = {lst, N};
405 
406  Assert(N >= 0);
407  return r;
408 }
Assert(fmt[strlen(fmt) - 1] !='\n')

References Assert().

◆ lappend()

pg_nodiscard List* lappend ( List list,
void *  datum 
)

Definition at line 336 of file list.c.

337 {
339 
340  if (list == NIL)
341  list = new_list(T_List, 1);
342  else
344 
345  llast(list) = datum;
347  return list;
348 }
static List * new_list(NodeTag type, int min_size)
Definition: list.c:88
#define check_list_invariants(l)
Definition: list.c:77
static void new_tail_cell(List *list)
Definition: list.c:320
#define IsPointerList(l)
Definition: list.c:54
#define llast(l)
Definition: pg_list.h:194

References Assert(), check_list_invariants, IsPointerList, sort-test::list, llast, new_list(), new_tail_cell(), NIL, and T_List.

Referenced by _SPI_make_plan_non_temp(), _SPI_prepare_oneshot_plan(), _SPI_prepare_plan(), _SPI_save_plan(), accumulate_append_subpath(), AcquireRewriteLocks(), add_column_to_pathtarget(), add_dummy_return(), add_eq_member(), add_join_clause_to_rels(), add_join_rel(), add_local_reloption(), add_merged_range_bounds(), add_part_relids(), add_paths_to_append_rel(), add_placeholders_to_base_rels(), add_placeholders_to_joinrel(), add_row_identity_var(), add_rte_to_flat_rtable(), add_security_quals(), add_to_flat_tlist(), add_unique_group_var(), add_vars_to_targetlist(), add_with_check_options(), addArc(), AddEventToPendingNotifies(), addFamilyMember(), addFkRecurseReferencing(), addKey(), addKeyToQueue(), addNSItemToQuery(), addRangeTableEntry(), addRangeTableEntryForCTE(), addRangeTableEntryForENR(), addRangeTableEntryForFunction(), addRangeTableEntryForJoin(), addRangeTableEntryForRelation(), addRangeTableEntryForSubquery(), addRangeTableEntryForTableFunc(), addRangeTableEntryForValues(), AddRelationNewConstraints(), addTargetToGroupList(), addTargetToSortList(), AlterPublicationTables(), AlterTableMoveAll(), AlterTSDictionary(), analyzeCTE(), analyzeCTETargetList(), apply_child_basequals(), apply_handle_truncate(), apply_scanjoin_target_to_paths(), applyLockingClause(), ApplyRetrieveRule(), array_subscript_transform(), assign_param_for_placeholdervar(), assign_param_for_var(), ATAddCheckConstraint(), ATExecAddColumn(), ATExecValidateConstraint(), ATGetQueueEntry(), ATParseTransformCmd(), ATPostAlterTypeParse(), ATPrepAlterColumnType(), ATPrepCmd(), btcostestimate(), build_aggregate_finalfn_expr(), build_aggregate_transfn_expr(), build_coercion_expression(), build_index_pathkeys(), build_index_paths(), build_index_tlist(), build_join_rel(), build_joinrel_tlist(), build_partition_pathkeys(), build_path_tlist(), build_physical_tlist(), build_remote_returning(), build_subplan(), BuildEventTriggerCache(), BuildOnConflictExcludedTargetlist(), buildRelationAliases(), cached_scansel(), calc_joinrel_size_estimate(), can_minmax_aggs(), check_index_predicates(), check_selective_binary_conversion(), check_sql_fn_retval(), check_tuple_attribute(), checkInsertTargets(), checkSharedDependencies(), checkWellFormedRecursionWalker(), choose_bitmap_and(), ChooseIndexColumnNames(), classifyConditions(), clauselist_apply_dependencies(), CloneFkReferenced(), CloneFkReferencing(), CloneRowTriggersToPartition(), coerce_fn_result_column(), coerce_record_to_complex(), compute_common_attribute(), compute_semi_anti_join_factors(), compute_semijoin_info(), ComputeIndexAttrs(), ComputePartitionAttrs(), consider_groupingsets_paths(), consider_new_or_clause(), convert_ANY_sublink_to_join(), convert_EXISTS_to_ANY(), convert_subquery_pathkeys(), CopyMultiInsertInfoFlush(), CopyMultiInsertInfoSetupBuffer(), cost_incremental_sort(), create_append_plan(), create_bitmap_scan_plan(), create_bitmap_subplan(), create_ctas_nodata(), create_customscan_plan(), create_degenerate_grouping_paths(), create_edata_for_relation(), create_groupingsets_plan(), create_hashjoin_plan(), create_index_paths(), create_indexscan_plan(), create_join_clause(), create_merge_append_plan(), create_nestloop_path(), create_partitionwise_grouping_paths(), create_tidrangescan_plan(), create_tidscan_plan(), create_unique_plan(), CreateStatistics(), database_to_xmlschema_internal(), deconstruct_recurse(), DefineRelation(), DefineSequence(), DefineTSDictionary(), DefineView(), DefineVirtualRelation(), deparseParam(), deparseVar(), deserialize_deflist(), determineRecursiveColTypes(), distribute_qual_to_rels(), distribute_restrictinfo_to_rels(), distribute_row_identity_vars(), do_pg_start_backup(), DoCopy(), estimate_multivariate_ndistinct(), estimate_num_groups(), eval_const_expressions_mutator(), EvalPlanQualStart(), EventTriggerAlterTableEnd(), EventTriggerCollectAlterDefPrivs(), EventTriggerCollectAlterOpFam(), EventTriggerCollectAlterTableSubcmd(), EventTriggerCollectAlterTSConfig(), EventTriggerCollectCreateOpClass(), EventTriggerCollectGrant(), EventTriggerCollectSimpleCommand(), Exec_ListenCommit(), ExecAllocTableSlot(), ExecEvalXmlExpr(), ExecGetTriggerResultRel(), ExecInitExprList(), ExecInitExprRec(), ExecInitInsertProjection(), ExecInitLockRows(), ExecInitModifyTable(), ExecInitNode(), ExecInitPartitionInfo(), ExecInitResultRelation(), ExecInitSubPlan(), ExecPrepareExprList(), ExecSerializePlan(), ExecuteGrantStmt(), ExecuteTruncate(), ExecuteTruncateGuts(), expand_grouping_sets(), expand_groupingset_node(), expand_inherited_rtentry(), expand_insert_targetlist(), expand_single_inheritance_child(), expand_vacuum_rel(), expandNSItemAttrs(), expandNSItemVars(), ExpandRowReference(), expandRTE(), expandTableLikeClause(), expandTupleDesc(), ExplainNode(), ExportSnapshot(), expression_tree_mutator(), extract_actual_clauses(), extract_actual_join_clauses(), extract_jsp_path_expr_nodes(), extract_lateral_references(), extract_nonindex_conditions(), extract_or_clause(), extract_rollup_sets(), extractRemainingColumns(), fetch_statentries_for_relation(), fetch_table_list(), fetch_upper_rel(), FetchTableStates(), file_fdw_validator(), fill_hba_line(), find_duplicate_ors(), find_hash_columns(), find_indexpath_quals(), find_list_position(), find_mergeclauses_for_outer_pathkeys(), find_partition_scheme(), find_placeholder_info(), find_window_functions_walker(), findTargetlistEntrySQL99(), fireRIRrules(), fireRules(), fix_indexorderby_references(), fix_indexqual_references(), flatten_grouping_sets(), flatten_join_alias_vars_mutator(), flatten_simple_union_all(), fmgr_sql_validator(), foreign_grouping_ok(), foreign_join_ok(), format_operator_parts(), format_procedure_parts(), func_get_detail(), gen_partprune_steps_internal(), gen_prune_step_combine(), gen_prune_step_op(), gen_prune_steps_from_opexps(), generate_append_tlist(), generate_base_implied_equalities_const(), generate_bitmap_or_paths(), generate_implied_equalities_for_column(), generate_join_implied_equalities_broken(), generate_join_implied_equalities_normal(), generate_matching_part_pairs(), generate_orderedappend_paths(), generate_partitionwise_join_paths(), generate_setop_tlist(), generate_subquery_params(), generate_subquery_vars(), generate_union_paths(), generateClonedExtStatsStmt(), generateClonedIndexStmt(), generateSerialExtraStmts(), get_actual_clauses(), get_all_vacuum_rels(), get_appendrel_parampathinfo(), get_baserel_parampathinfo(), get_database_list(), get_eclass_for_sort_expr(), get_ext_ver_info(), get_ext_ver_list(), get_file_fdw_attribute_options(), get_foreign_key_join_selectivity(), get_func_expr(), get_index_clause_from_support(), get_index_paths(), get_insert_query_def(), get_join_index_paths(), get_joinrel_parampathinfo(), get_matching_part_pairs(), get_op_btree_interpretation(), get_policies_for_relation(), get_qual_for_hash(), get_qual_for_list(), get_qual_for_range(), get_quals_from_indexclauses(), get_range_nulltest(), get_relation_constraints(), get_relation_foreign_keys(), get_relation_statistics_worker(), get_rels_with_domain(), get_required_extension(), get_sortgrouplist_exprs(), get_steps_using_prefix_recurse(), get_subscription_list(), get_switched_clauses(), get_tables_to_cluster(), get_tlist_exprs(), get_update_query_targetlist_def(), get_useful_ecs_for_relation(), get_useful_pathkeys_for_relation(), get_windowfunc_expr(), GetAfterTriggersTableData(), getObjectIdentityParts(), getState(), GetSubscriptionNotReadyRelations(), GetSubscriptionRelations(), gistFindPath(), gistfixsplit(), gistplacetopage(), grouping_planner(), hash_inner_and_outer(), hashagg_spill_finish(), heap_truncate(), identify_current_nestloop_params(), identify_opfamily_groups(), index_concurrently_create_copy(), infer_arbiter_indexes(), init_execution_state(), init_sql_fcache(), InitPlan(), innerrel_is_unique(), interpret_AS_clause(), interpret_function_parameter_list(), intorel_startup(), is_innerrel_unique_for(), join_is_removable(), jsonb_ops__extract_nodes(), jsonb_path_ops__extract_nodes(), jsonb_subscript_transform(), JsonValueListAppend(), list_append_unique(), list_append_unique_ptr(), list_concat_unique(), list_concat_unique_ptr(), list_difference(), list_difference_ptr(), list_intersection(), list_union(), list_union_ptr(), llvm_compile_module(), load_hba(), load_ident(), LoadPublications(), logicalrep_workers_find(), make_canonical_pathkey(), make_copy_attnamelist(), make_group_input_target(), make_inh_translation_list(), make_inner_pathkeys_for_merge(), make_modifytable(), make_partial_grouping_target(), make_partition_op_expr(), make_partition_pruneinfo(), make_partitionedrel_pruneinfo(), make_path_rowexpr(), make_pathkeys_for_sortclauses(), make_pathtarget_from_tlist(), make_rel_from_joinlist(), make_row_comparison_op(), make_setop_translation_list(), make_sort_input_target(), make_sub_restrictinfos(), make_tlist_from_pathtarget(), make_window_input_target(), makeDependencyGraphWalker(), match_clause_to_index(), match_clause_to_partition_key(), match_foreign_keys_to_quals(), match_join_clauses_to_index(), match_network_subset(), match_pathkeys_to_index(), match_pattern_prefix(), matchLocks(), merge_clump(), merge_list_bounds(), merge_publications(), MergeAttributes(), negate_clause(), next_field_expand(), nodeRead(), ObjectsInPublicationToOids(), OpenRelIdList(), OpenTableList(), order_qual_clauses(), paraminfo_get_equal_hashops(), parse_hba_line(), parseCheckAggregates(), ParseFuncOrColumn(), PartConstraintImpliedByRelConstraint(), perform_base_backup(), pg_get_object_address(), pg_logical_slot_get_changes_guts(), pg_plan_queries(), pg_rewrite_query(), plan_union_children(), populate_typ_list(), postgresGetForeignPaths(), postgresGetForeignPlan(), postgresImportForeignSchema(), prep_domain_constraints(), prepare_sort_from_pathkeys(), preprocess_aggref(), preprocess_groupclause(), preprocess_grouping_sets(), preprocess_rowmarks(), preprocess_targetlist(), process_duplicate_ors(), process_equivalence(), process_pipe_input(), process_sublinks_mutator(), process_subquery_nestloop_params(), ProcessStartupPacket(), pull_ands(), pull_ors(), pull_up_simple_values(), pull_up_sublinks_jointree_recurse(), pull_up_sublinks_qual_recurse(), pull_up_union_leaf_queries(), pull_var_clause_walker(), pull_vars_walker(), query_tree_mutator(), QueryRewrite(), queue_listen(), range_table_mutator(), read_tablespace_map(), rebuild_fdw_scan_tlist(), RebuildConstraintComment(), record_plan_function_dependency(), record_plan_type_dependency(), reduce_outer_joins_pass1(), register_ENR(), register_label_provider(), register_reloptions_validator(), ReindexRelationConcurrently(), relation_excluded_by_constraints(), relation_has_unique_index_for(), RelationCacheInvalidate(), RelationGetDummyIndexExpressions(), RelationGetFKeyList(), remap_to_groupclause_idx(), RememberConstraintForRebuilding(), RememberIndexForRebuilding(), RememberStatisticsForRebuilding(), RememberSyncRequest(), remove_rel_from_joinlist(), remove_useless_groupby_columns(), RemoveInheritance(), reorder_function_arguments(), reparameterize_path(), reparameterize_path_by_child(), reparameterize_pathlist_by_child(), replace_empty_jointree(), replace_nestloop_param_placeholdervar(), replace_nestloop_param_var(), replace_outer_agg(), replace_outer_grouping(), resolve_unique_index_expr(), RewriteQuery(), rewriteSearchAndCycle(), rewriteTargetListIU(), rewriteTargetView(), rewriteValuesRTE(), schema_to_xmlschema_internal(), SearchCatCacheList(), select_active_windows(), select_mergejoin_clauses(), select_outer_pathkeys_for_merge(), sepgsql_set_client_label(), sequence_options(), set_append_rel_pathlist(), set_cheapest(), set_deparse_for_query(), set_dummy_tlist_references(), set_indexonlyscan_references(), set_joinrel_partition_key_exprs(), set_plan_references(), set_plan_refs(), set_rtable_names(), set_simple_column_names(), set_subquery_pathlist(), set_upper_references(), set_using_names(), show_eval_params(), show_grouping_set_keys(), show_incremental_sort_group_info(), show_modifytable_info(), show_plan_tlist(), show_sort_group_keys(), show_tablesample(), simplify_and_arguments(), simplify_or_arguments(), split_pathtarget_at_srfs(), split_pathtarget_walker(), SplitDirectoriesString(), SplitGUCList(), SplitIdentifierString(), SS_make_initplan_from_plan(), SS_process_ctes(), StandbyAcquireAccessExclusiveLock(), statext_is_compatible_clause_internal(), statext_mcv_clauselist_selectivity(), stringToQualifiedNameList(), subquery_planner(), table_slot_create(), textarray_to_stringlist(), textarray_to_strvaluelist(), textToQualifiedNameList(), TidExprListCreate(), TidRangeQualFromRestrictInfoList(), tokenize_file(), tokenize_inc_file(), transformAExprIn(), transformAggregateCall(), transformAlterTableStmt(), transformArrayExpr(), transformAssignmentIndirection(), transformBoolExpr(), transformCallStmt(), transformCaseExpr(), transformCoalesceExpr(), transformColumnDefinition(), transformCreateSchemaStmt(), transformCreateStmt(), transformDistinctClause(), transformDistinctOnClause(), transformExpressionList(), transformFKConstraints(), transformFkeyGetPrimaryKey(), transformFromClause(), transformFromClauseItem(), transformFuncCall(), transformGenericOptions(), transformGroupClause(), transformGroupClauseExpr(), transformGroupingFunc(), transformGroupingSet(), transformIndexConstraint(), transformIndexConstraints(), transformIndirection(), transformInsertRow(), transformInsertStmt(), transformJoinUsingClause(), transformMinMaxExpr(), transformMultiAssignRef(), transformOfType(), transformPartitionBound(), transformPartitionRangeBounds(), transformPartitionSpec(), transformPLAssignStmt(), transformRangeFunction(), transformRangeTableFunc(), transformRangeTableSample(), transformRowExpr(), transformRuleStmt(), transformSetOperationStmt(), transformSetOperationTree(), transformSubLink(), transformTableConstraint(), transformTableLikeClause(), transformTargetList(), transformValuesClause(), transformWindowDefinitions(), transformWindowFuncCall(), transformWithClause(), transformXmlExpr(), trim_mergeclauses_for_inner_pathkeys(), untransformRelOptions(), UpdateLogicalMappings(), WaitForLockersMultiple(), and xmlelement().

◆ lappend_int()

pg_nodiscard List* lappend_int ( List list,
int  datum 
)

Definition at line 354 of file list.c.

355 {
357 
358  if (list == NIL)
359  list = new_list(T_IntList, 1);
360  else
362 
363  llast_int(list) = datum;
365  return list;
366 }
#define IsIntegerList(l)
Definition: list.c:55
#define llast_int(l)
Definition: pg_list.h:195

References Assert(), check_list_invariants, IsIntegerList, sort-test::list, llast_int, new_list(), new_tail_cell(), NIL, and T_IntList.

Referenced by add_merged_range_bounds(), addRangeTableEntryForCTE(), addRangeTableEntryForENR(), addRangeTableEntryForFunction(), addRangeTableEntryForSubquery(), adjust_inherited_attnums(), adjust_partition_colnos(), analyzeCTETargetList(), ATRewriteTable(), build_merged_partition_bounds(), build_subplan(), check_ungrouped_columns_walker(), checkInsertTargets(), convert_EXISTS_to_ANY(), CopyGetAttnums(), deparseAnalyzeSql(), deparseExplicitTargetList(), deparseTargetList(), ExecBuildAggTrans(), ExecBuildGroupingEqual(), ExecBuildParamSetEqual(), ExecInitExprRec(), ExecInitQual(), ExecInitSubscriptingRef(), expand_indexqual_rowcompare(), extract_update_targetlist_colnos(), extractRemainingColumns(), fetch_statentries_for_relation(), finalize_grouping_exprs_walker(), find_all_inheritors(), find_compatible_agg(), fix_expr_common(), gen_partprune_steps_internal(), generate_subquery_params(), grouping_planner(), list_append_unique_int(), list_concat_unique_int(), list_difference_int(), list_intersection_int(), list_union_int(), match_pathkeys_to_index(), merge_list_bounds(), nodeRead(), postgresBeginForeignInsert(), postgresPlanForeignModify(), rel_is_distinct_for(), remap_to_groupclause_idx(), reorder_grouping_sets(), rewriteSearchAndCycle(), set_plan_refs(), set_schema_sent_in_streamed_txn(), split_pathtarget_at_srfs(), SS_process_ctes(), TerminateOtherDBBackends(), transformDistinctOnClause(), transformFromClauseItem(), transformGroupClauseList(), transformRangeTableFunc(), transformSetOperationTree(), transformValuesClause(), and translate_sub_tlist().

◆ lappend_oid()

pg_nodiscard List* lappend_oid ( List list,
Oid  datum 
)

Definition at line 372 of file list.c.

373 {
375 
376  if (list == NIL)
377  list = new_list(T_OidList, 1);
378  else
380 
381  llast_oid(list) = datum;
383  return list;
384 }
#define IsOidList(l)
Definition: list.c:56
#define llast_oid(l)
Definition: pg_list.h:196

References Assert(), check_list_invariants, IsOidList, sort-test::list, llast_oid, new_list(), new_tail_cell(), NIL, and T_OidList.

Referenced by add_rte_to_flat_rtable(), addRangeTableEntryForCTE(), addRangeTableEntryForENR(), addRangeTableEntryForFunction(), addRangeTableEntryForSubquery(), AfterTriggerSetState(), AlterTableMoveAll(), analyzeCTETargetList(), apply_handle_truncate(), ApplyExtensionUpdates(), assign_collations_walker(), assign_param_for_placeholdervar(), assign_param_for_var(), assign_special_exec_param(), binary_upgrade_create_empty_extension(), check_functional_grouping(), CheckAttributeType(), CloneFkReferenced(), CloneFkReferencing(), compute_semijoin_info(), convert_EXISTS_to_ANY(), create_hashjoin_plan(), create_indexscan_plan(), CreateExtensionInternal(), CreateFunction(), CreateTriggerFiringOn(), DefineRelation(), do_autovacuum(), EventTriggerCommonSetup(), ExecAlterDefaultPrivilegesStmt(), ExecInitPartitionInfo(), ExecInsertIndexTuples(), ExecuteGrantStmt(), ExecuteTruncate(), ExecuteTruncateGuts(), expand_indexqual_rowcompare(), extract_query_dependencies_walker(), ExtractExtensionList(), filter_partitions(), find_all_inheritors(), find_inheritance_children_extended(), find_typed_table_dependencies(), fireRIRrules(), fix_expr_common(), generate_new_exec_param(), get_index_ref_constraints(), get_mergejoin_opfamilies(), get_partition_ancestors_worker(), get_steps_using_prefix_recurse(), GetAllTablesPublicationRelations(), GetAllTablesPublications(), getAutoExtensionsOfObject(), getOwnedSequences_internal(), GetParentedForeignKeyRefs(), GetPublicationSchemas(), GetPubPartitionOptionRelations(), GetRelationPublications(), getRelationsInNamespace(), GetSchemaPublicationRelations(), GetSchemaPublications(), heap_truncate_check_FKs(), heap_truncate_find_FKs(), index_concurrently_swap(), infer_arbiter_indexes(), inline_function(), interpret_function_parameter_list(), list_append_unique_oid(), list_concat_unique_oid(), list_difference_oid(), list_union_oid(), LockViewRecurse(), logicalrep_read_truncate(), make_row_comparison_op(), nodeRead(), objectNamesToOids(), objectsInSchemaToOids(), oid_array_to_list(), OpenTableList(), paraminfo_get_equal_hashops(), pgstat_recv_inquiry(), PreCommit_on_commit_actions(), query_to_oid_list(), recomputeNamespacePath(), ReindexMultipleTables(), ReindexPartitions(), ReindexRelationConcurrently(), rel_is_distinct_for(), relation_is_updatable(), RelationGetIndexList(), RelationGetStatExtList(), RememberConstraintForRebuilding(), RememberIndexForRebuilding(), RememberStatisticsForRebuilding(), remove_dbtablespaces(), replace_outer_agg(), replace_outer_grouping(), RestoreReindexState(), rewriteSearchAndCycle(), roleSpecsToIds(), transformAggregateCall(), transformRangeTableFunc(), transformSetOperationTree(), transformValuesClause(), TryReuseForeignKey(), and typeInheritsFrom().

◆ lcons()

pg_nodiscard List* lcons ( void *  datum,
List list 
)

Definition at line 474 of file list.c.

475 {
477 
478  if (list == NIL)
479  list = new_list(T_List, 1);
480  else
482 
483  linitial(list) = datum;
485  return list;
486 }
static void new_head_cell(List *list)
Definition: list.c:302
#define linitial(l)
Definition: pg_list.h:174

References Assert(), check_list_invariants, IsPointerList, linitial, sort-test::list, new_head_cell(), new_list(), NIL, and T_List.

Referenced by build_minmax_path(), checkWellFormedRecursionWalker(), consider_groupingsets_paths(), CreateExprContextInternal(), CreateLockFile(), ExecInitModifyTable(), expandTableLikeClause(), ExplainNode(), ExplainSubPlans(), extract_rollup_sets(), find_expr_references_walker(), find_update_path(), generate_orderedappend_paths(), generateSerialExtraStmts(), get_name_for_var_field(), get_object_address_rv(), get_query_def(), get_relation_info(), gistEmptyAllBuffers(), gistFindPath(), gistGetNodeBuffer(), gistPushItupToNodeBuffer(), load_domaintype_info(), makeDependencyGraphWalker(), pg_get_object_address(), plan_union_children(), PLy_subtransaction_enter(), PrepareClientEncoding(), push_child_plan(), pushOperator(), PushOverrideSearchPath(), pushStop(), pushValue_internal(), readTimeLineHistory(), register_on_commit_action(), RelationBuildRowSecurity(), RelationCacheInvalidate(), reorder_grouping_sets(), RewriteQuery(), rewriteSearchAndCycle(), rewriteTargetView(), sepgsql_avc_compute(), set_cheapest(), show_agg_keys(), show_group_keys(), sort_inner_and_outer(), transformCaseExpr(), and UpdateRangeTableOfViewParse().

◆ lcons_int()

pg_nodiscard List* lcons_int ( int  datum,
List list 
)

Definition at line 492 of file list.c.

493 {
495 
496  if (list == NIL)
497  list = new_list(T_IntList, 1);
498  else
500 
501  linitial_int(list) = datum;
503  return list;
504 }
#define linitial_int(l)
Definition: pg_list.h:175

References Assert(), check_list_invariants, IsIntegerList, linitial_int, sort-test::list, new_head_cell(), new_list(), NIL, and T_IntList.

Referenced by ExecInitAgg(), ExplainBeginOutput(), ExplainOpenGroup(), ExplainOpenSetAsideGroup(), and ExplainRestoreGroup().

◆ lcons_oid()

pg_nodiscard List* lcons_oid ( Oid  datum,
List list 
)

Definition at line 510 of file list.c.

511 {
513 
514  if (list == NIL)
515  list = new_list(T_OidList, 1);
516  else
518 
519  linitial_oid(list) = datum;
521  return list;
522 }
#define linitial_oid(l)
Definition: pg_list.h:176

References Assert(), check_list_invariants, IsOidList, linitial_oid, sort-test::list, new_head_cell(), new_list(), NIL, and T_OidList.

Referenced by CreateSchemaCommand(), pg_partition_ancestors(), PushOverrideSearchPath(), recomputeNamespacePath(), and ReindexMultipleTables().

◆ list_append_unique()

pg_nodiscard List* list_append_unique ( List list,
void *  datum 
)

Definition at line 1302 of file list.c.

1303 {
1304  if (list_member(list, datum))
1305  return list;
1306  else
1307  return lappend(list, datum);
1308 }
List * lappend(List *list, void *datum)
Definition: list.c:336
bool list_member(const List *list, const void *datum)
Definition: list.c:640

References lappend(), sort-test::list, and list_member().

Referenced by add_security_quals(), and add_with_check_options().

◆ list_append_unique_int()

pg_nodiscard List* list_append_unique_int ( List list,
int  datum 
)

Definition at line 1327 of file list.c.

1328 {
1329  if (list_member_int(list, datum))
1330  return list;
1331  else
1332  return lappend_int(list, datum);
1333 }
List * lappend_int(List *list, int datum)
Definition: list.c:354
bool list_member_int(const List *list, int datum)
Definition: list.c:681

References lappend_int(), sort-test::list, and list_member_int().

◆ list_append_unique_oid()

pg_nodiscard List* list_append_unique_oid ( List list,
Oid  datum 
)

Definition at line 1339 of file list.c.

1340 {
1341  if (list_member_oid(list, datum))
1342  return list;
1343  else
1344  return lappend_oid(list, datum);
1345 }
List * lappend_oid(List *list, Oid datum)
Definition: list.c:372
bool list_member_oid(const List *list, Oid datum)
Definition: list.c:701

References lappend_oid(), sort-test::list, and list_member_oid().

Referenced by ATExecAlterConstrRecurse(), btvalidate(), hashvalidate(), heap_truncate_find_FKs(), map_sql_typecoll_to_xmlschema_types(), ObjectsInPublicationToOids(), and roles_is_member_of().

◆ list_append_unique_ptr()

pg_nodiscard List* list_append_unique_ptr ( List list,
void *  datum 
)

Definition at line 1315 of file list.c.

1316 {
1317  if (list_member_ptr(list, datum))
1318  return list;
1319  else
1320  return lappend(list, datum);
1321 }
bool list_member_ptr(const List *list, const void *datum)
Definition: list.c:661

References lappend(), sort-test::list, and list_member_ptr().

Referenced by get_useful_ecs_for_relation(), postgresGetForeignPaths(), subbuild_joinrel_joinlist(), and subbuild_joinrel_restrictlist().

◆ list_cell_number()

static int list_cell_number ( const List l,
const ListCell c 
)
inlinestatic

Definition at line 312 of file pg_list.h.

313 {
314  Assert(c >= &l->elements[0] && c < &l->elements[l->length]);
315  return c - l->elements;
316 }
char * c
int length
Definition: pg_list.h:53
ListCell * elements
Definition: pg_list.h:55

References Assert(), List::elements, and List::length.

Referenced by for_both_cell_setup(), for_each_cell_setup(), push_ancestor_plan(), and SyncPostCheckpoint().

◆ list_concat()

pg_nodiscard List* list_concat ( List list1,
const List list2 
)

Definition at line 540 of file list.c.

541 {
542  int new_len;
543 
544  if (list1 == NIL)
545  return list_copy(list2);
546  if (list2 == NIL)
547  return list1;
548 
549  Assert(list1->type == list2->type);
550 
551  new_len = list1->length + list2->length;
552  /* Enlarge array if necessary */
553  if (new_len > list1->max_length)
554  enlarge_list(list1, new_len);
555 
556  /* Even if list1 == list2, using memcpy should be safe here */
557  memcpy(&list1->elements[list1->length], &list2->elements[0],
558  list2->length * sizeof(ListCell));
559  list1->length = new_len;
560 
561  check_list_invariants(list1);
562  return list1;
563 }
static void enlarge_list(List *list, int min_size)
Definition: list.c:152
List * list_copy(const List *oldlist)
Definition: list.c:1532
int max_length
Definition: pg_list.h:54
NodeTag type
Definition: pg_list.h:52

References Assert(), check_list_invariants, List::elements, enlarge_list(), List::length, list_copy(), List::max_length, NIL, and List::type.

Referenced by accumulate_append_subpath(), add_predicate_to_index_quals(), addRangeTableEntryForJoin(), addRangeTableEntryForTableFunc(), ATExecAttachPartition(), ATParseTransformCmd(), ATPostAlterTypeParse(), AtSubCommit_Notify(), build_joinrel_restrictlist(), build_paths_for_OR(), check_index_predicates(), choose_bitmap_and(), clean_up_removed_plan_level(), consider_groupingsets_paths(), ConstraintImpliedByRelConstraint(), convert_EXISTS_sublink_to_join(), cost_index(), create_append_path(), create_append_plan(), create_bitmap_subplan(), create_index_paths(), create_join_plan(), create_merge_append_plan(), deconstruct_recurse(), DefineRelation(), deparseDirectDeleteSql(), deparseDirectUpdateSql(), deparseFromExprForRel(), estimate_path_cost_size(), expand_groupingset_node(), ExpandAllTables(), expandRTE(), extract_or_clause(), extract_rollup_sets(), fileBeginForeignScan(), fileGetOptions(), find_forced_null_vars(), find_indexpath_quals(), find_mergeclauses_for_outer_pathkeys(), find_nonnullable_vars_walker(), fireRIRrules(), flatten_grouping_sets(), foreign_grouping_ok(), foreign_join_ok(), gen_partprune_steps_internal(), gen_prune_steps_from_opexps(), generate_bitmap_or_paths(), generate_join_implied_equalities(), generate_join_implied_equalities_for_ecs(), generate_join_implied_equalities_normal(), generate_partition_qual(), get_baserel_parampathinfo(), get_batch_size_option(), get_foreign_key_join_selectivity(), get_from_clause_item(), get_index_paths(), get_join_index_paths(), get_joinrel_parampathinfo(), get_relation_constraints(), get_rels_with_domain(), get_steps_using_prefix_recurse(), GetAllSchemaPublicationRelations(), GetPubPartitionOptionRelations(), is_parallel_safe(), objectsInSchemaToOids(), process_equivalence(), process_sublinks_mutator(), ProcessUtilitySlow(), pull_ands(), pull_ors(), pull_up_simple_subquery(), pull_up_simple_union_all(), reduce_outer_joins_pass2(), reduce_unique_semijoins(), reorder_grouping_sets(), RewriteQuery(), rewriteRuleAction(), rewriteTargetListIU(), selectColorTrigrams(), set_joinrel_partition_key_exprs(), set_plan_refs(), split_pathtarget_at_srfs(), split_pathtarget_walker(), TidQualFromRestrictInfoList(), transformAExprIn(), transformAlterTableStmt(), transformCreateSchemaStmt(), transformCreateStmt(), transformExpressionList(), transformExtendedStatistics(), transformFromClause(), transformFromClauseItem(), transformIndexConstraints(), transformTargetList(), and vacuum().

◆ list_concat_copy()

pg_nodiscard List* list_concat_copy ( const List list1,
const List list2 
)

Definition at line 577 of file list.c.

578 {
579  List *result;
580  int new_len;
581 
582  if (list1 == NIL)
583  return list_copy(list2);
584  if (list2 == NIL)
585  return list_copy(list1);
586 
587  Assert(list1->type == list2->type);
588 
589  new_len = list1->length + list2->length;
590  result = new_list(list1->type, new_len);
591  memcpy(result->elements, list1->elements,
592  list1->length * sizeof(ListCell));
593  memcpy(result->elements + list1->length, list2->elements,
594  list2->length * sizeof(ListCell));
595 
596  check_list_invariants(result);
597  return result;
598 }

References Assert(), check_list_invariants, List::elements, List::length, list_copy(), new_list(), NIL, and List::type.

Referenced by add_function_defaults(), AlterPublicationTables(), btadjustmembers(), build_paths_for_OR(), choose_bitmap_and(), create_scan_plan(), DefineIndex(), gen_partprune_steps(), generate_bitmap_or_paths(), get_parameterized_baserel_size(), hashadjustmembers(), make_pathkeys_for_window(), max_parallel_hazard_walker(), process_matched_tle(), set_joinrel_partition_key_exprs(), simplify_and_arguments(), and simplify_or_arguments().

◆ list_concat_unique()

pg_nodiscard List* list_concat_unique ( List list1,
const List list2 
)

Definition at line 1364 of file list.c.

1365 {
1366  ListCell *cell;
1367 
1368  Assert(IsPointerList(list1));
1369  Assert(IsPointerList(list2));
1370 
1371  foreach(cell, list2)
1372  {
1373  if (!list_member(list1, lfirst(cell)))
1374  list1 = lappend(list1, lfirst(cell));
1375  }
1376 
1377  check_list_invariants(list1);
1378  return list1;
1379 }
#define lfirst(lc)
Definition: pg_list.h:169

References Assert(), check_list_invariants, IsPointerList, lappend(), lfirst, and list_member().

Referenced by create_bitmap_subplan(), and select_active_windows().

◆ list_concat_unique_int()

pg_nodiscard List* list_concat_unique_int ( List list1,
const List list2 
)

Definition at line 1407 of file list.c.

1408 {
1409  ListCell *cell;
1410 
1411  Assert(IsIntegerList(list1));
1412  Assert(IsIntegerList(list2));
1413 
1414  foreach(cell, list2)
1415  {
1416  if (!list_member_int(list1, lfirst_int(cell)))
1417  list1 = lappend_int(list1, lfirst_int(cell));
1418  }
1419 
1420  check_list_invariants(list1);
1421  return list1;
1422 }
#define lfirst_int(lc)
Definition: pg_list.h:170

References Assert(), check_list_invariants, IsIntegerList, lappend_int(), lfirst_int, and list_member_int().

◆ list_concat_unique_oid()

pg_nodiscard List* list_concat_unique_oid ( List list1,
const List list2 
)

Definition at line 1428 of file list.c.

1429 {
1430  ListCell *cell;
1431 
1432  Assert(IsOidList(list1));
1433  Assert(IsOidList(list2));
1434 
1435  foreach(cell, list2)
1436  {
1437  if (!list_member_oid(list1, lfirst_oid(cell)))
1438  list1 = lappend_oid(list1, lfirst_oid(cell));
1439  }
1440 
1441  check_list_invariants(list1);
1442  return list1;
1443 }
#define lfirst_oid(lc)
Definition: pg_list.h:171

References Assert(), check_list_invariants, IsOidList, lappend_oid(), lfirst_oid, and list_member_oid().

Referenced by AlterPublicationOptions(), GetRelationPublicationActions(), GetSchemaPublicationRelations(), and pg_get_publication_tables().

◆ list_concat_unique_ptr()

pg_nodiscard List* list_concat_unique_ptr ( List list1,
const List list2 
)

Definition at line 1386 of file list.c.

1387 {
1388  ListCell *cell;
1389 
1390  Assert(IsPointerList(list1));
1391  Assert(IsPointerList(list2));
1392 
1393  foreach(cell, list2)
1394  {
1395  if (!list_member_ptr(list1, lfirst(cell)))
1396  list1 = lappend(list1, lfirst(cell));
1397  }
1398 
1399  check_list_invariants(list1);
1400  return list1;
1401 }

References Assert(), check_list_invariants, IsPointerList, lappend(), lfirst, and list_member_ptr().

◆ list_copy()

pg_nodiscard List* list_copy ( const List list)

Definition at line 1532 of file list.c.

1533 {
1534  List *newlist;
1535 
1536  if (oldlist == NIL)
1537  return NIL;
1538 
1539  newlist = new_list(oldlist->type, oldlist->length);
1540  memcpy(newlist->elements, oldlist->elements,
1541  newlist->length * sizeof(ListCell));
1542 
1543  check_list_invariants(newlist);
1544  return newlist;
1545 }

References check_list_invariants, List::elements, List::length, new_list(), NIL, and List::type.

Referenced by accumulate_append_subpath(), addRangeTableEntryForCTE(), arrayconst_startup_fn(), arrayexpr_startup_fn(), build_subplan(), check_index_predicates(), consider_groupingsets_paths(), ConstraintImpliedByRelConstraint(), copy_pathtarget(), copyObjectImpl(), CopyOverrideSearchPath(), create_append_plan(), create_merge_append_plan(), does_not_exist_skipping(), EventTriggerCollectGrant(), ExecuteTruncateGuts(), expand_indexqual_rowcompare(), expression_tree_mutator(), fetch_search_path(), generate_mergejoin_paths(), get_eclass_for_sort_expr(), get_foreign_key_join_selectivity(), get_object_address_attrdef(), get_object_address_attribute(), get_object_address_opf_member(), get_object_address_relobject(), get_query_def(), get_required_extension(), get_steps_using_prefix_recurse(), get_switched_clauses(), get_useful_pathkeys_for_relation(), GetOverrideSearchPath(), heap_truncate_find_FKs(), list_concat(), list_concat_copy(), list_difference(), list_difference_int(), list_difference_oid(), list_difference_ptr(), list_union(), list_union_int(), list_union_oid(), list_union_ptr(), merge_publications(), owningrel_does_not_exist_skipping(), process_owned_by(), PushOverrideSearchPath(), recomputeNamespacePath(), RelationGetIndexList(), RelationGetStatExtList(), remove_rel_from_query(), reorder_grouping_sets(), roles_is_member_of(), select_active_windows(), select_outer_pathkeys_for_merge(), set_joinrel_partition_key_exprs(), set_using_names(), SetReindexPending(), simplify_and_arguments(), simplify_or_arguments(), sort_inner_and_outer(), transformPLAssignStmt(), transformWithClause(), and truncate_useless_pathkeys().

◆ list_copy_deep()

pg_nodiscard List* list_copy_deep ( const List oldlist)

Definition at line 1577 of file list.c.

1578 {
1579  List *newlist;
1580 
1581  if (oldlist == NIL)
1582  return NIL;
1583 
1584  /* This is only sensible for pointer Lists */
1585  Assert(IsA(oldlist, List));
1586 
1587  newlist = new_list(oldlist->type, oldlist->length);
1588  for (int i = 0; i < newlist->length; i++)
1589  lfirst(&newlist->elements[i]) =
1590  copyObjectImpl(lfirst(&oldlist->elements[i]));
1591 
1592  check_list_invariants(newlist);
1593  return newlist;
1594 }
void * copyObjectImpl(const void *from)
Definition: copyfuncs.c:5009
#define IsA(nodeptr, _type_)
Definition: nodes.h:590

References Assert(), check_list_invariants, copyObjectImpl(), List::elements, i, IsA, List::length, lfirst, new_list(), NIL, and List::type.

Referenced by copyObjectImpl().

◆ list_copy_tail()

pg_nodiscard List* list_copy_tail ( const List list,
int  nskip 
)

Definition at line 1551 of file list.c.

1552 {
1553  List *newlist;
1554 
1555  if (nskip < 0)
1556  nskip = 0; /* would it be better to elog? */
1557 
1558  if (oldlist == NIL || nskip >= oldlist->length)
1559  return NIL;
1560 
1561  newlist = new_list(oldlist->type, oldlist->length - nskip);
1562  memcpy(newlist->elements, &oldlist->elements[nskip],
1563  newlist->length * sizeof(ListCell));
1564 
1565  check_list_invariants(newlist);
1566  return newlist;
1567 }

References check_list_invariants, List::elements, List::length, new_list(), NIL, and List::type.

Referenced by accumulate_append_subpath(), addRangeTableEntryForJoin(), addRangeTableEntryForTableFunc(), does_not_exist_skipping(), expandRTE(), get_name_for_var_field(), get_object_address_opcf(), ParseFuncOrColumn(), push_ancestor_plan(), and transformAggregateCall().

◆ list_deduplicate_oid()

void list_deduplicate_oid ( List list)

Definition at line 1454 of file list.c.

1455 {
1456  int len;
1457 
1458  Assert(IsOidList(list));
1459  len = list_length(list);
1460  if (len > 1)
1461  {
1462  ListCell *elements = list->elements;
1463  int i = 0;
1464 
1465  for (int j = 1; j < len; j++)
1466  {
1467  if (elements[i].oid_value != elements[j].oid_value)
1468  elements[++i].oid_value = elements[j].oid_value;
1469  }
1470  list->length = i + 1;
1471  }
1473 }
int j
Definition: isn.c:74
const void size_t len
Oid oid_value
Definition: pg_list.h:47

References Assert(), check_list_invariants, i, IsOidList, j, len, sort-test::list, list_length(), and ListCell::oid_value.

Referenced by GetPublicationRelations(), and heap_truncate_find_FKs().

◆ list_delete()

pg_nodiscard List* list_delete ( List list,
void *  datum 
)

Definition at line 812 of file list.c.

813 {
814  ListCell *cell;
815 
818 
819  foreach(cell, list)
820  {
821  if (equal(lfirst(cell), datum))
822  return list_delete_cell(list, cell);
823  }
824 
825  /* Didn't find a match: return the list unmodified */
826  return list;
827 }
bool equal(const void *a, const void *b)
Definition: equalfuncs.c:3170
List * list_delete_cell(List *list, ListCell *cell)
Definition: list.c:800

References Assert(), check_list_invariants, equal(), IsPointerList, lfirst, sort-test::list, and list_delete_cell().

Referenced by postgresGetForeignPlan(), and unregister_ENR().

◆ list_delete_cell()

pg_nodiscard List* list_delete_cell ( List list,
ListCell cell 
)

Definition at line 800 of file list.c.

801 {
802  return list_delete_nth_cell(list, cell - list->elements);
803 }
List * list_delete_nth_cell(List *list, int n)
Definition: list.c:726

References sort-test::list, and list_delete_nth_cell().

Referenced by list_delete(), list_delete_int(), list_delete_oid(), list_delete_ptr(), remove_useless_joins(), and transformGenericOptions().

◆ list_delete_first()

◆ list_delete_first_n()

pg_nodiscard List* list_delete_first_n ( List list,
int  n 
)

Definition at line 942 of file list.c.

943 {
945 
946  /* No-op request? */
947  if (n <= 0)
948  return list;
949 
950  /* Delete whole list? */
951  if (n >= list_length(list))
952  {
953  list_free(list);
954  return NIL;
955  }
956 
957  /*
958  * Otherwise, we normally just collapse out the removed elements. But for
959  * debugging purposes, move the whole list contents someplace else.
960  *
961  * (Note that we *must* keep the contents in the same memory context.)
962  */
963 #ifndef DEBUG_LIST_MEMORY_USAGE
964  memmove(&list->elements[0], &list->elements[n],
965  (list->length - n) * sizeof(ListCell));
966  list->length -= n;
967 #else
968  {
969  ListCell *newelems;
970  int newmaxlen = list->length - n;
971 
972  newelems = (ListCell *)
974  newmaxlen * sizeof(ListCell));
975  memcpy(newelems, &list->elements[n], newmaxlen * sizeof(ListCell));
976  if (list->elements != list->initial_elements)
977  pfree(list->elements);
978  else
979  {
980  /*
981  * As in enlarge_list(), clear the initial_elements[] space and/or
982  * mark it inaccessible.
983  */
984 #ifdef CLOBBER_FREED_MEMORY
985  wipe_mem(list->initial_elements,
986  list->max_length * sizeof(ListCell));
987 #else
988  VALGRIND_MAKE_MEM_NOACCESS(list->initial_elements,
989  list->max_length * sizeof(ListCell));
990 #endif
991  }
992  list->elements = newelems;
993  list->max_length = newmaxlen;
994  list->length = newmaxlen;
996  }
997 #endif
998 
999  return list;
1000 }
void list_free(List *list)
Definition: list.c:1505
void pfree(void *pointer)
Definition: mcxt.c:1169
void * MemoryContextAlloc(MemoryContext context, Size size)
Definition: mcxt.c:863
#define VALGRIND_MAKE_MEM_NOACCESS(addr, size)
Definition: memdebug.h:27
static MemoryContext GetMemoryChunkContext(void *pointer)
Definition: memutils.h:114
union ListCell ListCell

References check_list_invariants, GetMemoryChunkContext(), sort-test::list, list_free(), list_length(), MemoryContextAlloc(), NIL, pfree(), and VALGRIND_MAKE_MEM_NOACCESS.

Referenced by add_function_defaults(), func_get_detail(), and SyncPostCheckpoint().

◆ list_delete_int()

pg_nodiscard List* list_delete_int ( List list,
int  datum 
)

Definition at line 850 of file list.c.

851 {
852  ListCell *cell;
853 
856 
857  foreach(cell, list)
858  {
859  if (lfirst_int(cell) == datum)
860  return list_delete_cell(list, cell);
861  }
862 
863  /* Didn't find a match: return the list unmodified */
864  return list;
865 }

References Assert(), check_list_invariants, IsIntegerList, lfirst_int, sort-test::list, and list_delete_cell().

Referenced by reorder_grouping_sets().

◆ list_delete_last()

pg_nodiscard List* list_delete_last ( List list)

Definition at line 916 of file list.c.

917 {
919 
920  if (list == NIL)
921  return NIL; /* would an error be better? */
922 
923  /* list_truncate won't free list if it goes to empty, but this should */
924  if (list_length(list) <= 1)
925  {
926  list_free(list);
927  return NIL;
928  }
929 
930  return list_truncate(list, list_length(list) - 1);
931 }
List * list_truncate(List *list, int new_size)
Definition: list.c:610

References check_list_invariants, sort-test::list, list_free(), list_length(), list_truncate(), and NIL.

Referenced by agg_refill_hash_table(), CheckAttributeType(), fireRIRrules(), inline_function(), LockViewRecurse(), relation_is_updatable(), RewriteQuery(), transformMultiAssignRef(), and transformOnConflictClause().

◆ list_delete_nth_cell()

pg_nodiscard List* list_delete_nth_cell ( List list,
int  n 
)

Definition at line 726 of file list.c.

727 {
729 
730  Assert(n >= 0 && n < list->length);
731 
732  /*
733  * If we're about to delete the last node from the list, free the whole
734  * list instead and return NIL, which is the only valid representation of
735  * a zero-length list.
736  */
737  if (list->length == 1)
738  {
739  list_free(list);
740  return NIL;
741  }
742 
743  /*
744  * Otherwise, we normally just collapse out the removed element. But for
745  * debugging purposes, move the whole list contents someplace else.
746  *
747  * (Note that we *must* keep the contents in the same memory context.)
748  */
749 #ifndef DEBUG_LIST_MEMORY_USAGE
750  memmove(&list->elements[n], &list->elements[n + 1],
751  (list->length - 1 - n) * sizeof(ListCell));
752  list->length--;
753 #else
754  {
755  ListCell *newelems;
756  int newmaxlen = list->length - 1;
757 
758  newelems = (ListCell *)
760  newmaxlen * sizeof(ListCell));
761  memcpy(newelems, list->elements, n * sizeof(ListCell));
762  memcpy(&newelems[n], &list->elements[n + 1],
763  (list->length - 1 - n) * sizeof(ListCell));
764  if (list->elements != list->initial_elements)
765  pfree(list->elements);
766  else
767  {
768  /*
769  * As in enlarge_list(), clear the initial_elements[] space and/or
770  * mark it inaccessible.
771  */
772 #ifdef CLOBBER_FREED_MEMORY
773  wipe_mem(list->initial_elements,
774  list->max_length * sizeof(ListCell));
775 #else
776  VALGRIND_MAKE_MEM_NOACCESS(list->initial_elements,
777  list->max_length * sizeof(ListCell));
778 #endif
779  }
780  list->elements = newelems;
781  list->max_length = newmaxlen;
782  list->length--;
784  }
785 #endif
786 
787  return list;
788 }

References Assert(), check_list_invariants, GetMemoryChunkContext(), sort-test::list, list_free(), MemoryContextAlloc(), NIL, pfree(), and VALGRIND_MAKE_MEM_NOACCESS.

Referenced by generateSerialExtraStmts(), list_delete_cell(), list_delete_first(), MergeAttributes(), process_equivalence(), reconsider_full_join_clause(), and sort_inner_and_outer().

◆ list_delete_oid()

pg_nodiscard List* list_delete_oid ( List list,
Oid  datum 
)

Definition at line 869 of file list.c.

870 {
871  ListCell *cell;
872 
875 
876  foreach(cell, list)
877  {
878  if (lfirst_oid(cell) == datum)
879  return list_delete_cell(list, cell);
880  }
881 
882  /* Didn't find a match: return the list unmodified */
883  return list;
884 }

References Assert(), check_list_invariants, IsOidList, lfirst_oid, sort-test::list, and list_delete_cell().

Referenced by RemoveReindexPending().

◆ list_delete_ptr()

pg_nodiscard List* list_delete_ptr ( List list,
void *  datum 
)

Definition at line 831 of file list.c.

832 {
833  ListCell *cell;
834 
837 
838  foreach(cell, list)
839  {
840  if (lfirst(cell) == datum)
841  return list_delete_cell(list, cell);
842  }
843 
844  /* Didn't find a match: return the list unmodified */
845  return list;
846 }

References Assert(), check_list_invariants, IsPointerList, lfirst, sort-test::list, and list_delete_cell().

Referenced by FreeExprContext(), and remove_join_clause_from_rels().

◆ list_difference()

List* list_difference ( const List list1,
const List list2 
)

Definition at line 1196 of file list.c.

1197 {
1198  const ListCell *cell;
1199  List *result = NIL;
1200 
1201  Assert(IsPointerList(list1));
1202  Assert(IsPointerList(list2));
1203 
1204  if (list2 == NIL)
1205  return list_copy(list1);
1206 
1207  foreach(cell, list1)
1208  {
1209  if (!list_member(list2, lfirst(cell)))
1210  result = lappend(result, lfirst(cell));
1211  }
1212 
1213  check_list_invariants(result);
1214  return result;
1215 }

References Assert(), check_list_invariants, IsPointerList, lappend(), lfirst, list_copy(), list_member(), and NIL.

Referenced by create_hashjoin_plan(), create_mergejoin_plan(), create_tidscan_plan(), infer_arbiter_indexes(), and process_duplicate_ors().

◆ list_difference_int()

List* list_difference_int ( const List list1,
const List list2 
)

Definition at line 1247 of file list.c.

1248 {
1249  const ListCell *cell;
1250  List *result = NIL;
1251 
1252  Assert(IsIntegerList(list1));
1253  Assert(IsIntegerList(list2));
1254 
1255  if (list2 == NIL)
1256  return list_copy(list1);
1257 
1258  foreach(cell, list1)
1259  {
1260  if (!list_member_int(list2, lfirst_int(cell)))
1261  result = lappend_int(result, lfirst_int(cell));
1262  }
1263 
1264  check_list_invariants(result);
1265  return result;
1266 }

References Assert(), check_list_invariants, IsIntegerList, lappend_int(), lfirst_int, list_copy(), list_member_int(), and NIL.

Referenced by reorder_grouping_sets().

◆ list_difference_oid()

List* list_difference_oid ( const List list1,
const List list2 
)

Definition at line 1272 of file list.c.

1273 {
1274  const ListCell *cell;
1275  List *result = NIL;
1276 
1277  Assert(IsOidList(list1));
1278  Assert(IsOidList(list2));
1279 
1280  if (list2 == NIL)
1281  return list_copy(list1);
1282 
1283  foreach(cell, list1)
1284  {
1285  if (!list_member_oid(list2, lfirst_oid(cell)))
1286  result = lappend_oid(result, lfirst_oid(cell));
1287  }
1288 
1289  check_list_invariants(result);
1290  return result;
1291 }

References Assert(), check_list_invariants, IsOidList, lappend_oid(), lfirst_oid, list_copy(), list_member_oid(), and NIL.

Referenced by AlterPublicationSchemas().

◆ list_difference_ptr()

List* list_difference_ptr ( const List list1,
const List list2 
)

Definition at line 1222 of file list.c.

1223 {
1224  const ListCell *cell;
1225  List *result = NIL;
1226 
1227  Assert(IsPointerList(list1));
1228  Assert(IsPointerList(list2));
1229 
1230  if (list2 == NIL)
1231  return list_copy(list1);
1232 
1233  foreach(cell, list1)
1234  {
1235  if (!list_member_ptr(list2, lfirst(cell)))
1236  result = lappend(result, lfirst(cell));
1237  }
1238 
1239  check_list_invariants(result);
1240  return result;
1241 }

References Assert(), check_list_invariants, IsPointerList, lappend(), lfirst, list_copy(), list_member_ptr(), and NIL.

Referenced by create_bitmap_scan_plan(), and ExecuteTruncateGuts().

◆ list_free()

void list_free ( List list)

Definition at line 1505 of file list.c.

1506 {
1507  list_free_private(list, false);
1508 }
static void list_free_private(List *list, bool deep)
Definition: list.c:1479

References sort-test::list, and list_free_private().

Referenced by AfterTriggerSetState(), AlterIndexNamespaces(), arrayconst_cleanup_fn(), arrayexpr_cleanup_fn(), ATCheckPartitionsNotInUse(), AtEOSubXact_Namespace(), AtEOXact_Namespace(), ATExecChangeOwner(), ATExecDropNotNull(), ATExecSetTableSpace(), build_base_rel_tlists(), build_remote_returning(), BuildRelationExtStatistics(), calc_joinrel_size_estimate(), calculate_indexes_size(), calculate_toast_table_size(), check_datestyle(), check_log_destination(), check_search_path(), check_temp_tablespaces(), check_wal_consistency_checking(), choose_bitmap_and(), compute_semi_anti_join_factors(), CopyFrom(), CopyMultiInsertBufferFlush(), CopyMultiInsertInfoCleanup(), CreateExtensionInternal(), CreateTriggerFiringOn(), current_schema(), current_schemas(), DefineIndex(), DefineRelation(), distribute_qual_to_rels(), do_analyze_rel(), DropSubscription(), EventTriggerDDLCommandEnd(), EventTriggerDDLCommandStart(), EventTriggerSQLDrop(), EventTriggerTableRewrite(), ExecInitPartitionInfo(), ExecInsert(), ExecOpenIndices(), ExecRefreshMatView(), ExecResetTupleTable(), ExecSimpleRelationInsert(), ExecSimpleRelationUpdate(), ExecUpdate(), extract_lateral_references(), ExtractExtensionList(), find_all_inheritors(), find_compatible_agg(), find_computable_ec_member(), find_hash_columns(), find_placeholders_in_expr(), fix_placeholder_input_needed_levels(), generate_base_implied_equalities_no_const(), generate_partitionwise_join_paths(), get_rel_sync_entry(), get_relation_info(), get_relation_statistics(), get_steps_using_prefix_recurse(), heap_truncate_find_FKs(), index_concurrently_swap(), index_get_partition(), index_unchanged_by_update(), infer_arbiter_indexes(), list_delete_first_n(), list_delete_last(), list_delete_nth_cell(), llvm_release_context(), make_group_input_target(), make_partial_grouping_target(), make_pathkeys_for_window(), make_sort_input_target(), make_window_input_target(), max_parallel_hazard_walker(), merge_list_bounds(), merge_range_bounds(), ObjectsInPublicationToOids(), OpenTableList(), paraminfo_get_equal_hashops(), parse_hba_auth_opt(), pg_partition_root(), pgstat_write_statsfiles(), plpgsql_extra_checks_check_hook(), pop_ancestor_plan(), PopOverrideSearchPath(), PostmasterMain(), PrepareTempTablespaces(), preprocess_targetlist(), process_implied_equality(), processState(), ProcessUtilitySlow(), qual_is_pushdown_safe(), recomputeNamespacePath(), refresh_by_match_merge(), rel_sync_cache_relation_cb(), RelationCacheInvalidate(), RelationDestroyRelation(), RelationGetIndexAttrBitmap(), RelationGetIndexList(), RelationGetPrimaryKeyIndex(), RelationGetReplicaIndex(), RelationGetStatExtList(), relationHasPrimaryKey(), remove_dbtablespaces(), reorder_grouping_sets(), reparameterize_pathlist_by_child(), roles_is_member_of(), sepgsql_dml_privileges(), simplify_and_arguments(), simplify_or_arguments(), statext_mcv_clauselist_selectivity(), stringToQualifiedNameList(), textToQualifiedNameList(), toast_open_indexes(), transformFkeyCheckAttrs(), transformFkeyGetPrimaryKey(), transformTableLikeClause(), transformValuesClause(), triggered_change_notification(), typeInheritsFrom(), vac_open_indexes(), and WaitForLockers().

◆ list_free_deep()

◆ list_head()

static ListCell* list_head ( const List l)
inlinestatic

Definition at line 125 of file pg_list.h.

126 {
127  return l ? &l->elements[0] : NULL;
128 }

References List::elements.

Referenced by analyzeCTE(), appendTypeNameToBuffer(), arrayexpr_startup_fn(), assign_hypothetical_collations(), ATAddForeignKeyConstraint(), boolexpr_startup_fn(), build_index_tlist(), buildRelationAliases(), CheckRADIUSAuth(), checkWellFormedRecursionWalker(), coerce_record_to_complex(), compare_tlist_datatypes(), ComputeIndexAttrs(), consider_groupingsets_paths(), ConstructTupleDescriptor(), cost_bitmap_and_node(), cost_bitmap_or_node(), create_ctas_nodata(), create_mergejoin_plan(), DefineView(), deparseSubscriptingRef(), deparseTruncateSql(), do_analyze_rel(), dump_getdiag(), examine_variable(), exec_stmt_raise(), ExecInitJunkFilterConversion(), expand_insert_targetlist(), expandRTE(), extract_rollup_sets(), fix_indexqual_operand(), flatten_set_variable_args(), FormIndexDatum(), FormPartitionKeyDatum(), funcname_signature_string(), gen_prune_steps_from_opexps(), generate_append_tlist(), generate_setop_grouplist(), generateClonedIndexStmt(), get_qual_for_hash(), get_qual_for_range(), get_range_nulltest(), get_steps_using_prefix(), get_update_query_targetlist_def(), GetIndexInputType(), has_partition_attrs(), intorel_startup(), join_search_one_level(), jsonb_path_query_internal(), list_startup_fn(), make_inner_pathkeys_for_merge(), makeDependencyGraphWalker(), match_index_to_operand(), NameListToQuotedString(), NameListToString(), OverrideSearchPathMatchesCurrent(), parse_hba_line(), parse_ident_line(), perform_pruning_base_step(), pg_get_indexdef_worker(), pg_get_partkeydef_worker(), postprocess_setop_tlist(), PreCommit_Notify(), print_function_arguments(), printSubscripts(), process_startup_options(), query_is_distinct_for(), RelationBuildPartitionKey(), rewriteSearchAndCycle(), SendRowDescriptionMessage(), set_baserel_partition_key_exprs(), sort_inner_and_outer(), tfuncLoadRows(), tlist_matches_tupdesc(), tlist_same_collations(), tlist_same_datatypes(), transformAssignedExpr(), transformPLAssignStmt(), transformUpdateTargetList(), trim_mergeclauses_for_inner_pathkeys(), try_partitionwise_join(), and TypeNameListToString().

◆ list_insert_nth()

pg_nodiscard List* list_insert_nth ( List list,
int  pos,
void *  datum 
)

Definition at line 418 of file list.c.

419 {
420  if (list == NIL)
421  {
422  Assert(pos == 0);
423  return list_make1(datum);
424  }
426  lfirst(insert_new_cell(list, pos)) = datum;
428  return list;
429 }
static ListCell * insert_new_cell(List *list, int pos)
Definition: list.c:394
#define list_make1(x1)
Definition: pg_list.h:206

References Assert(), check_list_invariants, insert_new_cell(), IsPointerList, lfirst, sort-test::list, list_make1, and NIL.

Referenced by add_partial_path(), add_path(), and merge_clump().

◆ list_insert_nth_int()

pg_nodiscard List* list_insert_nth_int ( List list,
int  pos,
int  datum 
)

Definition at line 432 of file list.c.

433 {
434  if (list == NIL)
435  {
436  Assert(pos == 0);
437  return list_make1_int(datum);
438  }
440  lfirst_int(insert_new_cell(list, pos)) = datum;
442  return list;
443 }
#define list_make1_int(x1)
Definition: pg_list.h:221

References Assert(), check_list_invariants, insert_new_cell(), IsIntegerList, lfirst_int, sort-test::list, list_make1_int, and NIL.

◆ list_insert_nth_oid()

pg_nodiscard List* list_insert_nth_oid ( List list,
int  pos,
Oid  datum 
)

Definition at line 446 of file list.c.

447 {
448  if (list == NIL)
449  {
450  Assert(pos == 0);
451  return list_make1_oid(datum);
452  }
454  lfirst_oid(insert_new_cell(list, pos)) = datum;
456  return list;
457 }
#define list_make1_oid(x1)
Definition: pg_list.h:236

References Assert(), check_list_invariants, insert_new_cell(), IsOidList, lfirst_oid, sort-test::list, list_make1_oid, and NIL.

◆ list_int_cmp()

int list_int_cmp ( const ListCell p1,
const ListCell p2 
)

Definition at line 1629 of file list.c.

1630 {
1631  int v1 = lfirst_int(p1);
1632  int v2 = lfirst_int(p2);
1633 
1634  if (v1 < v2)
1635  return -1;
1636  if (v1 > v2)
1637  return 1;
1638  return 0;
1639 }

References lfirst_int, and p2.

Referenced by expand_grouping_sets().

◆ list_intersection()

List* list_intersection ( const List list1,
const List list2 
)

Definition at line 1133 of file list.c.

1134 {
1135  List *result;
1136  const ListCell *cell;
1137 
1138  if (list1 == NIL || list2 == NIL)
1139  return NIL;
1140 
1141  Assert(IsPointerList(list1));
1142  Assert(IsPointerList(list2));
1143 
1144  result = NIL;
1145  foreach(cell, list1)
1146  {
1147  if (list_member(list2, lfirst(cell)))
1148  result = lappend(result, lfirst(cell));
1149  }
1150 
1151  check_list_invariants(result);
1152  return result;
1153 }

References Assert(), check_list_invariants, IsPointerList, lappend(), lfirst, list_member(), and NIL.

Referenced by find_nonnullable_vars_walker(), and reduce_outer_joins_pass2().

◆ list_intersection_int()

List* list_intersection_int ( const List list1,
const List list2 
)

Definition at line 1159 of file list.c.

1160 {
1161  List *result;
1162  const ListCell *cell;
1163 
1164  if (list1 == NIL || list2 == NIL)
1165  return NIL;
1166 
1167  Assert(IsIntegerList(list1));
1168  Assert(IsIntegerList(list2));
1169 
1170  result = NIL;
1171  foreach(cell, list1)
1172  {
1173  if (list_member_int(list2, lfirst_int(cell)))
1174  result = lappend_int(result, lfirst_int(cell));
1175  }
1176 
1177  check_list_invariants(result);
1178  return result;
1179 }

References Assert(), check_list_invariants, IsIntegerList, lappend_int(), lfirst_int, list_member_int(), and NIL.

Referenced by parseCheckAggregates().

◆ list_last_cell()

static ListCell* list_last_cell ( const List list)
inlinestatic

Definition at line 267 of file pg_list.h.

268 {
269  Assert(list != NIL);
270  return &list->elements[list->length - 1];
271 }

References Assert(), sort-test::list, and NIL.

◆ list_length()

static int list_length ( const List l)
inlinestatic

Definition at line 149 of file pg_list.h.

150 {
151  return l ? l->length : 0;
152 }

References List::length.

Referenced by _copyMergeJoin(), _outForeignKeyOptInfo(), _outMergeJoin(), _outPathTarget(), _readMergeJoin(), _SPI_execute_plan(), acquire_inherited_sample_rows(), add_child_join_rel_equivalences(), add_child_rel_equivalences(), add_column_to_pathtarget(), add_function_defaults(), add_paths_to_append_rel(), add_paths_to_grouping_rel(), add_row_identity_var(), add_security_quals(), add_sp_item_to_pathtarget(), add_to_flat_tlist(), add_with_check_options(), AddEventToPendingNotifies(), addRangeTableEntry(), addRangeTableEntryForCTE(), addRangeTableEntryForENR(), addRangeTableEntryForFunction(), addRangeTableEntryForJoin(), addRangeTableEntryForRelation(), addRangeTableEntryForSubquery(), addRangeTableEntryForTableFunc(), addRangeTableEntryForValues(), AddRelationNewConstraints(), AddRoleMems(), adjust_appendrel_attrs_mutator(), adjust_inherited_attnums(), adjust_paths_for_srfs(), AllTablesyncsReady(), AlterDatabase(), AlterSubscription_refresh(), analyzeCTETargetList(), apply_tlist_labeling(), ApplyRetrieveRule(), array_subscript_transform(), assign_hypothetical_collations(), assign_ordered_set_collations(), assign_param_for_placeholdervar(), assign_param_for_var(), assign_special_exec_param(), ATAddCheckConstraint(), ATAddForeignKeyConstraint(), ATExecAddColumn(), ATExecAlterColumnType(), ATPrepChangePersistence(), AttachPartitionEnsureIndexes(), basebackup_progress_wait_wal_archive(), bbsink_end_backup(), bbsink_progress_begin_backup(), bbsink_progress_end_archive(), BeginCopyFrom(), BeginCopyTo(), btvalidate(), build_expr_data(), build_local_reloptions(), build_merged_partition_bounds(), build_pertrans_for_aggref(), build_remote_returning(), build_simple_rel(), build_subplan(), build_tlist_index(), build_tlist_index_other_vars(), BuildDescForRelation(), BuildDescFromLists(), buildNSItemFromLists(), buildNSItemFromTupleDesc(), buildRelationAliases(), BuildRelationExtStatistics(), cached_plan_cost(), can_minmax_aggs(), check_hashjoinable(), check_memoizable(), check_mergejoinable(), check_selective_binary_conversion(), check_sql_fn_retval(), check_temp_tablespaces(), check_ungrouped_columns_walker(), CheckIndexCompatible(), CheckRADIUSAuth(), choose_best_statistics(), choose_bitmap_and(), choose_hashed_setop(), ChoosePortalStrategy(), classify_index_clause_usage(), clause_is_strict_for(), clauselist_selectivity_ext(), cmp_list_len_asc(), coerce_fn_result_column(), common_prefix_cmp(), commute_restrictinfo(), CommuteOpExpr(), compute_partition_bounds(), compute_semijoin_info(), ComputeIndexAttrs(), connect_pg_server(), consider_groupingsets_paths(), consider_index_join_clauses(), consider_index_join_outer_rels(), conversion_error_callback(), convert_ANY_sublink_to_join(), convert_EXISTS_sublink_to_join(), convert_requires_to_datum(), convert_subquery_pathkeys(), convert_testexpr_mutator(), cookConstraint(), copy_pathtarget(), CopyFrom(), CopyMultiInsertInfoFlush(), CopyOneRowTo(), cost_agg(), count_rowexpr_columns(), create_agg_path(), create_agg_plan(), create_append_path(), create_append_plan(), create_bitmap_subplan(), create_ctescan_plan(), create_degenerate_grouping_paths(), create_final_distinct_paths(), create_foreign_modify(), create_group_path(), create_group_plan(), create_groupingsets_path(), create_groupingsets_plan(), create_hashjoin_plan(), create_indexscan_plan(), create_limit_plan(), create_memoize_plan(), create_merge_append_path(), create_merge_append_plan(), create_mergejoin_plan(), create_modifytable_path(), create_ordered_paths(), create_partial_distinct_paths(), create_partial_grouping_paths(), create_setop_path(), create_tidscan_plan(), create_unique_path(), create_unique_plan(), create_windowagg_path(), create_windowagg_plan(), CreateFunction(), CreatePublication(), CreateStatistics(), CreateTriggerFiringOn(), current_schemas(), currtid_for_view(), deconstruct_recurse(), DeconstructQualifiedName(), DefineAggregate(), DefineCollation(), DefineDomain(), DefineIndex(), DefineQueryRewrite(), DefineRelation(), DefineVirtualRelation(), DelRoleMems(), deparse_context_for_plan_tree(), deparseDistinctExpr(), deparseOpExpr(), deparseRangeTblRef(), deparseScalarArrayOpExpr(), dependencies_clauselist_selectivity(), dependency_is_compatible_clause(), dependency_is_compatible_expression(), do_analyze_rel(), DoCopyTo(), does_not_exist_skipping(), domainAddConstraint(), eclass_useful_for_merging(), EnumValuesCreate(), equalRSDesc(), estimate_array_length(), estimate_hashagg_tablesize(), estimate_multivariate_ndistinct(), estimate_num_groups(), estimate_path_cost_size(), EstimateReindexStateSpace(), eval_const_expressions_mutator(), EvalPlanQualBegin(), EvalPlanQualStart(), EvaluateParams(), EventTriggerAlterTableEnd(), examine_opclause_args(), examine_simple_variable(), exec_eval_using_params(), exec_parse_message(), exec_save_simple_expr(), exec_simple_check_plan(), exec_simple_query(), ExecBuildAggTrans(), ExecBuildParamSetEqual(), ExecBuildUpdateProjection(), ExecCreatePartitionPruneState(), ExecCreateTableAs(), ExecEvalXmlExpr(), ExecHashTableCreate(), ExecIndexBuildScanKeys(), ExecInitAgg(), ExecInitAppend(), ExecInitBitmapAnd(), ExecInitBitmapOr(), ExecInitExprRec(), ExecInitFunc(), ExecInitFunctionScan(), ExecInitIndexScan(), ExecInitMergeAppend(), ExecInitMergeJoin(), ExecInitModifyTable(), ExecInitPartitionInfo(), ExecInitProjectSet(), ExecInitPruningContext(), ExecInitRangeTable(), ExecInitSubPlan(), ExecInitSubscriptingRef(), ExecInitValuesScan(), ExecInitWindowAgg(), ExecMakeTableFunctionResult(), ExecOpenIndices(), ExecRefreshMatView(), ExecScanSubPlan(), ExecSecLabelStmt(), ExecSetParamPlan(), ExecSupportsMarkRestore(), ExecTargetListLength(), ExecTypeFromExprList(), ExecuteCallStmt(), ExecuteQuery(), ExecuteTruncateGuts(), expand_function_arguments(), expand_grouping_sets(), expand_groupingset_node(), expand_indexqual_rowcompare(), expand_inherited_rtentry(), expand_single_inheritance_child(), ExpandColumnRefStar(), ExpandIndirectionStar(), expandRecordVariable(), expandRTE(), expandTupleDesc(), ExplainCustomChildren(), ExplainNode(), ExplainOneUtility(), ExplainPrintTriggers(), ExplainTargetRel(), ExportSnapshot(), exprIsLengthCoercion(), extract_grouping_collations(), extract_grouping_cols(), extract_grouping_ops(), extract_jsp_path_expr(), extract_rollup_sets(), fetch_table_list(), FetchTableStates(), filter_list_to_array(), final_cost_mergejoin(), finalize_plan(), find_all_inheritors(), find_duplicate_ors(), find_expr_references_walker(), find_install_path(), find_join_rel(), find_modifytable_subplan(), findTargetlistEntrySQL92(), fireRIRrules(), fix_indexqual_clause(), fix_param_node(), fix_scan_expr_mutator(), fix_upper_expr_mutator(), flatten_join_alias_vars_mutator(), flatten_set_variable_args(), flatten_simple_union_all(), for_both_cell_setup(), for_each_cell_setup(), foreign_expr_walker(), foreign_grouping_ok(), foreign_join_ok(), func_get_detail(), funcname_signature_string(), gather_grouping_paths(), gen_partprune_steps_internal(), gen_prune_step_op(), generate_append_tlist(), generate_base_implied_equalities(), generate_base_implied_equalities_const(), generate_implied_equalities_for_column(), generate_join_implied_equalities(), generate_join_implied_equalities_for_ecs(), generate_mergejoin_paths(), generate_new_exec_param(), generate_nonunion_paths(), generate_series_int4_support(), generate_series_int8_support(), generate_union_paths(), generate_useful_gather_paths(), genericcostestimate(), geqo_eval(), get_agg_expr(), get_aggregate_argtypes(), get_call_expr_arg_stable(), get_call_expr_argtype(), get_eclass_for_sort_expr(), get_expr_result_type(), get_foreign_key_join_selectivity(), get_from_clause_item(), get_func_expr(), get_func_sql_syntax(), get_join_variables(), get_matching_partitions(), get_memoize_path(), get_name_for_var_field(), get_number_of_groups(), get_object_address_attrdef(), get_object_address_attribute(), get_object_address_defacl(), get_object_address_opf_member(), get_object_address_relobject(), get_oper_expr(), get_parameter(), get_partition_qual_relid(), get_qual_for_range(), get_query_def(), get_relation_foreign_keys(), get_restriction_variable(), get_rightop(), get_rtable_name(), get_rte_attribute_is_dropped(), get_rte_attribute_name(), get_rule_expr(), get_rule_groupingset(), get_simple_binary_op_name(), get_simple_values_rte(), get_singleton_append_subpath(), get_steps_using_prefix(), get_steps_using_prefix_recurse(), get_update_query_targetlist_def(), get_useful_pathkeys_for_relation(), get_variable(), get_view_query(), get_windowfunc_expr(), getIdentitySequence(), getInsertSelectQuery(), GetRTEByRangeTablePosn(), getTokenTypes(), gimme_tree(), gincostestimate(), gistbufferinginserttuples(), gistfinishsplit(), gistRelocateBuildBuffersOnSplit(), grouping_planner(), has_relevant_eclass_joinclause(), hash_ok_operator(), hashvalidate(), have_relevant_eclass_joinclause(), have_relevant_joinclause(), hstore_subscript_transform(), identify_join_columns(), init_sexpr(), initial_cost_hashjoin(), initialize_peragg(), inline_function(), inline_set_returning_function(), interpret_AS_clause(), interpret_function_parameter_list(), interval_support(), InvalidatePublicationRels(), is_safe_append_member(), is_simple_values(), is_strict_saop(), IsBinaryTidClause(), IsTidEqualAnyClause(), IsTransactionExitStmtList(), IsTransactionStmtList(), JsonValueListIsEmpty(), JsonValueListLength(), like_regex_support(), list_deduplicate_oid(), list_delete_first_n(), list_delete_last(), list_sort(), list_truncate(), lookup_var_attr_stats(), LookupFuncWithArgs(), LookupOperWithArgs(), LookupTypeNameExtended(), make_ands_explicit(), make_build_data(), make_callstmt_target(), make_jsp_expr_node_args(), make_memoize(), make_modifytable(), make_partition_op_expr(), make_partition_pruneinfo(), make_path_rowexpr(), make_pathtarget_from_tlist(), make_recursive_union(), make_rel_from_joinlist(), make_restrictinfo_internal(), make_row_comparison_op(), make_row_distinct_op(), make_ruledef(), make_setop(), make_setop_translation_list(), make_sort_from_groupcols(), make_sort_from_sortclauses(), make_sort_input_target(), make_union_unique(), make_unique_from_pathkeys(), make_unique_from_sortclauses(), make_viewdef(), MakeConfigurationMapping(), makeRangeVarFromNameList(), makeWholeRowVar(), markRTEForSelectPriv(), markTargetListOrigin(), match_clause_to_partition_key(), match_foreign_keys_to_quals(), match_opclause_to_indexcol(), MatchNamedCall(), mcv_get_match_bitmap(), mcv_match_expression(), merge_clump(), merge_list_bounds(), merge_range_bounds(), MergeAttributes(), MJExamineQuals(), network_subset_support(), NextCopyFrom(), numeric_support(), operator_predicate_proof(), order_qual_clauses(), ordered_set_startup(), owningrel_does_not_exist_skipping(), paraminfo_get_equal_hashops(), parse_hba_line(), parse_tsquery(), parseCheckAggregates(), ParseFuncOrColumn(), parseLocalRelOptions(), pathkeys_count_contained_in(), perform_pruning_base_step(), PerformCursorOpen(), pg_get_function_arg_default(), pg_get_object_address(), pg_get_publication_tables(), pg_get_statisticsobj_worker(), pg_listening_channels(), pg_partition_ancestors(), pg_partition_tree(), pgoutput_startup(), plpgsql_parse_cwordrowtype(), plpgsql_parse_cwordtype(), PLy_abort_open_subtransactions(), PLy_procedure_call(), policy_role_list_to_array(), postgresBeginDirectModify(), postgresBeginForeignScan(), postgresExplainForeignScan(), predicate_classify(), predicate_implied_by(), predicate_refuted_by(), prepare_sort_from_pathkeys(), PrepareQuery(), PrepareTempTablespaces(), preprocess_aggref(), preprocess_groupclause(), preprocess_grouping_sets(), preprocess_minmax_aggregates(), preprocess_targetlist(), print_expr(), print_function_arguments(), ProcedureCreate(), process_duplicate_ors(), process_owned_by(), processIndirection(), processTypesSpec(), prune_append_rel_partitions(), publicationListToArray(), pull_up_constant_function(), pull_up_simple_subquery(), pull_up_simple_union_all(), pull_up_simple_values(), pull_up_sublinks_qual_recurse(), pullup_replace_vars_callback(), query_is_distinct_for(), query_planner(), rebuild_fdw_scan_tlist(), ReceiveCopyBegin(), recheck_cast_function_args(), reconsider_full_join_clause(), reduce_outer_joins_pass2(), refresh_matview_datafill(), regnamespacein(), regrolein(), relation_excluded_by_constraints(), relation_has_unique_index_for(), RelationBuildPartitionDesc(), remap_groupColIdx(), remove_dbtablespaces(), remove_useless_groupby_columns(), remove_useless_results_recurse(), RemoveRelations(), reorder_function_arguments(), reorder_grouping_sets(), replace_domain_constraint_value(), replace_empty_jointree(), replace_outer_agg(), replace_outer_grouping(), resolve_column_ref(), resolve_special_varno(), RewriteQuery(), rewriteRuleAction(), rewriteSearchAndCycle(), rewriteTargetView(), rewriteValuesRTE(), scalararraysel(), SearchCatCacheList(), select_active_windows(), select_outer_pathkeys_for_merge(), selectColorTrigrams(), SendCopyBegin(), SendNegotiateProtocolVersion(), SerializeReindexState(), set_append_references(), set_cte_pathlist(), set_deparse_context_plan(), set_deparse_for_query(), set_join_column_names(), set_mergeappend_references(), set_plan_references(), set_plan_refs(), set_relation_column_names(), set_rtable_names(), set_simple_column_names(), set_subquery_pathlist(), set_using_names(), set_values_size_estimates(), setup_simple_rel_arrays(), show_grouping_sets(), show_incremental_sort_group_info(), show_memoize_info(), show_plan_tlist(), show_sort_group_keys(), show_tablesample(), show_upper_qual(), simplify_boolean_equality(), sort_inner_and_outer(), SPI_cursor_open_internal(), SPI_is_cursor_plan(), SPI_plan_get_cached_plan(), split_pathtarget_walker(), sql_fn_post_column_ref(), SS_make_initplan_from_plan(), SS_process_ctes(), standard_ExecutorStart(), standard_join_search(), standard_planner(), standard_qp_callback(), statext_is_compatible_clause_internal(), statext_mcv_clauselist_selectivity(), StoreRelCheck(), strlist_to_textarray(), subquery_planner(), tablesample_init(), TemporalSimplify(), test_opexpr_is_hashable(), test_predtest(), TidExprListCreate(), TidListEval(), tlist_same_exprs(), to_regnamespace(), to_regrole(), toast_open_indexes(), trackDroppedObjectsNeeded(), transformAExprBetween(), transformAExprIn(), transformAExprOp(), transformAggregateCall(), transformCallStmt(), transformColumnDefinition(), transformColumnRef(), transformFromClauseItem(), transformGroupingFunc(), transformGroupingSet(), transformIndexConstraint(), transformIndexStmt(), transformInsertRow(), transformInsertStmt(), transformJoinUsingClause(), transformMultiAssignRef(), transformPartitionBound(), transformPartitionRangeBounds(), transformPartitionSpec(), transformPLAssignStmt(), transformRangeFunction(), transformRangeTableFunc(), transformRangeTableSample(), transformRowExpr(), transformRuleStmt(), transformSetOperationStmt(), transformSetOperationTree(), transformStatsStmt(), transformSubLink(), transformValuesClause(), transformWholeRowRef(), transformWindowDefinitions(), transformWindowFuncCall(), transformWithClause(), trivial_subqueryscan(), truncate_useless_pathkeys(), tsvector_update_trigger(), TypeGetTupleDesc(), typenameTypeMod(), typeStringToTypeName(), unify_hypothetical_args(), vac_open_indexes(), vacuum(), ValuesNext(), varbit_support(), varchar_support(), view_cols_are_auto_updatable(), view_query_is_auto_updatable(), and WaitForLockersMultiple().

◆ list_make1_impl()

List* list_make1_impl ( NodeTag  t,
ListCell  datum1 
)

Definition at line 233 of file list.c.

234 {
235  List *list = new_list(t, 1);
236 
237  list->elements[0] = datum1;
239  return list;
240 }

References check_list_invariants, sort-test::list, and new_list().

◆ list_make2_impl()

List* list_make2_impl ( NodeTag  t,
ListCell  datum1,
ListCell  datum2 
)

Definition at line 243 of file list.c.

244 {
245  List *list = new_list(t, 2);
246 
247  list->elements[0] = datum1;
248  list->elements[1] = datum2;
250  return list;
251 }

References check_list_invariants, sort-test::list, and new_list().

◆ list_make3_impl()

List* list_make3_impl ( NodeTag  t,
ListCell  datum1,
ListCell  datum2,
ListCell  datum3 
)

Definition at line 254 of file list.c.

256 {
257  List *list = new_list(t, 3);
258 
259  list->elements[0] = datum1;
260  list->elements[1] = datum2;
261  list->elements[2] = datum3;
263  return list;
264 }

References check_list_invariants, sort-test::list, and new_list().

◆ list_make4_impl()

List* list_make4_impl ( NodeTag  t,
ListCell  datum1,
ListCell  datum2,
ListCell  datum3,
ListCell  datum4 
)

Definition at line 267 of file list.c.

269 {
270  List *list = new_list(t, 4);
271 
272  list->elements[0] = datum1;
273  list->elements[1] = datum2;
274  list->elements[2] = datum3;
275  list->elements[3] = datum4;
277  return list;
278 }

References check_list_invariants, sort-test::list, and new_list().

◆ list_make5_impl()

List* list_make5_impl ( NodeTag  t,
ListCell  datum1,
ListCell  datum2,
ListCell  datum3,
ListCell  datum4,
ListCell  datum5 
)

Definition at line 281 of file list.c.

283 {
284  List *list = new_list(t, 5);
285 
286  list->elements[0] = datum1;
287  list->elements[1] = datum2;
288  list->elements[2] = datum3;
289  list->elements[3] = datum4;
290  list->elements[4] = datum5;
292  return list;
293 }

References check_list_invariants, sort-test::list, and new_list().

◆ list_member()

bool list_member ( const List list,
const void *  datum 
)

◆ list_member_int()

◆ list_member_oid()

bool list_member_oid ( const List list,
Oid  datum 
)

Definition at line 701 of file list.c.

702 {
703  const ListCell *cell;
704 
707 
708  foreach(cell, list)
709  {
710  if (lfirst_oid(cell) == datum)
711  return true;
712  }
713 
714  return false;
715 }

References Assert(), check_list_invariants, IsOidList, lfirst_oid, and sort-test::list.

Referenced by AfterTriggerSaveEvent(), AlterTableMoveAll(), AlterTableNamespace(), apply_handle_truncate(), ATExecAddInherit(), ATExecAttachPartition(), BeginCopyTo(), CheckAttributeType(), CheckObjSchemaNotAlreadyInPublication(), CloneFkReferenced(), CloneFkReferencing(), CollationIsVisible(), ConversionIsVisible(), DefineRelation(), ec_member_matches_indexcol(), ExecAlterObjectDependsStmt(), ExecCheckIndexConstraints(), ExecInitPartitionInfo(), ExecInsertIndexTuples(), ExecuteTruncate(), filter_partitions(), fireRIRrules(), FunctionIsVisible(), get_rel_sync_entry(), get_transform_fromsql(), get_transform_tosql(), has_privs_of_role(), hashvalidate(), have_partkey_equi_join(), heap_truncate_check_FKs(), heap_truncate_find_FKs(), inline_function(), is_member_of_role(), is_member_of_role_nosuper(), list_append_unique_oid(), list_concat_unique_oid(), list_difference_oid(), list_union_oid(), LockViewRecurse_walker(), lookup_shippable(), OpclassIsVisible(), OpenTableList(), OperatorIsVisible(), OpfamilyIsVisible(), pgstat_db_requested(), pgstat_recv_inquiry(), PlanCacheRelCallback(), recomputeNamespacePath(), ReindexIsProcessingIndex(), relation_has_unique_index_for(), relation_is_updatable(), RelationIsVisible(), RememberConstraintForRebuilding(), RememberIndexForRebuilding(), RememberStatisticsForRebuilding(), StatisticsObjIsVisible(), TSConfigIsVisible(), TSDictionaryIsVisible(), TSParserIsVisible(), TSTemplateIsVisible(), typeInheritsFrom(), and TypeIsVisible().

◆ list_member_ptr()

bool list_member_ptr ( const List list,
const void *  datum 
)

Definition at line 661 of file list.c.

662 {
663  const ListCell *cell;
664 
667 
668  foreach(cell, list)
669  {
670  if (lfirst(cell) == datum)
671  return true;
672  }
673 
674  return false;
675 }

References Assert(), check_list_invariants, IsPointerList, lfirst, and sort-test::list.

Referenced by create_bitmap_scan_plan(), create_tidrangescan_plan(), create_tidscan_plan(), get_foreign_key_join_selectivity(), list_append_unique_ptr(), list_concat_unique_ptr(), list_difference_ptr(), list_union_ptr(), postgresGetForeignPlan(), preprocess_groupclause(), and remove_join_clause_from_rels().

◆ list_nth()

static void* list_nth ( const List list,
int  n 
)
inlinestatic

Definition at line 278 of file pg_list.h.

279 {
280  Assert(IsA(list, List));
281  return lfirst(list_nth_cell(list, n));
282 }
static ListCell * list_nth_cell(const List *list, int n)
Definition: pg_list.h:256

References Assert(), IsA, lfirst, sort-test::list, and list_nth_cell().

Referenced by add_child_join_rel_equivalences(), add_child_rel_equivalences(), adjust_appendrel_attrs_mutator(), adjust_inherited_attnums(), apply_handle_update(), ATAddForeignKeyConstraint(), build_joinrel_tlist(), check_new_partition_bound(), consider_index_join_outer_rels(), conversion_error_callback(), convert_subquery_pathkeys(), convert_testexpr_mutator(), dependencies_clauselist_selectivity(), errorMissingColumn(), eval_const_expressions_mutator(), exec_rt_fetch(), ExecInitAppend(), ExecInitCteScan(), ExecInitMemoize(), ExecInitMergeAppend(), ExecInitModifyTable(), ExecInitSubPlan(), ExecInitUpdateProjection(), expand_indexqual_rowcompare(), expand_single_inheritance_child(), expandRecordVariable(), expandRTE(), ExplainTargetRel(), finalize_plan(), find_compatible_trans(), find_expr_references_walker(), find_hash_columns(), find_modifytable_subplan(), find_param_referent(), fix_param_node(), flatten_join_alias_vars_mutator(), generate_implied_equalities_for_column(), generate_join_implied_equalities(), get_call_expr_arg_stable(), get_call_expr_argtype(), get_name_for_var_field(), get_rtable_name(), get_rte_attribute_is_dropped(), get_rte_attribute_name(), get_tupdesc_for_join_scan_tuples(), get_variable(), gimme_tree(), gistfinishsplit(), has_dangerous_join_using(), has_relevant_eclass_joinclause(), have_relevant_eclass_joinclause(), infer_collation_opclass_match(), interpret_AS_clause(), make_callstmt_target(), make_path_rowexpr(), match_eclasses_to_foreign_key_col(), merge_clump(), MergeAttributes(), pg_get_function_arg_default(), pg_listening_channels(), postgresBeginDirectModify(), postgresBeginForeignModify(), postgresBeginForeignScan(), postgresExplainDirectModify(), postgresExplainForeignModify(), postgresExplainForeignScan(), postgresGetForeignPlan(), postgresPlanDirectModify(), postgresPlanForeignModify(), preprocess_aggref(), reorder_grouping_sets(), resolve_special_varno(), rewriteSearchAndCycle(), set_cte_pathlist(), set_deparse_plan(), set_join_column_names(), set_relation_column_names(), set_using_names(), show_modifytable_info(), substitute_actual_parameters_mutator(), substitute_actual_srf_parameters_mutator(), SyncPostCheckpoint(), transformInsertRow(), transformMultiAssignRef(), transformPartitionRangeBounds(), transformSetOperationStmt(), TypeGetTupleDesc(), validateFkOnDeleteSetColumns(), WinGetFuncArgCurrent(), WinGetFuncArgInFrame(), and WinGetFuncArgInPartition().

◆ list_nth_cell()

static ListCell* list_nth_cell ( const List list,
int  n 
)
inlinestatic

Definition at line 256 of file pg_list.h.

257 {
258  Assert(list != NIL);
259  Assert(n >= 0 && n < list->length);
260  return &list->elements[n];
261 }

References Assert(), sort-test::list, and NIL.

Referenced by build_subplan(), expandTupleDesc(), find_all_inheritors(), list_nth(), list_nth_int(), list_nth_oid(), ProcedureCreate(), split_pathtarget_at_srfs(), split_pathtarget_walker(), and unify_hypothetical_args().

◆ list_nth_int()

static int list_nth_int ( const List list,
int  n 
)
inlinestatic

Definition at line 289 of file pg_list.h.

290 {
291  Assert(IsA(list, IntList));
292  return lfirst_int(list_nth_cell(list, n));
293 }

References Assert(), IsA, lfirst_int, sort-test::list, and list_nth_cell().

Referenced by create_ctescan_plan(), make_path_rowexpr(), rewriteSearchAndCycle(), and set_cte_pathlist().

◆ list_nth_oid()

◆ list_oid_cmp()

int list_oid_cmp ( const ListCell p1,
const ListCell p2 
)

Definition at line 1645 of file list.c.

1646 {
1647  Oid v1 = lfirst_oid(p1);
1648  Oid v2 = lfirst_oid(p2);
1649 
1650  if (v1 < v2)
1651  return -1;
1652  if (v1 > v2)
1653  return 1;
1654  return 0;
1655 }
unsigned int Oid
Definition: postgres_ext.h:31

References lfirst_oid, and p2.

Referenced by GetPublicationRelations(), heap_truncate_find_FKs(), RelationGetIndexList(), and RelationGetStatExtList().

◆ list_second_cell()

static ListCell* list_second_cell ( const List l)
inlinestatic

Definition at line 139 of file pg_list.h.

140 {
141  if (l && l->length >= 2)
142  return &l->elements[1];
143  else
144  return NULL;
145 }

References List::elements, and List::length.

Referenced by JsonValueListInitIterator(), and select_common_type().

◆ list_sort()

void list_sort ( List list,
list_sort_comparator  cmp 
)

Definition at line 1612 of file list.c.

1613 {
1614  typedef int (*qsort_comparator) (const void *a, const void *b);
1615  int len;
1616 
1618 
1619  /* Nothing to do if there's less than two elements */
1620  len = list_length(list);
1621  if (len > 1)
1622  qsort(list->elements, len, sizeof(ListCell), (qsort_comparator) cmp);
1623 }
int b
Definition: isn.c:70
int a
Definition: isn.c:69
#define qsort(a, b, c, d)
Definition: port.h:495
static int cmp(const chr *x, const chr *y, size_t len)
Definition: regc_locale.c:747

References a, b, check_list_invariants, cmp(), len, sort-test::list, list_length(), and qsort.

Referenced by create_append_path(), expand_grouping_sets(), GetPublicationRelations(), heap_truncate_find_FKs(), perform_base_backup(), RelationGetIndexList(), RelationGetStatExtList(), sort_policies_by_name(), and UpdateLogicalMappings().

◆ list_tail()

static ListCell* list_tail ( const List l)
inlinestatic

Definition at line 132 of file pg_list.h.

133 {
134  return l ? &l->elements[l->length - 1] : NULL;
135 }

References List::elements, and List::length.

◆ list_truncate()

pg_nodiscard List* list_truncate ( List list,
int  new_size 
)

Definition at line 610 of file list.c.

611 {
612  if (new_size <= 0)
613  return NIL; /* truncate to zero length */
614 
615  /* If asked to effectively extend the list, do nothing */
616  if (new_size < list_length(list))
617  list->length = new_size;
618 
619  /*
620  * Note: unlike the individual-list-cell deletion functions, we don't move
621  * the list cells to new storage, even in DEBUG_LIST_MEMORY_USAGE mode.
622  * This is because none of them can move in this operation, so just like
623  * in the old cons-cell-based implementation, this function doesn't
624  * invalidate any pointers to cells of the list. This is also the reason
625  * for not wiping the memory of the deleted cells: the old code didn't
626  * free them either. Perhaps later we'll tighten this up.
627  */
628 
629  return list;
630 }

References sort-test::list, list_length(), and NIL.

Referenced by accumulate_append_subpath(), choose_bitmap_and(), create_append_plan(), create_merge_append_plan(), does_not_exist_skipping(), expand_indexqual_rowcompare(), ExpandIndirectionStar(), expandRTE(), generate_mergejoin_paths(), geqo_eval(), get_object_address_attrdef(), get_object_address_attribute(), get_object_address_opf_member(), get_object_address_relobject(), get_useful_pathkeys_for_relation(), list_delete_last(), owningrel_does_not_exist_skipping(), ParseFuncOrColumn(), process_owned_by(), transformAggregateCall(), transformFromClauseItem(), transformSetOperationStmt(), transformWholeRowRef(), and truncate_useless_pathkeys().

◆ list_union()

List* list_union ( const List list1,
const List list2 
)

Definition at line 1025 of file list.c.

1026 {
1027  List *result;
1028  const ListCell *cell;
1029 
1030  Assert(IsPointerList(list1));
1031  Assert(IsPointerList(list2));
1032 
1033  result = list_copy(list1);
1034  foreach(cell, list2)
1035  {
1036  if (!list_member(result, lfirst(cell)))
1037  result = lappend(result, lfirst(cell));
1038  }
1039 
1040  check_list_invariants(result);
1041  return result;
1042 }

References Assert(), check_list_invariants, IsPointerList, lappend(), lfirst, list_copy(), and list_member().

Referenced by AddRelationNewConstraints(), and process_duplicate_ors().

◆ list_union_int()

List* list_union_int ( const List list1,
const List list2 
)

Definition at line 1072 of file list.c.

1073 {
1074  List *result;
1075  const ListCell *cell;
1076 
1077  Assert(IsIntegerList(list1));
1078  Assert(IsIntegerList(list2));
1079 
1080  result = list_copy(list1);
1081  foreach(cell, list2)
1082  {
1083  if (!list_member_int(result, lfirst_int(cell)))
1084  result = lappend_int(result, lfirst_int(cell));
1085  }
1086 
1087  check_list_invariants(result);
1088  return result;
1089 }

References Assert(), check_list_invariants, IsIntegerList, lappend_int(), lfirst_int, list_copy(), and list_member_int().

Referenced by expand_grouping_sets().

◆ list_union_oid()

List* list_union_oid ( const List list1,
const List list2 
)

Definition at line 1095 of file list.c.

1096 {
1097  List *result;
1098  const ListCell *cell;
1099 
1100  Assert(IsOidList(list1));
1101  Assert(IsOidList(list2));
1102 
1103  result = list_copy(list1);
1104  foreach(cell, list2)
1105  {
1106  if (!list_member_oid(result, lfirst_oid(cell)))
1107  result = lappend_oid(result, lfirst_oid(cell));
1108  }
1109 
1110  check_list_invariants(result);
1111  return result;
1112 }

References Assert(), check_list_invariants, IsOidList, lappend_oid(), lfirst_oid, list_copy(), and list_member_oid().

◆ list_union_ptr()

List* list_union_ptr ( const List list1,
const List list2 
)

Definition at line 1049 of file list.c.

1050 {
1051  List *result;
1052  const ListCell *cell;
1053 
1054  Assert(IsPointerList(list1));
1055  Assert(IsPointerList(list2));
1056 
1057  result = list_copy(list1);
1058  foreach(cell, list2)
1059  {
1060  if (!list_member_ptr(result, lfirst(cell)))
1061  result = lappend(result, lfirst(cell));
1062  }
1063 
1064  check_list_invariants(result);
1065  return result;
1066 }

References Assert(), check_list_invariants, IsPointerList, lappend(), lfirst, list_copy(), and list_member_ptr().

◆ lnext()

static ListCell* lnext ( const List l,
const ListCell c 
)
inlinestatic

Definition at line 322 of file pg_list.h.

323 {
324  Assert(c >= &l->elements[0] && c < &l->elements[l->length]);
325  c++;
326  if (c < &l->elements[l->length])
327  return (ListCell *) c;
328  else
329  return NULL;
330 }

References Assert(), List::elements, and List::length.

Referenced by _outList(), analyzeCTE(), arrayexpr_next_fn(), assign_hypothetical_collations(), asyncQueueAddEntries(), ATAddForeignKeyConstraint(), build_index_tlist(), build_subplan(), buildRelationAliases(), CheckRADIUSAuth(), coerce_record_to_complex(), compare_tlist_datatypes(), ComputeIndexAttrs(), consider_groupingsets_paths(), ConstructTupleDescriptor(), create_ctas_nodata(), create_mergejoin_plan(), create_one_window_path(), DefineView(), deparseAggref(), deparseFuncExpr(), deparseSubscriptingRef(), do_analyze_rel(), examine_variable(), exec_simple_query(), exec_stmt_raise(), ExecInitJunkFilterConversion(), ExecLockRows(), expand_insert_targetlist(), expandRTE(), expandTupleDesc(), ExplainExecuteQuery(), ExplainQuery(), extract_rollup_sets(), find_param_referent(), fix_indexqual_operand(), fmgr_sql(), FormIndexDatum(), FormPartitionKeyDatum(), funcname_signature_string(), generate_append_tlist(), generate_setop_grouplist(), generateClonedIndexStmt(), get_func_expr(), get_qual_for_hash(), get_qual_for_range(), get_range_key_properties(), get_range_nulltest(), get_rule_expr(), get_update_query_targetlist_def(), GetIndexInputType(), has_partition_attrs(), intorel_startup(), join_search_one_level(), JsonValueListNext(), list_next_fn(), make_inner_pathkeys_for_merge(), match_index_to_operand(), OverrideSearchPathMatchesCurrent(), parse_hba_line(), parse_ident_line(), perform_base_backup(), perform_pruning_base_step(), pg_get_functiondef(), pg_get_indexdef_worker(), pg_get_partkeydef_worker(), PortalRunMulti(), postprocess_setop_tlist(), print_expr(), print_function_arguments(), print_pathkeys(), printSubscripts(), ProcedureCreate(), process_startup_options(), query_is_distinct_for(), RelationBuildPartitionKey(), SendRowDescriptionMessage(), serialize_deflist(), set_baserel_partition_key_exprs(), split_pathtarget_at_srfs(), tfuncLoadRows(), tlist_matches_tupdesc(), tlist_same_collations(), tlist_same_datatypes(), transformAssignmentIndirection(), transformUpdateTargetList(), transformWithClause(), trim_mergeclauses_for_inner_pathkeys(), and try_partitionwise_join().