Does PostgreSQL have stored procedures?
PostgreSQL doesn’t. However PostgreSQL have very powerful functions and user-defined functions capabilities that can do most things that other RDBMS stored routines (procedures and functions) can do and in many cases more. These functions can be of different types and can be implemented in several programming languages. (Refer to documentation for more details. User-Defined Functions) PostgreSQL functions can be invoked in many ways. If you want to invoke a function as you would call a stored procedure in other RDBMS (typically a function with side-effects but whose result you don’t care for example because it returns void), one option would be to use PL/pgSQL Language for your procedure and the PERFORM command.