Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3fGo-0003az-OF for pgsql-admin@arkaria.postgresql.org; Thu, 06 Aug 2020 12:45:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k3fGH-00059l-F5 for pgsql-admin@arkaria.postgresql.org; Thu, 06 Aug 2020 12:44:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3fDC-00010s-Du for pgsql-admin@lists.postgresql.org; Thu, 06 Aug 2020 12:41:34 +0000 Received: from jakobs.com ([85.214.83.89] helo=rs.plausibolo.de) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3fD9-0000X6-DX for pgsql-admin@lists.postgresql.org; Thu, 06 Aug 2020 12:41:33 +0000 Received: from localhost (localhost [127.0.0.1]) by rs.plausibolo.de (Postfix) with ESMTP id CF3EE3804A7; Thu, 6 Aug 2020 14:41:28 +0200 (CEST) Received: from rs.plausibolo.de ([127.0.0.1]) by localhost (h2367442.stratoserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mGKu8KG4f3yI; Thu, 6 Aug 2020 14:41:28 +0200 (CEST) Received: from [192.168.178.91] (i577BCF80.versanet.de [87.123.207.128]) by rs.plausibolo.de (Postfix) with ESMTPSA id 96CAF380497; Thu, 6 Aug 2020 14:41:28 +0200 (CEST) Subject: Re: Oracle Package equivalent in Postgres To: pgsql-admin@lists.postgresql.org References: From: Holger Jakobs Message-ID: <807c8d86-ac4e-796e-f821-4a88279df6d3@jakobs.com> Date: Thu, 6 Aug 2020 14:41:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: de-DE List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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-variable-in-pl-pgsql/165372#165372 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