Managing stored procedures in a database
Stored procedures in Amazon Redshift are user-created objects using the Procedural Language/PostgreSQL (PL/pgSQL) procedural programming language. Stored procedures support both data definition language (DDL) and data manipulation language (DML). Stored procedures can take in input arguments but do not necessarily need to return results. PL/pgSQL also supports conditional logic, loops, and case statements. Stored procedures are commonly used to build reusable extract, transform, load (ETL) data pipelines and serve the database administrator (DBA) to automate routine administrative activities—for example, periodically dropping unused tables.
The SECURITY attribute controls who has privileges to access certain database objects.
Stored procedures can be created with security definer controls to allow the execution of a procedure without giving access to underlying tables—for example, they can drop a table created by another...