Posted On: May 17, 2019
Amazon Redshift now supports SQL stored procedures to make migration to Amazon Redshift easier. Stored procedures are used to encapsulate logic for data transformation, data validation, and business-specific logic. By combining multiple SQL steps into a stored procedure, you can reduce round trips between your applications and the database.
Until now customers that use stored procedures in their legacy data warehouse had to consider re-implementing the logic via services such as Amazon EMR before migrating to a cloud data warehouse. Now these customers can bring their existing stored procedures to Amazon Redshift and reduce their migration effort.
Amazon Redshift supports stored procedures in PL/pgSQL dialect and can include variable declaration, control logic, loops, allow raising errors, support security definer, and other features. You can create stored procedures to perform functions without giving a user access to the underlying tables with security definer controls. You can find more information about creating and running stored procedures in the Amazon Redshift database developer guide.
Stored procedures are supported with the release version 1.0.7562 or higher in all AWS commercial regions. Refer to the AWS Region Table for Amazon Redshift availability.