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 1my39E-0000yi-Nc for pgsql-general@arkaria.postgresql.org; Fri, 17 Dec 2021 02:39:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1my39D-0001e3-Ku for pgsql-general@arkaria.postgresql.org; Fri, 17 Dec 2021 02:39:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1my39D-0001du-8q for pgsql-general@lists.postgresql.org; Fri, 17 Dec 2021 02:39:03 +0000 Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1my39A-00012V-Cx for pgsql-general@lists.postgresql.org; Fri, 17 Dec 2021 02:39:02 +0000 Received: by mail-qv1-xf35.google.com with SMTP id p3so1086306qvj.9 for ; Thu, 16 Dec 2021 18:39:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=Yzh76ggVY1icNugGMQaXv+vr5I4swo+xZNeTNv4evt4=; b=OevdDyR+YO95tosZhsN+qTCz1JLrvzMhGqOCBCP7BxgSFsJrchUTyPuhxLaYV63asi jaLmqsTq1R5WfzPvFO5xpHMHpQPWx5Xs5OSMQqlohqYmHnuUMKHThXVk/hAvILP8pLRa 6hrQ8QoeczvKRBv0pf0Fk7HRLVr/0PvX0zwRq02HY9drvXwDwGd4F2h6VQs2aUbPBwMV IrN20f81T1wtg95Y2lfFuI40qeCNbZlWzT/c4TnaiPkiwLhYkkiPC+M7Jr+UF9VYZJ9F S1DtUn4h3RqAszAEg3x84Jx9w/G4dOBfrljzJ4BpCjZEV6mE9whO4lUZky4rnJWeR4ow F5hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=Yzh76ggVY1icNugGMQaXv+vr5I4swo+xZNeTNv4evt4=; b=3tqn9vB0JXgMX6iOa84lHTNZ6nBKA9UA/C0EG32/QbZByp6lbuof/TNehdDVbuslyH lfT/BOVvlKx0h2iKG8BIKYNqIx5APOxX7a9NUBiEBoqm1b0wdYowj8ZwetRENvxLRyR2 dVp+bRRQLAFDmuAfScBCwp8WoBh6hw1FKWThzic4jD2UVfcJOiHTYh/g1Hm4dKwKbM2t Y0ZIC9rICCm1KeBIqKxG0Wm0LHJI6L5/lDQ1tL6dzVa269PVHKI2iGnauhBRWhHh0j+L D+vYIj0fhbgOT8gPfveO0ocU/SdnvcmAuGyhhlTyOUXKRxfeWU/24vnUnePnlnT4Mh3x YZAQ== X-Gm-Message-State: AOAM533mLlA1exEcp6LY4sud/UzYcZkLXLYYU9SwwDVp57wRSXx8jZS9 CdCptJFgO3vZ6pDTRzy1DKpH/THW50/q+g== X-Google-Smtp-Source: ABdhPJzdBe1UaFxoL+GLNK7P7DynC3FKLJdc4FC/4XGW+VI629iFvWxSqQue5+b/r69rRHhvCauWRw== X-Received: by 2002:ad4:5aaa:: with SMTP id u10mr932986qvg.51.1639708737188; Thu, 16 Dec 2021 18:38:57 -0800 (PST) Received: from [192.168.2.100] (pool-72-79-19-93.nwrknj.east.verizon.net. [72.79.19.93]) by smtp.gmail.com with ESMTPSA id bq43sm3970116qkb.32.2021.12.16.18.38.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Dec 2021 18:38:56 -0800 (PST) Message-ID: Date: Thu, 16 Dec 2021 21:38:55 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL Content-Language: en-US To: pgsql-general@lists.postgresql.org References: <48A5C07D-6A66-4B96-A48C-75C530CB9DCF@yugabyte.com> From: Mladen Gogala In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/16/21 16:48, Pavel Stehule wrote: > I don't think Postgres needs packages - this is a redundant concept in > Postgres, when Postgres has schemas (different from Oracle's schemas) > and extensions. > Yes, ORAFCE uses schemas as the package names. However, one very practical thing is missing: session variables. Yes, you can emulate those with ON COMMIT PRESERVE ROWS temporary tables, but that's a rather ugly hack. On the other hand, packages can easily be emulated by using Python. Having packages would make PLPg/SQL programming much prettier. It would be much prettier to group related routines into a package than to have them laying around without anything indicating that the routines are related. On the plus side, packages would make it much easier to migrate from Oracle to Postgres. And you do want that, don't you? I am very well aware of the animosity toward the Oracle community and the reasons for that animosity. Oracle wiped the floor with the predecessor of Postgres, the database called "Ingres". Sandra Kurtzig, the Ingres CEO at the the time, and Michael Stonebraker were both involved in very public spat with Larry Ellison. Stonebraker is still very much a factor in Postgres community and I doubt that his feelings toward the Larry and his company have got any warmer with years. Postgres was created with the idea of fighting the Dark Lord in the land of Belmont, CA. However, if it is the goal of the community to have users convert from Oracle to Postgres, than making that conversion easy would be conducive to that goal.  A long time ago a former pastry baker wrote the following article: https://www.toolbox.com/tech/data-management/blogs/why-postgresql-doesnt-have-query-hints-020411/ Disclosure: I am the Oracle DBA that Josh Berkus is talking about in that article. Recent events with "advice" to a very well known Oracle personality testify to the fact that the emotions haven't changed much since that article was written. Of course, Oracle is still the most popular database in the world. -- Mladen Gogala Database Consultant Tel: (347) 321-1217 https://dbwhisperer.wordpress.com