1/*-------------------------------------------------------------------------
4 * Access to functions to mutate the query environment and retrieve the
5 * actual data related to entries (if any).
7 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/utils/queryenvironment.h
12 *-------------------------------------------------------------------------
14#ifndef QUERYENVIRONMENT_H
15#define QUERYENVIRONMENT_H
26 * Some ephemeral named relations must match some relation (e.g., trigger
27 * transition tables), so to properly handle cached plans and DDL, we should
28 * carry the OID of that relation. In other cases an ENR might be independent
29 * of any relation which is stored in the system catalogs, so we need to be
30 * able to directly store the TupleDesc. We never need both.
34 char *
name;
/* name used to identify the relation */
36 /* only one of the next two fields should be used */
47 * Ephemeral Named Relation data; used for parsing named relations not in the
48 * catalog, like transition tables in AFTER triggers.
53 void *
reldata;
/* structure for execution-time access to data */
59 * This is an opaque structure outside of queryenvironment.c itself. The
60 * intention is to be able to change the implementation or add new context
61 * features without needing to change existing code for use of existing
74#endif /* QUERYENVIRONMENT_H */
TupleDesc ENRMetadataGetTupDesc(EphemeralNamedRelationMetadata enrmd)
struct EphemeralNamedRelationMetadataData EphemeralNamedRelationMetadataData
EphemeralNamedRelation get_ENR(QueryEnvironment *queryEnv, const char *name)
EphemeralNamedRelationData * EphemeralNamedRelation
EphemeralNameRelationType
EphemeralNamedRelationMetadata get_visible_ENR_metadata(QueryEnvironment *queryEnv, const char *refname)
void unregister_ENR(QueryEnvironment *queryEnv, const char *name)
QueryEnvironment * create_queryEnv(void)
void register_ENR(QueryEnvironment *queryEnv, EphemeralNamedRelation enr)
struct EphemeralNamedRelationData EphemeralNamedRelationData
EphemeralNamedRelationMetadataData * EphemeralNamedRelationMetadata
EphemeralNamedRelationMetadataData md