From: Hitoshi H. <hem...@la...> - 2012-11-13 07:46:09
|
Hi, list ============================================================================ POSTGRES-XC BUG REPORT TEMPLATE ============================================================================ Your name : Hitoshi Hemmi Your email address : hem...@la... System Configuration: --------------------- Architecture : x86_64 Operating Systems : CentOS release 6.2 x86_64 Postgres-XC version : Postgres-XC 1.0.1dev Description of problems: ============================================== 1) Create table "uni_col" with UNIQUE constraint on column unil mydb=# CREATE TABLE uni_col ( no_uni1 integer, no_uni2 integer, uni1 integer unique); NOTICE: CREATE TABLE / UNIQUE will create implicit index "uni_col_uni1_key" for table "uni_col" CREATE TABLE mydb=# \d uni_col Table "public.uni_col" Column | Type | Modifiers ---------+---------+----------- no_uni1 | integer | no_uni2 | integer | uni1 | integer | Indexes: "uni_col_uni1_key" UNIQUE CONSTRAINT, btree (uni1) 2) Add some records to uni_col mydb=# INSERT INTO uni_col VALUES(1,1,1); INSERT 0 1 mydb=# INSERT INTO uni_col VALUES(2,2,2); INSERT 0 1 mydb=# INSERT INTO uni_col VALUES(3,3,3); INSERT 0 1 mydb=# SELECT relid,relname FROM pg_stat_user_tables WHERE relname = 'uni_col'; relid | relname --------+--------- 114775 | uni_col (1 row) 3) See how uni_col is distributed and by what key mydb=# SELECT * FROM pgxc_class WHERE pcrelid = 114775; pcrelid | pclocatortype | pcattnum | pchashalgorithm | pchashbuckets | nodeoid s ---------+---------------+----------+-----------------+---------------+--------- ---- 114775 | H | 3 | 1 | 4096 | 16385 16 386 (1 row) 4) Create another table uni_col2 mydb=# CREATE TABLE uni_col2 AS SELECT * FROM uni_col; INSERT 0 3 5) See how uni_col2 is distributed and by what key; Expect uni1 is the key, but it isn't. mydb=# SELECT relid,relname FROM pg_stat_user_tables WHERE relname = 'uni_col2'; relid | relname --------+---------- 114780 | uni_col2 (1 row) mydb=# SELECT * FROM pgxc_class WHERE pcrelid = 114780; pcrelid | pclocatortype | pcattnum | pchashalgorithm | pchashbuckets | nodeoid s ---------+---------------+----------+-----------------+---------------+--------- ---- 114780 | H | 1 | 1 | 4096 | 16385 16 386 (1 row) mydb=# \d uni_col2 Table "public.uni_col2" Column | Type | Modifiers ---------+---------+----------- no_uni1 | integer | no_uni2 | integer | uni1 | integer | -- Hitoshi HEMMI NTT Open Source Software Center hem...@la... (Please note that my address has changed.) Tel:(03)5860-5115 Fax:(03)5463-5490 |