pub struct Relation {
pub oid: u32,
pub columns: Vec<Column>,
pub subquery: Option<Box<Query>>,
pub function: Option<FromFunction>,
pub values: Option<Vec<Vec<Expr>>>,
pub name: String,
pub alias: Option<Vec<String>>,
pub lateral: bool,
pub cte: Option<CteRef>,
pub tablesample: Option<TableSample>,
pub only: bool,
pub perm: Option<usize>,
}Expand description
A relation of FROM, as a RangeTblEntry of the kind RTE_RELATION or RTE_SUBQUERY.
Fields§
§oid: u32The OID of the pg_class row, or 0 for a subquery.
columns: Vec<Column>The columns of the relation, with their real names. The columns of a subquery are the columns of its result.
subquery: Option<Box<Query>>The query of a subquery in FROM, or the query of a view, which the executor reads in place of the view.
function: Option<FromFunction>The calls of a function in FROM.
values: Option<Vec<Vec<Expr>>>The rows of a VALUES list, each with one expression for each column.
name: Stringeref->aliasname: the alias, or the name that the analyzer gives the relation, such as the name of the table, unnamed_subquery or the name of the function.
alias: Option<Vec<String>>The names of the columns of the alias when the query gives the relation an alias, as alias->colnames. Relation::name is then the name of the alias.
lateral: boolTrue when the query writes LATERAL before a subquery or a function.
cte: Option<CteRef>The query of WITH that the relation reads.
tablesample: Option<TableSample>The TABLESAMPLE clause of a table.
only: boolTrue for ONLY before the name of a table. A partitioned table then gives no rows, and a table gives no rows of its children of INHERITS.
perm: Option<usize>perminfoindex: the index of the privileges of a table or a view in the privileges of the statement while the analyzer reads the statement, or None for a relation that needs no privileges.