Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pg_stat_statements and preloading extensions #189

Open
samwillis opened this issue Aug 13, 2024 · 3 comments · May be fixed by #415
Open

pg_stat_statements and preloading extensions #189

samwillis opened this issue Aug 13, 2024 · 3 comments · May be fixed by #415
Labels
bug Something isn't working

Comments

@samwillis
Copy link
Collaborator

pg_stat_statements Is currently built but we don't yet have a way to preload it. There are a few extensions that needed this facility and this is a very popular one.

https://www.postgresql.org/docs/current/pgstatstatements.html

The module must be loaded by adding pg_stat_statements to shared_preload_libraries in postgresql.conf, because it requires additional shared memory.

@pmp-p
Copy link
Collaborator

pmp-p commented Oct 2, 2024

maybe we could add pg_stat_statements to GUC shared_preload_libraries_string global variable and manually call process_shared_preload_libraries right after wasm compilation. But PGlite options extensions should allow to specify the extension need to be added ( or maybe we can detect that when parsing imported symbol and make a hitlist ).

@pmp-p pmp-p added the bug Something isn't working label Oct 2, 2024
@pmp-p
Copy link
Collaborator

pmp-p commented Nov 1, 2024

after reflexion, we are always preloading all plugin shared lib, pg core just doesn't know it. so we just have to tell it by setting process_shared_preload_libraries_in_progress to true while wasm compilation of plugins

edit/ but PG_init constructor is not called at that time, and some extensions don't want to be pg_init that early

pmp-p added a commit that referenced this issue Nov 1, 2024
should close #189
and have no impact on other extensions
@pmp-p
Copy link
Collaborator

pmp-p commented Nov 1, 2024

shared_preload_libraries it must be set in the .conf right after initdb or shared_preload_libraries_string string will be blanked by guc tables init.

libraries will be processed whatever mode we start https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=6c31ac091f31171601ee00972e131d8683e7b828

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants