Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
7d66bf26
Commit
7d66bf26
authored
Aug 27, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some minimal exercising of functional-index feature to regression
tests.
parent
c92b4508
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
2 deletions
+31
-2
src/test/regress/expected/create_index.out
src/test/regress/expected/create_index.out
+13
-0
src/test/regress/expected/sanity_check.out
src/test/regress/expected/sanity_check.out
+2
-1
src/test/regress/output/misc.source
src/test/regress/output/misc.source
+2
-1
src/test/regress/sql/create_index.sql
src/test/regress/sql/create_index.sql
+14
-0
No files found.
src/test/regress/expected/create_index.out
View file @
7d66bf26
...
...
@@ -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');
src/test/regress/expected/sanity_check.out
View file @
7d66bf26
...
...
@@ -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
(4
8
rows)
(4
9
rows)
src/test/regress/output/misc.source
View file @
7d66bf26
...
...
@@ -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
(9
0
rows)
(9
1
rows)
--SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer'))) AS equip_name;
SELECT hobbies_by_name('basketball');
...
...
src/test/regress/sql/create_index.sql
View file @
7d66bf26
...
...
@@ -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'
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment