Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit982b82d

Browse files
committed
Add a regression test case for \d on an index.
Previous commit shows the need for this. The coverage isn't reallythorough, but it's better than nothing.
1 parente694cf2 commit982b82d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

‎src/test/regress/expected/create_index.out

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2383,6 +2383,14 @@ ALTER TABLE cwi_test ADD primary key USING INDEX cwi_uniq_idx;
23832383
Indexes:
23842384
"cwi_uniq_idx" PRIMARY KEY, btree (a, b)
23852385

2386+
\d cwi_uniq_idx
2387+
Index "public.cwi_uniq_idx"
2388+
Column | Type | Definition
2389+
--------+-----------------------+------------
2390+
a | integer | a
2391+
b | character varying(10) | b
2392+
primary key, btree, for table "public.cwi_test"
2393+
23862394
CREATE UNIQUE INDEX cwi_uniq2_idx ON cwi_test(b , a);
23872395
ALTER TABLE cwi_test DROP CONSTRAINT cwi_uniq_idx,
23882396
ADD CONSTRAINT cwi_replaced_pkey PRIMARY KEY
@@ -2398,6 +2406,14 @@ NOTICE: ALTER TABLE / ADD CONSTRAINT USING INDEX will rename index "cwi_uniq2_i
23982406
Indexes:
23992407
"cwi_replaced_pkey" PRIMARY KEY, btree (b, a)
24002408

2409+
\d cwi_replaced_pkey
2410+
Index "public.cwi_replaced_pkey"
2411+
Column | Type | Definition
2412+
--------+-----------------------+------------
2413+
b | character varying(10) | b
2414+
a | integer | a
2415+
primary key, btree, for table "public.cwi_test"
2416+
24012417
DROP INDEX cwi_replaced_pkey;-- Should fail; a constraint depends on it
24022418
ERROR: cannot drop index cwi_replaced_pkey because constraint cwi_replaced_pkey on table cwi_test requires it
24032419
HINT: You can drop constraint cwi_replaced_pkey on table cwi_test instead.

‎src/test/regress/sql/create_index.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,13 +767,15 @@ CREATE UNIQUE INDEX cwi_uniq_idx ON cwi_test(a , b);
767767
ALTERTABLE cwi_test ADDprimary key USING INDEX cwi_uniq_idx;
768768

769769
\d cwi_test
770+
\d cwi_uniq_idx
770771

771772
CREATEUNIQUE INDEXcwi_uniq2_idxON cwi_test(b , a);
772773
ALTERTABLE cwi_test DROPCONSTRAINT cwi_uniq_idx,
773774
ADDCONSTRAINT cwi_replaced_pkeyPRIMARY KEY
774775
USING INDEX cwi_uniq2_idx;
775776

776777
\d cwi_test
778+
\d cwi_replaced_pkey
777779

778780
DROPINDEX cwi_replaced_pkey;-- Should fail; a constraint depends on it
779781

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp