I would like to create a function in PL/pgSQL with a couple of nested (or inner) functions within it. This way I can break the problem down into smaller pieces but not have my smaller pieces accessible outside of this function.
Is it possible to do this in PL/pgSQL? If so, how?
Nested functions are not supported by PLpgSQL. The emulation has not any sense and it is nonproductive.
Try it:
In postgres 9.5
SELECT outer();
outputsEDIT: if you don't drop the inner function at the end of the outer function it will remain visible to the rest of the database.