Oracle Packages and Stored Procedures - PostgreSQL conversion

Started by Panneerselvam Posangualmost 13 years ago2 messagesgeneral
Jump to latest
#1Panneerselvam 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
1. PL/SQL PackagesIs it advisable to convert constituent stored procedures into PostgreSQL Functions and wrap them inside another function?
2. PL/SQL Stored ProceduresIs it advisable to convert stored procedures into PostgreSQL Functions?
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
Thanks in advance,Panneerselvam Posangu

#2Pavel Stehule
pavel.stehule@gmail.com
In reply to: Panneerselvam Posangu (#1)
Re: Oracle Packages and Stored Procedures - PostgreSQL conversion

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

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general