From 74f51b9437c89b42e63698d735b4d9a2c67edf8d Mon Sep 17 00:00:00 2001 From: Japin Li Date: Fri, 6 Jun 2025 12:09:00 +0800 Subject: [PATCH 1/2] Fix session_preload_libraries documentation for non-superusers Remove the documentation about suggesting non-superusers can set session_preload_libraries. This is incorrect as it triggers a "permission denied" error, as confirmed by PostgreSQL documentation stating only superusers or those with SET privilege can modify this setting [1]. [1]: https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-SESSION-PRELOAD-LIBRARIES --- README.md | 12 ------------ pgtt.md | 12 ------------ 2 files changed, 24 deletions(-) diff --git a/README.md b/README.md index 9ceefa3..2e30a19 100755 --- a/README.md +++ b/README.md @@ -166,18 +166,6 @@ or by setting it at database level as follow: $$; -non-superuser must load the library using the plugins/ directory -as follow: - - DO $$ - BEGIN - EXECUTE format('ALTER DATABASE %I SET session_preload_libraries = ''$libdir/plugins/pgtt''', current_database()); - END - $$; - -Take care to follow installation instruction above to create the -symlink from the plugins/ directory to the extension library file. - The pgtt extension use a dedicated schema to store related objects, by default: `pgtt_schema`. The extension take care that this schema is always at end of the `search_path`. diff --git a/pgtt.md b/pgtt.md index 9ceefa3..2e30a19 100755 --- a/pgtt.md +++ b/pgtt.md @@ -166,18 +166,6 @@ or by setting it at database level as follow: $$; -non-superuser must load the library using the plugins/ directory -as follow: - - DO $$ - BEGIN - EXECUTE format('ALTER DATABASE %I SET session_preload_libraries = ''$libdir/plugins/pgtt''', current_database()); - END - $$; - -Take care to follow installation instruction above to create the -symlink from the plugins/ directory to the extension library file. - The pgtt extension use a dedicated schema to store related objects, by default: `pgtt_schema`. The extension take care that this schema is always at end of the `search_path`. From 4dbf8794e08618286d523f826226450fe86a7d50 Mon Sep 17 00:00:00 2001 From: Li Jianping Date: Fri, 6 Jun 2025 13:32:50 +0800 Subject: [PATCH 2/2] Remove the LOAD command from documentation As noted in commit ef79a912, explicit loading is redundant when a library is managed by session_preload_libraries. --- README.md | 2 -- pgtt.md | 2 -- 2 files changed, 4 deletions(-) diff --git a/README.md b/README.md index 2e30a19..f313133 100755 --- a/README.md +++ b/README.md @@ -170,8 +170,6 @@ The pgtt extension use a dedicated schema to store related objects, by default: `pgtt_schema`. The extension take care that this schema is always at end of the `search_path`. - gtt_testdb=# LOAD '$libdir/plugins/pgtt'; - LOAD gtt_testdb=# SHOW search_path; search_path -------------------- diff --git a/pgtt.md b/pgtt.md index 2e30a19..f313133 100755 --- a/pgtt.md +++ b/pgtt.md @@ -170,8 +170,6 @@ The pgtt extension use a dedicated schema to store related objects, by default: `pgtt_schema`. The extension take care that this schema is always at end of the `search_path`. - gtt_testdb=# LOAD '$libdir/plugins/pgtt'; - LOAD gtt_testdb=# SHOW search_path; search_path --------------------