pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Oracle Package equivalent in Postgres
Date: Thu, 6 Aug 2020 14:41:27 +0200
Message-ID: <807c8d86-ac4e-796e-f821-4a88279df6d3@jakobs.com> (raw)
In-Reply-To: <CAK_Ha4wFrkYcwGV=t3axcUXFmOOCOC1K2bUvcKRZXFCxtR136A@mail.gmail.com>
References: <CAK_Ha4wFrkYcwGV=t3axcUXFmOOCOC1K2bUvcKRZXFCxtR136A@mail.gmail.com>

Hi,

It depends on what you want to achieve with using packages.

If you just want to group a number of functions and procedures, just
create a schema for it (schemas are totally unrelated to users in
PostgreSQL), e. g.
CREATE SCHEMA functions;
and then
CREATE FUNCTION functions.f1 (integer) RETURNS integer LANGUAGE plgpsql
AS $$
...
$$;

Unfortunately, there are no schema related variables. You will have to
resort to saving values in some (temporary, unlogged, normal) table.

There is another way of using a setting as a variable described here:
https://dba.stackexchange.com/questions/165361/assign-the-result-of-current-settingthe-setting-to-a-...

Regards,

Holger


Am 06.08.20 um 14:22 schrieb Firthouse banu:
> Hi Postgres master minds, 
>
> Am currently working on migrating databases from  oracle to Postgres. 
> Am going to work on crons and packages in oracle which needs to be
> converted in Postgres. How to convert package in oracle to Postgres.
> Is there any equivalent in Postgres if not how it works in Postgres. 
>
> Eagerly  waiting for replies. 
>
> Thanks 
>
-- 
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012






view thread (4+ messages)  latest in thread

Message-ID: <807c8d86-ac4e-796e-f821-4a88279df6d3@jakobs.com>
Permalink:  ../807c8d86-ac4e-796e-f821-4a88279df6d3@jakobs.com/
Also on:    postgresql.org/message-id/807c8d86-ac4e-796e-f821-4a88279df6d3@jakobs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: holger@jakobs.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Oracle Package equivalent in Postgres
  In-Reply-To: <807c8d86-ac4e-796e-f821-4a88279df6d3@jakobs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox