Re: Creating nested functions with plpgsql - Mailing list pgsql-sql

From Jorge Godoy
Subject Re: Creating nested functions with plpgsql
Date
Msg-id 200605072046.05629.jgodoy@gmail.com
Whole thread Raw
In response to Re: Creating nested functions with plpgsql  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-sql
Em Domingo 07 Maio 2006 20:33, Alvaro Herrera escreveu:
>
> We don't support nested functions at present, but you can create a
> separate function and invoke it as you would call any external function.

Yeah, I know it and that's how I use some things today, but even so, having 
nested functions help to write some kinds of code.

> This is arguably better, because you may then use inner_function in any
> "outer function", not just the current one.

It depends.  There are cases where it is better -- at least for legibility -- 
to have nested functions.  Having a procedural approach is not always the 
best algorithm, but, as I said, it solves almost all problems.


Thanks,
-- 
Jorge Godoy      <jgodoy@gmail.com>



pgsql-sql by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Creating nested functions with plpgsql
Next
From: Peter Eisentraut
Date:
Subject: Re: Postgres 8.1 sequences and 'CALL'-syntax