Re: plpgsql functions organisation - Mailing list pgsql-general

From Adrian Klaver
Subject Re: plpgsql functions organisation
Date
Msg-id 55454A60.50502@aklaver.com
Whole thread Raw
In response to Re: plpgsql functions organisation  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: plpgsql functions organisation
List pgsql-general
On 05/02/2015 02:07 PM, Jeff Janes wrote:
> On Sat, May 2, 2015 at 1:05 PM, Adrian Klaver <adrian.klaver@aklaver.com
> <mailto:adrian.klaver@aklaver.com>> wrote:
>
>     On 05/02/2015 10:12 AM, Melvin Davidson wrote:
>
>         AFAIK, you cannot "package" functions in  PostgreSQL, but it is
>         possible to
>         call a function from within a function.
>
>         That being said, I would seriously look at how and why you are
>         writing
>         your functions
>         as functions that call other functions are not very efficient.
>
>
>     I am not following. That is what packaging is about, separating out
>     'units of work' so they can be combined as needed. Part of that is
>     using existing functions in new functions/classes. In fact in the
>     Postgres source I see this in many places. Now it is entirely
>     possible I missed a memo, so I am open to a more detailed
>     explanation of the inefficiencies involved.
>
>
> The Postgres source is written in C, not in plpgsql.  C has a good
> optimizing compiler and plpgsql doesn't.

Does this actually matter?  I am a biologist that backed into computing,
so I realize I am weak on the fundamentals. Still the scientist in me
wants data backing assertions. As I understand it plpgsql works close to
the server and is optimized to do so.  I know writing in C would be a
better solution. Still is calling plpgsql functions inside plpgsql
really a bad thing when just considering plpgsql?



> Cheers,
>
> Jeff


--
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Bill Moran
Date:
Subject: Re: plpgsql functions organisation
Next
From: Melvin Davidson
Date:
Subject: Re: plpgsql functions organisation