Re: Oracle Style packages on postgres - Mailing list pgsql-hackers

From Thomas Hallgren
Subject Re: Oracle Style packages on postgres
Date
Msg-id thhal-0ZQlcAw+dyic5y5fSB5ODlILrQhM2lI@mailblocks.com
Whole thread Raw
In response to Re: Oracle Style packages on postgres  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
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.

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.

Regards,
Thomas Hallgren



pgsql-hackers by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: Case insensitive usernames
Next
From: Adrian Maier
Date:
Subject: Re: Oracle Style packages on postgres