Subject Using PSQL as a function?
Author Scott Morgan
I checked the FB Book but can't see anything obvious.

Is it possible to use PSQL procedures as functions in SQL? Assuming the
procedure only returns one value, and it's type matches as required,
something like:

SELECT VAL, MY_PSQL_PROC(VAL) FROM SOME_TABLE;

or

SELECT * FROM SOME_TABLE WHERE VAL = MY_PSQL_PROC(123);

It seems like a useful feature but the only way to do that currently is
via external C modules.

Scott