I checked some StackOverflow answers for showing all columns in the table using stored procedure in Postgresql. And most of the answers says using function is the best practice for all columns shown. But I want to know what is the reason behind that. Can anyone please tell me in detail.
Asked
Active
Viewed 104 times
0
-
2Because a stored procedure by definition has no return value. – Laurenz Albe Jun 23 '22 at 18:52
-
1See [Returning from a procedure](https://www.postgresql.org/docs/current/plpgsql-control-structures.html#PLPGSQL-STATEMENTS-RETURNING-PROCEDURE). It is more difficult to return information from a procedure then from a function. – Adrian Klaver Jun 23 '22 at 18:52