# info > ALTER_PROCEDURE

---
type: CommandReference
command: ALTER PROCEDURE
mode: man
section: 7
source: man-pages
---

## Quick Reference

- `ALTER PROCEDURE insert_data(integer, integer) RENAME TO insert_record;` — Rename a procedure.
- `ALTER PROCEDURE insert_data(integer, integer) OWNER TO joe;` — Change owner.
- `ALTER PROCEDURE insert_data(integer, integer) SET SCHEMA accounting;` — Change schema.
- `ALTER PROCEDURE insert_data(integer, integer) DEPENDS ON EXTENSION myext;` — Mark dependency on extension.
- `ALTER PROCEDURE check_password(text) SET search_path = admin, pg_temp;` — Set configuration parameter.
- `ALTER PROCEDURE check_password(text) RESET search_path;` — Reset configuration parameter.

## Name

ALTER PROCEDURE — change the definition of a procedure

## Synopsis

text
ALTER PROCEDURE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
    action [ ... ] [ RESTRICT ]
ALTER PROCEDURE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
    RENAME TO new_name
ALTER PROCEDURE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
    OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
ALTER PROCEDURE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
    SET SCHEMA new_schema
ALTER PROCEDURE name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ]
    [ NO ] DEPENDS ON EXTENSION extension_name

where action is one of:

    [ EXTERNAL ] SECURITY INVOKER | [ EXTERNAL ] SECURITY DEFINER
    SET configuration_parameter { TO | = } { value | DEFAULT }
    SET configuration_parameter FROM CURRENT
    RESET configuration_parameter
    RESET ALL
## Options

- `name` — The name (optionally schema-qualified) of an existing procedure. If no argument list is specified, the name must be unique in its schema.

- `argmode` — The mode of an argument: `IN`, `OUT`, `INOUT`, or `VARIADIC`. Default is `IN`.

- `argname` — The name of an argument. Not used by `ALTER PROCEDURE`; only argument data types matter for identity.

- `argtype` — The data type(s) of the procedure's arguments (optionally schema-qualified). See [DROP PROCEDURE](https://www.postgresql.org/docs/14/sql-dropprocedure.html) for lookup details.

- `new_name` — The new name of the procedure.

- `new_owner` — The new owner of the procedure. If the procedure is marked `SECURITY DEFINER`, it will execute as the new owner. You must be a direct or indirect member of the new owning role, and that role must have `CREATE` privilege on the procedure's schema. Superusers can change ownership of any procedure.

- `new_schema` — The new schema for the procedure.

- `extension_name` — Marks the procedure as dependent on the extension (or no longer dependent with `NO`). A dependent procedure is dropped when the extension is dropped (even without `CASCADE`). A procedure can depend on multiple extensions.

- `[ EXTERNAL ] SECURITY INVOKER` / `[ EXTERNAL ] SECURITY DEFINER` — Change whether the procedure is a security definer. The keyword `EXTERNAL` is ignored for SQL conformance. See [CREATE PROCEDURE](https://www.postgresql.org/docs/14/sql-createprocedure.html) for more.

- `configuration_parameter` / `value` — Add or change a configuration parameter assignment when the procedure is called. `DEFAULT` or `RESET` removes the procedure-local setting. `RESET ALL` clears all procedure-local settings. `SET FROM CURRENT` saves the current value as the procedure's entry value. See [SET](https://www.postgresql.org/docs/14/sql-set.html) and Chapter 20 for allowed parameters.

- `RESTRICT` — Ignored for SQL conformance.

## Examples

Rename a procedure:

shell
ALTER PROCEDURE insert_data(integer, integer) RENAME TO insert_record;
Change owner:

shell
ALTER PROCEDURE insert_data(integer, integer) OWNER TO joe;
Change schema:

shell
ALTER PROCEDURE insert_data(integer, integer) SET SCHEMA accounting;
Mark dependency on an extension:

shell
ALTER PROCEDURE insert_data(integer, integer) DEPENDS ON EXTENSION myext;
Set a configuration parameter (search path):

shell
ALTER PROCEDURE check_password(text) SET search_path = admin, pg_temp;
Reset a configuration parameter:

shell
ALTER PROCEDURE check_password(text) RESET search_path;
## See Also

- [CREATE PROCEDURE](https://www.postgresql.org/docs/14/sql-createprocedure.html)
- [DROP PROCEDURE](https://www.postgresql.org/docs/14/sql-dropprocedure.html)
- [ALTER FUNCTION](https://www.postgresql.org/docs/14/sql-alterfunction.html)
- [ALTER ROUTINE](https://www.postgresql.org/docs/14/sql-alterroutine.html)
- [SET](https://www.postgresql.org/docs/14/sql-set.html)