[Pgpool-general] Test case for pgpool-regclass

Tatsuo Ishii ishii at sraoss.co.jp
Tue Apr 12 15:06:02 UTC 2011


> I just wanted to test the use of pgpool-regclass. I took the sources of 
> pgpool-II 3.0.3 and PG9.0. I did not install pgpool-regclass to check the 
> pgpoo-II's behaviour in case of missing pgpool-regclass.
> 
> Here, is what I did:
> 1. Created a table t1 in the public schema, and inserted some values in it.
> 2. Created a schema sch1 and created a table t1 in this schema, and inserted 
> some values in it.
> 
> Then, how I execute, 
> 
> psql -p 9999 -c "select * from schema1.table1"
> 
> I thought, without regclass, this should fallback to :
> psql -p 9999 -c "select * from table1"  
> 
> But NO, I get the values from the table present in schema1. That means, it is 
> working fine. 

No. pgpool_regclass does not affect user's SELECT itself.

If you are using pgpool-II in replication mode, you could check the
effect as follows:

create table schema1.table1(t timestamp default current_timestamp);
create table public.table1(t int default 100);
set search_path to schema1,public;
insert into table1 values(default);

If you install pgpool_regclass, your database nodes have exactly same
timestamp values because pgpool rewrite the query correctly.

On the other hand, if you do not install it, your database nodes have
different timestamp values because pgpool does not recognize that
table1 has timestamp column and needs to be written.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


More information about the Pgpool-general mailing list