Fix crashes when cluster indexes have storage options (fillfactor, etc).

This commit is contained in:
Takahiro Itagaki
2010-02-05 03:24:22 +00:00
parent 7084ec6de9
commit a7a42b7bbf
5 changed files with 37 additions and 23 deletions

View File

@ -6,9 +6,9 @@ CREATE TABLE tbl_cluster (
col1 int,
col2 timestamp,
","")" text,
PRIMARY KEY (","")", col1)
PRIMARY KEY (","")", col1) WITH (fillfactor = 75)
) WITH (fillfactor = 70);
CREATE INDEX ","") cluster" ON tbl_cluster (col2, length(","")"), ","")" text_pattern_ops);
CREATE INDEX ","") cluster" ON tbl_cluster (col2, length(","")"), ","")" text_pattern_ops) WITH (fillfactor = 75);
ALTER TABLE tbl_cluster CLUSTER ON ","") cluster";
CREATE TABLE tbl_only_pkey (
col1 int PRIMARY KEY,
@ -35,8 +35,9 @@ CREATE TABLE tbl_with_dropped_column (
c2 text,
d3 text
);
ALTER INDEX tbl_with_dropped_column_pkey SET (fillfactor = 75);
ALTER TABLE tbl_with_dropped_column CLUSTER ON tbl_with_dropped_column_pkey;
CREATE INDEX idx_c1c2 ON tbl_with_dropped_column (c1, c2);
CREATE INDEX idx_c1c2 ON tbl_with_dropped_column (c1, c2) WITH (fillfactor = 75);
CREATE INDEX idx_c2c1 ON tbl_with_dropped_column (c2, c1);
--
-- insert data
@ -85,8 +86,8 @@ SELECT * FROM tbl_with_dropped_column;
col2 | timestamp without time zone |
,") | text | not null
Indexes:
"tbl_cluster_pkey" PRIMARY KEY, btree (","")", col1)
",") cluster" btree (col2, length(","")"), ","")" text_pattern_ops) CLUSTER
"tbl_cluster_pkey" PRIMARY KEY, btree (","")", col1) WITH (fillfactor=75)
",") cluster" btree (col2, length(","")"), ","")" text_pattern_ops) WITH (fillfactor=75) CLUSTER
\d tbl_gistkey
Table "public.tbl_gistkey"
@ -126,8 +127,8 @@ Table "public.tbl_with_dropped_column"
c2 | text |
c3 | text |
Indexes:
"tbl_with_dropped_column_pkey" PRIMARY KEY, btree (id) CLUSTER
"idx_c1c2" btree (c1, c2)
"tbl_with_dropped_column_pkey" PRIMARY KEY, btree (id) WITH (fillfactor=75) CLUSTER
"idx_c1c2" btree (c1, c2) WITH (fillfactor=75)
"idx_c2c1" btree (c2, c1)
SELECT col1, to_char(col2, 'YYYY-MM-DD HH24:MI:SS'), ","")" FROM tbl_cluster;