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

From Thomas Hallgren
Subject Re: Oracle Style packages on postgres
Date
Msg-id thhal-02KFcA52kyicjvodABWUq7K94+GDTR8@mailblocks.com
Whole thread Raw
In response to Re: Oracle Style packages on postgres  ("Jim C. Nasby" <decibel@decibel.org>)
List 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




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Table Partitioning, Part 1
Next
From: Tom Lane
Date:
Subject: Re: Views, views, views! (long)