Re: Oracle Style packages on postgres

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Thomas Hallgren <thhal(at)mailblocks(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, rmm(at)sqlisor(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Oracle Style packages on postgres
Date: 2005-05-10 13:43:15
Message-ID: 200505101343.j4ADhFV19855@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas Hallgren wrote:
> Bruce Momjian wrote:
> > Josh Berkus wrote:
> >
> >>I think that private variables and private functions need to be part of the
> >>definition.
> >
> >
> > OK, so it seems we need:
> >
> > C static/private functions for schemas
> > C static/private variables for schemas
> >
> > Are private variables implemented via the temporary per-session schema?
> >
> > nested schemas
> >
> > What does the standard say?
> >
> The standard says that rather then using nested schemas or packages in
> conjunction with functions in order to group functions with data, use
> user defined types with attributes and methods. Methods can be STATIC,
> INSTANCE or CONSTRUCTOR.

So it sounds like you group the functions into user-defined types,
rather than nested schemas. So you assocate functions with a table?

> AFAICS there's nothing in the standard that alters the visibility of
> methods and attributes, so "private" is not covered (and don't recall
> that Oracle has that kind of visibility control either). Normal access
> restrictions apply of course.
>
> I can't find any mention of schema variables. I think all life-cycle
> management of data is reduced to table storage. And why not? A temporary
> table can be viewed as session data right?
>
> Using a KISS approach, the easiest thing to do that also would bring us
> closer to the standard, is to extend the notion of user defined types to
> include methods and conclude that storing session data in other ways
> than using temporary tables should be PL specific.

I suppose. I think we should focus on the use cases for Oracle
packages, rather than the specific functionality it provides. What
things do people need PostgreSQL to do that it already doesn't do?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2005-05-10 13:44:04 Re: Table Partitioning, Part 1
Previous Message Hannu Krosing 2005-05-10 13:31:55 Re: Table Partitioning, Part 1