CREATE EXTENSION forces an library initialization - is it bug?

Started by Pavel Stehuleover 2 years ago3 messageshackers
Jump to latest
#1Pavel Stehule
pavel.stehule@gmail.com

Hi

I had to fix plpgsql_check issue
https://github.com/okbob/plpgsql_check/issues/155

The problem is in execution of _PG_init() in CREATE EXTENSION time.

It is a problem for any extension that uses plpgsql debug API, because it
is quietly activated.

Is it necessary?

Regards

Pavel

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Pavel Stehule (#1)
Re: CREATE EXTENSION forces an library initialization - is it bug?

Pavel Stehule <pavel.stehule@gmail.com> writes:

I had to fix plpgsql_check issue
https://github.com/okbob/plpgsql_check/issues/155

The problem is in execution of _PG_init() in CREATE EXTENSION time.

It is a problem for any extension that uses plpgsql debug API, because it
is quietly activated.

Is it necessary?

Yes, I think so. If the extension has any C functions, then when its
script executes those CREATE FUNCTION commands then the underlying
library will be loaded (so we can check that the library is loadable
and the functions really exist). That's always happened and I do not
think it is negotiable.

regards, tom lane

#3Pavel Stehule
pavel.stehule@gmail.com
In reply to: Tom Lane (#2)
Re: CREATE EXTENSION forces an library initialization - is it bug?

pá 29. 9. 2023 v 20:14 odesílatel Tom Lane <tgl@sss.pgh.pa.us> napsal:

Pavel Stehule <pavel.stehule@gmail.com> writes:

I had to fix plpgsql_check issue
https://github.com/okbob/plpgsql_check/issues/155

The problem is in execution of _PG_init() in CREATE EXTENSION time.

It is a problem for any extension that uses plpgsql debug API, because it
is quietly activated.

Is it necessary?

Yes, I think so. If the extension has any C functions, then when its
script executes those CREATE FUNCTION commands then the underlying
library will be loaded (so we can check that the library is loadable
and the functions really exist). That's always happened and I do not
think it is negotiable.

ok

thank you for info

Show quoted text

regards, tom lane