Re: stored procedures (packages)

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "J(dot)V(dot) *EXTERN*" <jvsrvcs(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: stored procedures (packages)
Date: 2011-09-30 10:16:29
Message-ID: D960CB61B694CF459DCFB4B0128514C206F0842E@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

J.V. wrote:
> I need to run a series of stored procedures, what is the best way to
> organize and run.
>
> Ideally would like something like Oracle PL/SQL where I can put all
> methods in one file and create a main() method
>
> then just : select main() to have them all run.
>
> If there is a way to do this, please let me know.

Don't try to do PostgreSQL things the Oracle way.

To group functions that logically belong together, you can put them
into a separate schema.

You can grant users execute rights on only one of them if you like
(or rather, because by default PUBLIC has execute rights, revoke
that from all others).

> Also is it possible to call a stored function or procedure from
another
> stored proc/function?

Sure, use them in an SQL statement inside a function.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pietro Laranci 2011-09-30 10:17:51 Connection refused (0x0000274D/10061)
Previous Message Alban Hertroys 2011-09-30 10:05:22 Re: stored procs