Re: plpgsql functions organisation - Mailing list pgsql-general

From Melvin Davidson
Subject Re: plpgsql functions organisation
Date
Msg-id CANu8FiwyQosHaP42D9Chv1--H-D1afJOnahK5s21=iAyM6mApw@mail.gmail.com
Whole thread Raw
In response to plpgsql functions organisation  (Yves Dorfsman <yves@zioup.com>)
Responses Re: plpgsql functions organisation
Re: plpgsql functions organisation
List pgsql-general
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.

Also note that PostgreSQL allows you define functions using Python, so that might be a possible compromise.

On Sat, May 2, 2015 at 12:53 PM, Yves Dorfsman <yves@zioup.com> wrote:

I find my plpgsql functions becomes unreadable very quickly. I want to break
them up in smaller functions.

What is the best way to organised them?
Is there any way to define functions inside functions?
When I list functions in psql, I can see them all at the same level, is there
any way to organise them in packages like with python and other languages, so
the smaller functions are hidden away in a package/directory?


Thanks.

--
http://yves.zioup.com
gpg: 4096R/32B0F416



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

pgsql-general by date:

Previous
From: Yves Dorfsman
Date:
Subject: plpgsql functions organisation
Next
From: "Daniel Verite"
Date:
Subject: Re: How to exclude blobs (large objects) from being loaded by pg_restore?