When converting package from Oracle to Postgresql, I realize that AWS Schema Conversion Tool(aws sct) always create a function with the suffix '$init' from any package with PRAGMA SERIALLY_REUSABLE. In the newly created function, there are 3 methods 'aws_oracle_ext.is_package_initialized', 'aws_oracle_ext.set_package_initialized', 'aws_oracle_ext.set_package_variable'. Can anyone advise me the purpose of these 3 methods? Thanks.
Asked
Active
Viewed 513 times
0
-
While I have worked with both Oracle and Postgres I've been fortunate to not have a conversion. But I'll take a stab. An Oracle package has a couple concepts that Postgres just **does NOT have**. One of these is a section of code that is **automatically executed once** the first time the package is accessed (per session). This code is not in a contained procedure/function in the package. It seems the ...package_initialized functions attempt to emulate that. – Belayer Dec 14 '20 at 01:03
-
Another is shared variables and variable value retention. You can declare variables outside on any function/procedure that any function/procedure within the package can access (but nothing outside the package can access). Further these variables retain their values across inter-package calls. Seems the ...package_variable routines attempt to emulate these. If you can find a very small package post the package and the generated conversion I'll take a look (won't be immediate) and see if anything else jumps out. – Belayer Dec 14 '20 at 01:04
1 Answers
0
You can download those extension schema from Awa schema conversation tool..
Just right click on target schema there you will get option for apply extension pack.

Nikhil Kurkure
- 67
- 4