Re: Postgres Equivalent of Oracle Package - Mailing list pgsql-general

From Mladen Gogala
Subject Re: Postgres Equivalent of Oracle Package
Date
Msg-id 87b2142e-276f-bf53-a8e0-f9a84aa9677d@gmail.com
Whole thread Raw
In response to Postgres Equivalent of Oracle Package  (DAVID ROTH <adaptron@comcast.net>)
List 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
onceper 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




pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: postgresql 9.6x installers for windows are no longer available
Next
From: Prathima Mulpuri
Date:
Subject: Re: Account privileges