Re: Oracle Style packages on postgres

From: Thomas Hallgren <thhal(at)mailblocks(dot)com>
To: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
Cc: josh(at)agliodbs(dot)com, rmm(at)sqlisor(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Oracle Style packages on postgres
Date: 2005-05-10 19:19:49
Message-ID: thhal-02KFcA52kyicjvodABWUq7K94+GDTR8@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-05-10 19:58:50 Re: Views, views, views! (long)
Previous Message Tom Lane 2005-05-10 19:01:35 Re: Table Partitioning, Part 1