From: | "Jim C(dot) Nasby" <decibel(at)decibel(dot)org> |
---|---|
To: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | josh(at)agliodbs(dot)com, 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 18:07:01 |
Message-ID: | 20050510180701.GJ31103@decibel.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, May 09, 2005 at 09:56:53PM -0400, Bruce Momjian wrote:
> 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?
>
> Is that it?
I think a big part of the usefulness of packages is in supplying an
additional level of grouping common things together. Of course, nested
schemas with public/private functions (and procedures, lest we forget
them) is a much better way to do this, since a schema can encompass
everything you'd need; tables, views, types, etc.
Having said that, I would say that private variables need to be exposed
via the same nested schema interface as everything else. If the
implementation under the covers is via the temporary schema, that's
fine.
As for using temporary tables as session storage, that has a huge
performance penalty associated with it. Part of the advantage to package
variables is that you can use them to cache information your code will
need to access frequently. That access then becomes a simple variable or
array read, which is obviously much faster than parsing a query to hit a
temp table.
There is one feature not mentioned by Bruce's design, and that's
initialization (and teardown) code. I don't recall using that capability
in Oracle, but I was wondering if others with more experience could
comment on it.
--
Jim C. Nasby, Database Consultant decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828
Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"
From | Date | Subject | |
---|---|---|---|
Next Message | Heikki Linnakangas | 2005-05-10 18:24:30 | Re: Please clarify |
Previous Message | Andrew - Supernews | 2005-05-10 18:00:36 | Re: Views, views, views! (long) |