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

Function NewInvalidFunctionUsageError

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

NewInvalidFunctionUsageError creates a rejection for a special function.

(class FunctionClass, context string)

Source from the content-addressed store, hash-verified

720
721// NewInvalidFunctionUsageError creates a rejection for a special function.
722func NewInvalidFunctionUsageError(class FunctionClass, context string) error {
723 var cat string
724 var code pgcode.Code
725 switch class {
726 case AggregateClass:
727 cat = "aggregate"
728 code = pgcode.Grouping
729 case WindowClass:
730 cat = "window"
731 code = pgcode.Windowing
732 case GeneratorClass:
733 cat = "generator"
734 code = pgcode.FeatureNotSupported
735 }
736 return pgerror.Newf(code, "%s functions are not allowed in %s", cat, context)
737}
738
739// checkFunctionUsage checks whether a given built-in function is
740// allowed in the current context.

Callers 1

checkFunctionUsageMethod · 0.85

Calls 1

NewfFunction · 0.92

Tested by

no test coverage detected