Skip to main content

Module grouping_sets

Module grouping_sets 

Source
Expand description

PostgreSQL-compatible grouping-set preparation after input schema binding.

Functions§

bind_grouping_names
Bind grouping expressions before storing a query or executing its aggregation. Returns whether an output name was replaced.
prepare_grouping_sets
Resolve grouping names against the input before expanding output aliases and deduplicating GROUP BY DISTINCT sets. Equivalent qualified and unqualified columns share one identity without conflating expressions that PostgreSQL resolves to different operator inputs.
resolve_grouping_expression
An unqualified input column wins even when its lookup is ambiguous. Output names are considered only for a whole bare name, never inside an expression. schema holds the query’s own columns over outer, the scope of the queries that enclose it, whose columns do not take a name before an output column.
validate_grouped_expressions
Validate the grouped expressions of a query whose own columns schema holds over outer, the scope of the queries that enclose it.