ALTER PROCEDURE (Stored)

Alters a stored procedure, retaining any existing grants.

Syntax

ALTER PROCEDURE procedure ( [ [ parameter_mode ] [ parameter ] parameter_type [, ...] ] )
    [ SECURITY { INVOKER | DEFINER }
      | RENAME TO new_procedure_name
      | OWNER TO new_owner
      | SET SCHEMA new_schema
      | SOURCE TO new_source
    ]

Parameters

procedure

The procedure to alter.

parameter_mode

The IN parameters of the stored procedure.

parameter

The name of the parameter.

parameter_type

The type of the parameter.

SECURITY { INVOKER | DEFINER }

Specifies whether to execute the procedure with the privileges of the invoker or its definer (owner).

For details, see Executing Stored Procedures.

RENAME TO new_procedure_name

The new name for the procedure.

parameter_type

The type of the parameter.

OWNER TO new_owner

The new owner (definer) of the procedure.

SET SCHEMA new_schema

The new schema of the procedure.

SOURCE TO new_source The new procedure source code. For details, see Scope and Structure.

Privileges

OWNER TO

Superuser

RENAME and SCHEMA TO

Non-superuser:

  • CREATE on the procedure's schema
  • Ownership of the procedure

Other Operations

Non-superuser: Ownership of the procedure

Examples

See Altering Stored Procedures.