In PostgreSQL we tend to use select stored procedures in executing stored procedures, but if the stored procedure is called again, it cannot be used, and the perform stored procedure should be used to see the description of the official documentation
=====================================================================
executes an expression or command that has no result
Sometimes we want to evaluate an expression or a command, but discard the result (usually because we often invoke a function that has useful side effects but no useful result values). To do this in Pl/pgsql, you can use the Perform statement:
PERFORM query;
This statement executes a query and discards the result. The wording of query is the same as the SQL Select command you normally write, just to replace the keyword select with the beginning of the PERFORM. The pl/pgsql variable is substituted into the command as usual. Similarly, if the command generates at least one row, then the special variable FOUND is set to True and False if no rows are born.
Note: We may want a select that does not have an into clause to meet this need, but the only way to accept it now is perform.
An example:
PERFORM create_mv (' cs_session_page_requests_mv ', my_query);
Issues that are applied when stored procedures (functions) are called in PostgreSQL