[pgpool-general: 8973] 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
Fri Nov 17 09:46:01 JST 2023


>>> 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).
> 
> Would something like : primary_and_standby_routing_query_pattern_list
> or both_routing_query_pattern_list make sense ?

Yes, that's an idea. Another idea is, inventing something like
"both_routing_function_list", but this limits the key for routing to
only functions. On the other hand, it's easier for users to write an
entry because he/she just writes function name on it. The
query_pattern_list requires to write a regular expression.

>>> 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).
> Thank you, writing an extension seems more involved, IMHO the straight
> forward solution you commented above sounds more correct!

Yeah, creating your own customized option needs more codes.

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