Further to the point of saying functions are ineffiencent, consider the fact that as of the current version of PostgreSQL, plpgsql
functions cannot be pre-optimized. So when they are referenced in a SQL statement, PostgreSQL (optimizer) has load the
function from the catalogs, which involves overhead. If the function calls another function, then the process has to be repeated, which involves additional overhead. Ergo, that is not the most efficient way of doing things.