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

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


pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Oracle Style packages on postgres
Next
From: Andrew - Supernews
Date:
Subject: Re: Views, views, views! (long)