---
name: "alter_function"
section: "7"
platform: "linux"
package: "postgresql"
version: "7.4.7-6sarge6"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/alter_function"
---

# alter\_function(7)

change the definition of a function

## NAME

ALTER FUNCTION - change the definition of a function

## SYNOPSIS

```
ALTER FUNCTION name ( [ type [, ...] ] ) RENAME TO newname

```

## DESCRIPTION

**ALTER FUNCTION** changes the definition of a function. The only functionality is to rename the function.

## PARAMETERS

- *name*

  The name (optionally schema-qualified) of an existing function.

- *type*

  The data type of an argument of the function.

- *newname*

  The new name of the function.

## EXAMPLES

To rename the function sqrt for type **integer** to square\_root:

```
ALTER FUNCTION sqrt(integer) RENAME TO square_root;

```

## COMPATIBILITY

There is an **ALTER FUNCTION** statement in the SQL standard, but it does not provide the option to rename the function.

## SEE ALSO

CREATE FUNCTION \[[**create\_function**(7)](/create_function/7.md)\], DROP FUNCTION \[**drop\_function**(l)\]
