DROP AGGREGATE FUNCTION

Drops a user-defined aggregate function (UDAnF) from the Vertica catalog.

Drops a user-defined aggregate function (UDAnF) from the Vertica catalog.

Syntax

DROP AGGREGATE FUNCTION [ IF EXISTS ] [[database.]schema.]function( [ arglist ] )

Parameters

IF EXISTS
Specifies not to report an error if the function to drop does not exist. Use this clause in SQL scripts to avoid errors on dropping non-existent objects before attempting to create them.
[database.]schema

Database and schema. The default schema is public. If you specify a database, it must be the current database.

function
Specifies a name of the SQL function to drop. If the function name is schema-qualified, the function is dropped from the specified schema (as noted above).
arglist
A comma delimited list of argument names and data types that are passed to the function, formatted as follows:
{ [argname] argtype }[,...]
  • argname optionally specifies the argument name, typically a column name.

  • argtype specifies the argument's data type, where argtype matches a Vertica data type.

Privileges

Non-superuser: Owner

Requirements

  • To drop a function, you must specify the argument types because several functions might share the same name with different parameters.

  • Vertica does not check for dependencies, so if you drop a SQL function where other objects reference it (such as views or other SQL functions), Vertica returns an error when those objects are used and not when the function is dropped.

Examples

The following command drops the ag_avg function:

=> DROP AGGREGATE FUNCTION ag_avg(numeric);
DROP AGGREGATE FUNCTION

See also

Aggregate functions (UDAFs)