PostgreSQL Source Code git master
Loading...
Searching...
No Matches
pgpa_identifier.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * pgpa_identifier.h
4 * create appropriate identifiers for range table entries
5 *
6 * Copyright (c) 2016-2026, PostgreSQL Global Development Group
7 *
8 * contrib/pg_plan_advice/pgpa_identifier.h
9 *
10 *-------------------------------------------------------------------------
11 */
12
13#ifndef PGPA_IDENTIFIER_H
14#define PGPA_IDENTIFIER_H
15
16#include "nodes/pathnodes.h"
17#include "nodes/plannodes.h"
18
19typedef struct pgpa_identifier
20{
21 const char *alias_name;
23 const char *partnsp;
24 const char *partrel;
25 const char *plan_name;
27
28/* Convenience function for comparing possibly-NULL strings. */
29static inline bool
30strings_equal_or_both_null(const char *a, const char *b)
31{
32 if (a == b)
33 return true;
34 else if (a == NULL || b == NULL)
35 return false;
36 else
37 return strcmp(a, b) == 0;
38}
39
40extern const char *pgpa_identifier_string(const pgpa_identifier *rid);
42 pgpa_identifier *rid);
44 Bitmapset *relids,
45 pgpa_identifier *rids);
47
50 pgpa_identifier *rid);
51
52#endif
unsigned int Index
Definition c.h:682
int b
Definition isn.c:74
int a
Definition isn.c:73
static bool strings_equal_or_both_null(const char *a, const char *b)
void pgpa_compute_identifier_by_rti(PlannerInfo *root, Index rti, pgpa_identifier *rid)
Index pgpa_compute_rti_from_identifier(int rtable_length, pgpa_identifier *rt_identifiers, pgpa_identifier *rid)
pgpa_identifier * pgpa_create_identifiers_for_planned_stmt(PlannedStmt *pstmt)
int pgpa_compute_identifiers_by_relids(PlannerInfo *root, Bitmapset *relids, pgpa_identifier *rids)
const char * pgpa_identifier_string(const pgpa_identifier *rid)
static int fb(int x)
tree ctl root
Definition radixtree.h:1857
const char * alias_name
const char * partnsp
const char * partrel
const char * plan_name