Create procedure to execute query in PostgreSQL
问题 Maybe it's not new case, but I'm stack about it. This is the procedure that I use to run query, it run normally in MySQL, but not in PostgreSQL and I don't know how to do that. The procedure(in MySQL) looks like : CREATE PROCEDURE runstatement(IN statement TEXT) BEGIN set @s = statement; IF LENGTH(@s) <> 0 THEN PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt; END IF; END The questions : How do I convert it to PostgreSQL version? How do I call this procedure(runstatement) when I