Re: Oracle Packages and Stored Procedures - PostgreSQL conversion - Mailing list pgsql-general

From Pavel Stehule
Subject Re: Oracle Packages and Stored Procedures - PostgreSQL conversion
Date
Msg-id CAFj8pRCsda=3DKiFmq2jbcAi3+3eMnFVNDTyhFYh10_p6T23dg@mail.gmail.com
Whole thread Raw
In response to Oracle Packages and Stored Procedures - PostgreSQL conversion  (Panneerselvam Posangu <panneerpps@hotmail.com>)
List pgsql-general
Hello

2013/6/11 Panneerselvam Posangu <panneerpps@hotmail.com>:
> Hi,
>
> I have some Oracle Packages and some standalone procedure in Oracle schema.
> As we are converting our application as PostgreSQL compliant we are looking
> at these Oracle objects. These packages have no variables declared and
> consist of a few stored procedures. Please suggest a good approach to
> convert them into PosgreSQL compliant objects

If you don't use a global objects, then you can use a schema instead package

look to orafce as example this technique

https://github.com/orafce/orafce

>
> 1. PL/SQL Packages
> Is it advisable to convert constituent stored procedures into PostgreSQL
> Functions and wrap them inside another function?
>
> 2. PL/SQL Stored Procedures
> Is it advisable to convert stored procedures into PostgreSQL Functions?

There are no more possibilities. Depends on what you do, but usually
almost code is portable to PostgreSQL. Some parts should be rewritten
- for example Pg has different design of custom aggregates, there are
no collections (use arrays instead) or autonomous transactions, ...
but almost all functionality is available.

>
> I am quite new to PostgreSQL; hence seeking some help from larger group of
> experts. Currently I try to understand the suggestions from 9.2.4
> documentation here:
> http://www.postgresql.org/docs/9.2/static/plpgsql-porting.html
>

read well documentation first, look on http://postgres.cz/wiki/PL/pgSQL_%28en%29

and be creative :)

Regards

Pavel Stehule

> Thanks in advance,
> Panneerselvam Posangu


pgsql-general by date:

Previous
From: Raghavendra
Date:
Subject: Re: updatable view
Next
From: Toby Corkindale
Date:
Subject: Re: PSA: If you are running Precise/12.04 upgrade your kernel.