MCPcopy Create free account
hub / github.com/dolthub/doltgresql / CheckIsWindowOrAgg

Function CheckIsWindowOrAgg

postgres/parser/sem/tree/type_check.go:828–838  ·  view source on GitHub ↗

CheckIsWindowOrAgg returns an error if the function definition is not a window function or an aggregate.

(def *FunctionDefinition)

Source from the content-addressed store, hash-verified

826// CheckIsWindowOrAgg returns an error if the function definition is not a
827// window function or an aggregate.
828func CheckIsWindowOrAgg(def *FunctionDefinition) error {
829 switch def.Class {
830 case AggregateClass:
831 case WindowClass:
832 default:
833 return pgerror.Newf(pgcode.WrongObjectType,
834 "OVER specified, but %s() is neither a window function nor an aggregate function",
835 def.Name)
836 }
837 return nil
838}
839
840// TypeCheck implements the Expr interface.
841func (expr *FuncExpr) TypeCheck(

Callers 1

TypeCheckMethod · 0.85

Calls 1

NewfFunction · 0.92

Tested by

no test coverage detected