Add some minimal exercising of functional-index feature to regression

tests.
This commit is contained in:
Tom Lane 2001-08-27 23:23:35 +00:00
parent c92b450891
commit 7d66bf261c
4 changed files with 31 additions and 2 deletions

View File

@ -68,3 +68,16 @@ CREATE INDEX hash_name_index ON hash_name_heap USING hash (random name_ops);
CREATE INDEX hash_txt_index ON hash_txt_heap USING hash (random text_ops);
CREATE INDEX hash_f8_index ON hash_f8_heap USING hash (random float8_ops);
-- CREATE INDEX hash_ovfl_index ON hash_ovfl_heap USING hash (x int4_ops);
--
-- Test functional index
--
CREATE TABLE func_index_heap (f1 text, f2 text);
CREATE UNIQUE INDEX func_index_index on func_index_heap (textcat(f1,f2));
INSERT INTO func_index_heap VALUES('ABC','DEF');
INSERT INTO func_index_heap VALUES('AB','CDEFG');
INSERT INTO func_index_heap VALUES('QWE','RTY');
-- this should fail because of unique index:
INSERT INTO func_index_heap VALUES('ABCD', 'EF');
ERROR: Cannot insert a duplicate key into unique index func_index_index
-- but this shouldn't:
INSERT INTO func_index_heap VALUES('QWERTY');

View File

@ -15,6 +15,7 @@ SELECT relname, relhasindex
bt_name_heap | t
bt_txt_heap | t
fast_emp4000 | t
func_index_heap | t
hash_f8_heap | t
hash_i4_heap | t
hash_name_heap | t
@ -58,5 +59,5 @@ SELECT relname, relhasindex
shighway | t
tenk1 | t
tenk2 | t
(48 rows)
(49 rows)

View File

@ -599,6 +599,7 @@ SELECT user_relns() AS user_relns
fast_emp4000
float4_tbl
float8_tbl
func_index_heap
hash_f8_heap
hash_i4_heap
hash_name_heap
@ -653,7 +654,7 @@ SELECT user_relns() AS user_relns
toyemp
varchar_tbl
xacttest
(90 rows)
(91 rows)
--SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer'))) AS equip_name;
SELECT hobbies_by_name('basketball');

View File

@ -90,3 +90,17 @@ CREATE INDEX hash_f8_index ON hash_f8_heap USING hash (random float8_ops);
-- CREATE INDEX hash_ovfl_index ON hash_ovfl_heap USING hash (x int4_ops);
--
-- Test functional index
--
CREATE TABLE func_index_heap (f1 text, f2 text);
CREATE UNIQUE INDEX func_index_index on func_index_heap (textcat(f1,f2));
INSERT INTO func_index_heap VALUES('ABC','DEF');
INSERT INTO func_index_heap VALUES('AB','CDEFG');
INSERT INTO func_index_heap VALUES('QWE','RTY');
-- this should fail because of unique index:
INSERT INTO func_index_heap VALUES('ABCD', 'EF');
-- but this shouldn't:
INSERT INTO func_index_heap VALUES('QWERTY');