mirror of
https://github.com/postgres/postgres.git
synced 2026-06-08 16:26:30 -04:00
Add a test for creating an index on a whole-row expression.
Surprisingly, we have no existing test for this. Had this test been present before commit570e2fcc04the Assert added in commitc98ad086adwould have caught the bug. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: http://postgr.es/m/CA+TgmoacixUZVvi00hOjk_d9B4iYKswWP1gNqQ8Vfray-AcOCA@mail.gmail.com
This commit is contained in:
parent
6bc7449eac
commit
4647ee2da3
2 changed files with 23 additions and 0 deletions
|
|
@ -1669,3 +1669,14 @@ reindex index test_pg_index_toast_index;
|
|||
drop index test_pg_index_toast_index;
|
||||
drop function test_pg_index_toast_func;
|
||||
drop table test_pg_index_toast_table;
|
||||
-- test creation of an index involving a whole-row expression
|
||||
create table test_pg_wholerow_index (a int, b text, c numeric);
|
||||
create or replace function row_image(test_pg_wholerow_index)
|
||||
returns test_pg_wholerow_index as $$select $1$$ language sql immutable;
|
||||
insert into test_pg_wholerow_index values (1, 'multiplication', 1.0);
|
||||
create index row_image_index
|
||||
on test_pg_wholerow_index ((row_image(test_pg_wholerow_index)));
|
||||
insert into test_pg_wholerow_index values (2, 'addition', 0);
|
||||
drop index row_image_index;
|
||||
drop function row_image(test_pg_wholerow_index);
|
||||
drop table test_pg_wholerow_index;
|
||||
|
|
|
|||
|
|
@ -934,3 +934,15 @@ reindex index test_pg_index_toast_index;
|
|||
drop index test_pg_index_toast_index;
|
||||
drop function test_pg_index_toast_func;
|
||||
drop table test_pg_index_toast_table;
|
||||
|
||||
-- test creation of an index involving a whole-row expression
|
||||
create table test_pg_wholerow_index (a int, b text, c numeric);
|
||||
create or replace function row_image(test_pg_wholerow_index)
|
||||
returns test_pg_wholerow_index as $$select $1$$ language sql immutable;
|
||||
insert into test_pg_wholerow_index values (1, 'multiplication', 1.0);
|
||||
create index row_image_index
|
||||
on test_pg_wholerow_index ((row_image(test_pg_wholerow_index)));
|
||||
insert into test_pg_wholerow_index values (2, 'addition', 0);
|
||||
drop index row_image_index;
|
||||
drop function row_image(test_pg_wholerow_index);
|
||||
drop table test_pg_wholerow_index;
|
||||
|
|
|
|||
Loading…
Reference in a new issue