[Pgpool-general] How sqls in transaction handled with replicate_select disabled
Gary Fu
gfu at sigmaspace.com
Wed Jan 19 17:09:07 UTC 2011
On 01/18/11 19:56, Tatsuo Ishii wrote:
>> Sorry, now I understand fail over caused by the \d command problem is
>> due to the replicate_select is set. My question now is how to
>> replicate a select function (with insert/update) when replicate_select
>> is disabled. It looks like that we can use 'black_function_list'
>> mentioned in the manual. However, is there an option to apply for all
>> functions, instead of listing all of them under 'black_function_list',
>> just in case there are too many to be listed ? By the way, is there a
>> limit for 'black_function_list' ?
> You have two options:
>
> 1) Add all your functions to black_function_list you want to
> replicate. There's no limit for black_function_list.
>
> 2) Empty black_function_list and add a bogus function (for example
> "foo") to white_function_list. This will effectively replicate all
> function calls except "foo". Caution: this will cause an unwanted
> side effect: \d command will fail because replicated.
>
> BTW pgpool-II 3.1 will have an ability to use regular expression in
> black_function_list and white_function_list(Thanks to Gilles Darold
> and Guillaume Lela!). So if your project decide to name the functions
> starting with "my_function_" for example, you could put something like
> "^my_function_.*$" to indicate that all functions starting with
> "my_function_" should be treated as they are writing.
> --
Tatsuo,
Thanks for the helpful information. I have another question that I
cannot figure out from the online manual. How the following transaction
sqls to be handled when the replicate_select is false and the
replicate_mode is true. Are they all replicated or handled differently ?
Case 1:
begin;
select sql;
insert sql;
commit;
Case 2:
begin;
insert sql;
select sql;
commit;
Thanks,
Gary
More information about the Pgpool-general
mailing list