Re: Oracle Packages and Stored Procedures - PostgreSQL conversion

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Panneerselvam Posangu <panneerpps(at)hotmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Oracle Packages and Stored Procedures - PostgreSQL conversion
Date: 2013-06-11 06:35:05
Message-ID: CAFj8pRCsda=3DKiFmq2jbcAi3+3eMnFVNDTyhFYh10_p6T23dg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

2013/6/11 Panneerselvam Posangu <panneerpps(at)hotmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Toby Corkindale 2013-06-11 06:58:13 Re: PSA: If you are running Precise/12.04 upgrade your kernel.
Previous Message Panneerselvam Posangu 2013-06-11 05:41:06 Oracle Packages and Stored Procedures - PostgreSQL conversion