Re: postgresql referencing and creating types as record

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: vpmm2007 <vaishalim2007(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: postgresql referencing and creating types as record
Date: 2014-08-09 14:25:30
Message-ID: 53E62F5A.8090501@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 08/07/2014 09:50 PM, vpmm2007 wrote:
> create or replace package CUM_A_TYPES
> as
> type LT_PAYMENT is record
> (BASIC number,
> DP number,
> GRADE_PAY number
> );
> TYPE TYPE_CALC_TAX is record
> (
> FIN_ROLE_ID number(8),
> CALC_FOR_ROLE_CODE number(4));
>
> NEED TO CONVERT THIS TO POSTGRES , ANYBODY PLS HELP ME I M NEW TO POSTGRES

There is no CREATE PACKAGE in the community version of Postgres.

The pay version of EnterpriseDB does have it:

http://www.enterprisedb.com/docs/en/9.3/oracompat/Postgres_Plus_Advanced_Server_Oracle_Compatibility_Guide-30.htm#P2593_148612

For an idea of the other Oracle features it has, see here:

http://www.enterprisedb.com/docs/en/9.3/oracompat/Table%20of%20Contents.htm#TopOfPage

If you do not want to use the above, then you will have to go another
route. What that is, will depend on what you are trying to achieve. From
a cursory look at packages, they are a defined grouping of objects
stored as such in the database. The nearest solution I can come up at
the moment is to store the object creation statements in an external
script and run that against the database. This does leave you in charge
of handling changes to the objects. So some sort of version control
would be helpful. Some examples:

Sqitch

http://sqitch.org/

Alembic

http://alembic.readthedocs.org/en/latest/

> THX&RGDS
> VPMM

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2014-08-09 16:46:25 Re: Duplicated IDs
Previous Message Alexis Bernard 2014-08-09 11:24:27 Re: Duplicated IDs