HiIs there any way to create nested function?oracle to postgres migration required super function variable reference into nested function without nested function parameterOracle sample:-------------------------------create or replace function f1(n number) return numberisvs number:=1;function nf1(m number) return number isbeginreturn vs + m + n;end;beginreturn nf1(2);end;/run:--------SQL> select f1(9) from dual;F1(9)----------12
PostgreSQL's pl/pgsql langauge doesn't grok closures. You are welcome to write "f1" in a language that does. Perl and Python are built-in and many others are available. I assume at least one of them can do this.
David J.