Re: Postgres Equivalent of Oracle Package

From: Mladen Gogala <gogala(dot)mladen(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Postgres Equivalent of Oracle Package
Date: 2021-11-18 03:45:40
Message-ID: 87b2142e-276f-bf53-a8e0-f9a84aa9677d@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 11/16/21 12:23, DAVID ROTH wrote:
> One of the nice things about Oracle packages is that the code is loaded and global values are set and stored only once per session. This is very useful for values that are used repeatedly.
>
> What is the best way of emulating this behavior in Postgresql?
>
>

You can create a temporary table with "ON COMMIT PRESERVE ROWS", which
is visible in a session and cannot cross the session boundary.  Values
in the table can be queried throughout the session. That is a pretty
good approximation of the session variables in Oracle.

--
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Prathima Mulpuri 2021-11-18 04:30:03 Re: Account privileges
Previous Message Adrian Klaver 2021-11-17 21:19:50 Re: postgresql 9.6x installers for windows are no longer available