Welcome to the pg_packages Free package implementation Project Home Page
Free and complete alternative to Oracle-like package implementation for PostgreSQL, including persistent variables, procedure and function logical wrapping, package declaration, optional initialization, overloading and easy pl/pgsql administration.
The pg_packages Free package implementationproject is a PostgreSQL Community project that is a part of the pgFoundry.
The pgFoundry page for the project is at http://pgfoundry.org/projects/pgpackages,
where you can find downloads, documentation, bug reports, mailing lists, and a whole lot more.
Overview
- What is a package?
- A package is a group of procedures, functions, variables definitions, SQL statements and initialization routines
created as a single unit in a special schema.
- How does a package look like?
- A package has two parts, a Package Definition or Header, which contains global variable definitions, procedures and
functions specifications, and a Package Body, which contains the actual implementation of the programs.
- Advantages of packages
-
- Modularity. Stores related objects together, which eases development.
- API separation. You can define and compile the Package Definition alone, and later compile the Body.
- Defined visibility. Types, variables and subprograms can be defined either private or public.
- Naming consistency. You don't have to worry about programs names because they are related just to the package which created them.
- Functionality. You can have session global variables that are persistent through sucesive calls.
Project scope
Initially pg_packages implementation will be made entirely in Pl/pgSQL. When the solution
proves to be robust enough, a patch to the Postgresql source will be submitted to include the
corresponding syntax and grammar.
Tentative Roadmap
- Creation of underlying database objects to support pg_packages implementation
- Definition of global schema and related tables
- Define global procedures and functions to create, modify and access packages
- Create first self-contained prototype
- Testing
- Syntax creation proposal. Postgresql source code patching.
- Extension to other languages (Perl, Python, Java)
Disclaimer
Although pg_packages is conceived as an alternative to Oracle packages, there is no intention to
break the general Postgresql syntax. However, a considerable effort will be put to make the transition
as seamless as possible, specially on package creation.