[][src]Struct postgres_parser::sys::Aggref

#[repr(C)]pub struct Aggref {
    pub xpr: Expr,
    pub aggfnoid: Oid,
    pub aggtype: Oid,
    pub aggcollid: Oid,
    pub inputcollid: Oid,
    pub aggtranstype: Oid,
    pub aggargtypes: *mut List,
    pub aggdirectargs: *mut List,
    pub args: *mut List,
    pub aggorder: *mut List,
    pub aggdistinct: *mut List,
    pub aggfilter: *mut Expr,
    pub aggstar: bool,
    pub aggvariadic: bool,
    pub aggkind: c_char,
    pub agglevelsup: Index,
    pub aggsplit: AggSplit,
    pub location: c_int,
}

Aggref

The aggregate's args list is a targetlist, ie, a list of TargetEntry nodes.

For a normal (nonorderedset) aggregate, the nonresjunk TargetEntries represent the aggregate's regular arguments (if any) and resjunk TLEs can be added at the end to represent ORDER BY expressions that are not also arguments. As in a toplevel Query, the TLEs can be marked with ressortgroupref indexes to let them be referenced by SortGroupClause entries in the aggorder and/or aggdistinct lists. This represents ORDER BY and DISTINCT operations to be applied to the aggregate input rows before they are passed to the transition function. The grammar only allows a simple "DISTINCT" specifier for the arguments, but we use the full querylevel representation to allow more code sharing.

For an orderedset aggregate, the args list represents the WITHIN GROUP (aggregated) arguments, all of which will be listed in the aggorder list. DISTINCT is not supported in this case, so aggdistinct will be NIL. The direct arguments appear in aggdirectargs (as a list of plain expressions, not TargetEntry nodes).

aggtranstype is the data type of the state transition values for this aggregate (resolved to an actual type, if agg's transtype is polymorphic). This is determined during planning and is InvalidOid before that.

aggargtypes is an OID list of the data types of the direct and regular arguments. Normally it's redundant with the aggdirectargs and args lists, but in a combining aggregate, it's not because the args list has been replaced with a single argument representing the partialaggregate transition values.

aggsplit indicates the expected partialaggregation mode for the Aggref's parent plan node. It's always set to AGGSPLIT_SIMPLE in the parser, but the planner might change it to something else. We use this mainly as a crosscheck that the Aggrefs match the plan; but note that when aggsplit indicates a nonfinal mode, aggtype reflects the transition data type not the SQLlevel output type of the aggregate.

Fields

xpr: Expraggfnoid: Oidaggtype: Oid

pg_proc Oid of the aggregate

aggcollid: Oid

type Oid of result of the aggregate

inputcollid: Oid

OID of collation of result

aggtranstype: Oid

OID of collation that function should use

aggargtypes: *mut List

type Oid of aggregate's transition value

aggdirectargs: *mut List

type Oids of direct and aggregated args

args: *mut List

direct arguments, if an orderedset agg

aggorder: *mut List

aggregated arguments and sort expressions

aggdistinct: *mut List

ORDER BY (list of SortGroupClause)

aggfilter: *mut Expr

DISTINCT (list of SortGroupClause)

aggstar: bool

FILTER expression, if any

aggvariadic: bool

true if argument list was really '*'

aggkind: c_char

true if variadic arguments have been combined into an array last argument

agglevelsup: Index

aggregate kind (see pg_aggregate.h)

aggsplit: AggSplit

0 if agg belongs to outer query

location: c_int

expected aggsplitting mode of parent Agg

Trait Implementations

impl Debug for Aggref[src]

impl Default for Aggref[src]

impl Eq for Aggref[src]

impl Hash for Aggref[src]

impl PartialEq<Aggref> for Aggref[src]

impl StructuralEq for Aggref[src]

impl StructuralPartialEq for Aggref[src]

Auto Trait Implementations

impl RefUnwindSafe for Aggref

impl !Send for Aggref

impl !Sync for Aggref

impl Unpin for Aggref

impl UnwindSafe for Aggref

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.