summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/index_including.out14
-rw-r--r--src/test/regress/sql/index_including.sql10
2 files changed, 24 insertions, 0 deletions
diff --git a/src/test/regress/expected/index_including.out b/src/test/regress/expected/index_including.out
index b7d1812ec5c..ee976994a44 100644
--- a/src/test/regress/expected/index_including.out
+++ b/src/test/regress/expected/index_including.out
@@ -245,6 +245,20 @@ SELECT indexdef FROM pg_indexes WHERE tablename = 'tbl' ORDER BY indexname;
DROP TABLE tbl;
/*
+ * 3.3 Test ALTER TABLE SET STATISTICS
+ */
+CREATE TABLE tbl (c1 int, c2 int);
+CREATE INDEX tbl_idx ON tbl (c1, (c1+0)) INCLUDE (c2);
+ALTER INDEX tbl_idx ALTER COLUMN 1 SET STATISTICS 1000;
+ERROR: cannot alter statistics on non-expression column "c1" of index "tbl_idx"
+HINT: Alter statistics on table column instead.
+ALTER INDEX tbl_idx ALTER COLUMN 2 SET STATISTICS 1000;
+ALTER INDEX tbl_idx ALTER COLUMN 3 SET STATISTICS 1000;
+ERROR: cannot alter statistics on included column "c2" of index "tbl_idx"
+ALTER INDEX tbl_idx ALTER COLUMN 4 SET STATISTICS 1000;
+ERROR: column number 4 of relation "tbl_idx" does not exist
+DROP TABLE tbl;
+/*
* 4. CREATE INDEX CONCURRENTLY
*/
CREATE TABLE tbl (c1 int,c2 int, c3 int, c4 box, UNIQUE(c1, c2) INCLUDE(c3,c4));
diff --git a/src/test/regress/sql/index_including.sql b/src/test/regress/sql/index_including.sql
index b71bcaf9360..b59adeb845e 100644
--- a/src/test/regress/sql/index_including.sql
+++ b/src/test/regress/sql/index_including.sql
@@ -137,6 +137,16 @@ ALTER TABLE tbl DROP COLUMN c1;
SELECT indexdef FROM pg_indexes WHERE tablename = 'tbl' ORDER BY indexname;
DROP TABLE tbl;
+/*
+ * 3.3 Test ALTER TABLE SET STATISTICS
+ */
+CREATE TABLE tbl (c1 int, c2 int);
+CREATE INDEX tbl_idx ON tbl (c1, (c1+0)) INCLUDE (c2);
+ALTER INDEX tbl_idx ALTER COLUMN 1 SET STATISTICS 1000;
+ALTER INDEX tbl_idx ALTER COLUMN 2 SET STATISTICS 1000;
+ALTER INDEX tbl_idx ALTER COLUMN 3 SET STATISTICS 1000;
+ALTER INDEX tbl_idx ALTER COLUMN 4 SET STATISTICS 1000;
+DROP TABLE tbl;
/*
* 4. CREATE INDEX CONCURRENTLY