Re: Oracle Style packages on postgres

From: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
To: Thomas Hallgren <thhal(at)mailblocks(dot)com>
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 17:55:00
Message-ID: 20050510175500.GI31103@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 09, 2005 at 11:24:45PM +0200, Thomas Hallgren wrote:
> In Oracle you can use the syntax:
>
> <schema>.<package>.<function>()
>
> but you can just as well use the syntax:
>
> <schema>.<type>.<static method>()
>
> Why do you need both? If PostgreSQL is going to add new nice features
> that enables better namespace handling and global variables, take a look
> at Oracles UDT's with static and instance methods. Only thing that I'm
> not sure is there is static variables. If it's missing, we could add
> that easilly and give them the same life-span as the session.

It's been a while since I used types, but here's some issues I can think
of:

I don't believe types allow for internal-only methods. I seem to recall
other limitations on what types could do as opposed to packages. Of
course, we need not restrict ourselves in such a manner.

Types are not used nearly as much as packages (this is an issue if we
care about enabling Oracle users to migrate).

Types generally force you to use them in relation to some database
object. Packages have no such restriction.

Don't get me wrong, I think supporting more powerful types would be a
welcome addition, but I don't think they can be as flexable as packages.
The good news is that they should both be able to use the same
underlying framework. Types are afterall just a specialized
implementation of packages.
--
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?"

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew - Supernews 2005-05-10 18:00:36 Re: Views, views, views! (long)
Previous Message Jim C. Nasby 2005-05-10 17:45:47 Re: Oracle Style packages on postgres