[−][src]Enum postgres_parser::sys::SubLinkType
SubLink
A SubLink represents a subselect appearing in an expression, and in some cases also the combining operator(s) just above it. The subLinkType indicates the form of the expression represented: EXISTS_SUBLINK EXISTS(SELECT ...) ALL_SUBLINK (lefthand) op ALL (SELECT ...) ANY_SUBLINK (lefthand) op ANY (SELECT ...) ROWCOMPARE_SUBLINK (lefthand) op (SELECT ...) EXPR_SUBLINK (SELECT with single targetlist item ...) MULTIEXPR_SUBLINK (SELECT with multiple targetlist items ...) ARRAY_SUBLINK ARRAY(SELECT with single targetlist item ...) CTE_SUBLINK WITH query (never actually part of an expression) For ALL, ANY, and ROWCOMPARE, the lefthand is a list of expressions of the same length as the subselect's targetlist. ROWCOMPARE will always have a list with more than one entry; if the subselect has just one target then the parser will create an EXPR_SUBLINK instead (and any operator above the subselect will be represented separately). ROWCOMPARE, EXPR, and MULTIEXPR require the subselect to deliver at most one row (if it returns no rows, the result is NULL). ALL, ANY, and ROWCOMPARE require the combining operators to deliver boolean results. ALL and ANY combine the perrow results using AND and OR semantics respectively. ARRAY requires just one target column, and creates an array of the target column's type using any number of rows resulting from the subselect.
SubLink is classed as an Expr node, but it is not actually executable; it must be replaced in the expression tree by a SubPlan node during planning.
NOTE: in the raw output of gram.y, testexpr contains just the raw form of the lefthand expression (if any), and operName is the String name of the combining operator. Also, subselect is a raw parsetree. During parse analysis, the parser transforms testexpr into a complete boolean expression that compares the lefthand value(s) to PARAM_SUBLINK nodes representing the output columns of the subselect. And subselect is transformed to a Query. This is the representation seen in saved rules and in the rewriter.
In EXISTS, EXPR, MULTIEXPR, and ARRAY SubLinks, testexpr and operName are unused and are always null.
subLinkId is currently used only for MULTIEXPR SubLinks, and is zero in other SubLinks. This number identifies different multipleassignment subqueries within an UPDATE statement's SET list. It is unique only within a particular targetlist. The output column(s) of the MULTIEXPR are referenced by PARAM_MULTIEXPR Params appearing elsewhere in the tlist.
The CTE_SUBLINK case never occurs in actual SubLink nodes, but it is used in SubPlans generated for WITH subqueries.
Variants
Trait Implementations
impl Clone for SubLinkType
[src]
fn clone(&self) -> SubLinkType
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for SubLinkType
[src]
impl Debug for SubLinkType
[src]
impl<'de> Deserialize<'de> for SubLinkType
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for SubLinkType
[src]
impl Hash for SubLinkType
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<SubLinkType> for SubLinkType
[src]
fn eq(&self, other: &SubLinkType) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for SubLinkType
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for SubLinkType
[src]
impl StructuralPartialEq for SubLinkType
[src]
Auto Trait Implementations
impl RefUnwindSafe for SubLinkType
impl Send for SubLinkType
impl Sync for SubLinkType
impl Unpin for SubLinkType
impl UnwindSafe for SubLinkType
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,