[pgpool-general: 8971] Re: Can we define a function func_set_search_path so that select func_set_search_path will execute to both primary and secondary nodes ?

Tatsuo Ishii ishii at sraoss.co.jp
Wed Nov 15 13:02:08 JST 2023


> Thank you
> 
> the point of my set_search_path function is to be dynamic, it depends
> on current_user, I cannot declare this as immutable, and I don't want
> this to be cached by pgpool (I have caching enabled).

Ok, you want to avoid caching.

> I am wondering :
> 
> a) How easy it could be to implement a new feature in pgpool to
> declare functions that will have to be routed in both primary and
> replica (POOL_BOTH in src/context/pool_query_context.c ).

The implementation will not be that hard. Question is, what is the UI
for the feature (how is like new parameter or parameter changes in
pgpool.conf).

> b) if there was a mechanism in postgresql that a SET foo_guc_var="val"
> would result in calling a function.

I haven't tried myself, but I think you can do that by using
"customized options".
https://www.postgresql.org/docs/current/runtime-config-custom.html. It
allows to define "hook" that are called when the custom option is set
(and on other occasions).

Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp


More information about the pgpool-general mailing list