Re: Oracle Style packages on postgres

Thomas Hallgren <thhal@mailblocks.com>

From: Thomas Hallgren <thhal@mailblocks.com>
To: "Jim C. Nasby" <decibel@decibel.org>
Cc: josh@agliodbs.com, rmm@sqlisor.com, pgsql-hackers@postgresql.org
Date: 2005-05-10T19:19:49Z
Lists: pgsql-hackers
Jim C. Nasby wrote:

>I guess maybe I'm not clear on what you mean by static methods. IIRC, in
>Oracle nomenclature, static means it will retain state between
>invocations in the same session. Of course, functions and procedures
>that don't do this are also allowed.
>  
>
A STATIC prefix on a method simply means that it is not tied to a 
particular instance of the type where it is defined.

You have the type Foo with the method bar(). If the method is STATIC, 
you can use:

SELECT Foo.bar();

If it's an INSTANCE method, you can only call it when you have an 
instance available, so if FooTable is a table described by the type Foo 
and bar is non-static, you could write:

SELECT x.bar() FROM FooTable x;

>I think both should allow for private functions/procedures/methods. BTW,
>I'm also very keen on the idea of nested schemas, which is another
>possible means to the package ends.
>  
>
I'd like that too although I don't think it's included in the SQL-standard.

Regards,
Thomas Hallgren