RE: Oracle Packages vs PostgreSQL

  • From: Stéphane Faroult <sfaroult@xxxxxxxxxxxx>
  • To: jd@xxxxxxxxxxxxxxxxx
  • Date: Fri, 13 Jan 2017 13:05:10 +0100

Josh,

You can somehow get around the namespace and privilege benefits of Oracle packages by creating in PostgreSQL your functions in schemas (schemata for you grammar nazis) that bear the names that the packages would. Encapsulation, while desirable, is something that one can probably live without. As Mladen pointed out, package variables (which are in practice session variables) are one of the big benefits of packages; and package initialization, which usually initializes those variables, often through queries, is something that I don't see how to replicate (you could try to have session variables by using a temporary table, but of course the word "ugly" springs to mind).

HTH,

Stéphane Faroult
--
//www.freelists.org/webpage/oracle-l


Other related posts: