python-postgres / be

pg-python: Execute Python 3 code from PostgreSQL functions.
Other
5 stars 2 forks source link

preloading does not pickup proconfig #14

Closed jwp closed 14 years ago

jwp commented 14 years ago

Security definer and proconfig using functions are executed via an overloaded fmgrinfo function pointer. Preloading needs to find a way to go through the handler.

Specifically, the high-level load_module() interface will need to go the "long way" to get the exact execution context for proper preloading.

Current plan: almost execute the function as normal, but with -1 args to indicate initial load only.

jwp commented 14 years ago

Some progress last night. Function.load_module() now jumps through the pl_handler in order to load a module. This allows the proper context to exist while the module is being loaded. Uses fcinfo->nargs == -1 to make the distinction between module loads and regular function calls.

jwp commented 14 years ago

826b21ab460d202ea22e6dcf96f78e30a88b24ea