@@ -2383,6 +2383,14 @@ ALTER TABLE cwi_test ADD primary key USING INDEX cwi_uniq_idx;
2383
2383
Indexes:
2384
2384
"cwi_uniq_idx" PRIMARY KEY, btree (a, b)
2385
2385
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
+
2386
2394
CREATE UNIQUE INDEX cwi_uniq2_idx ON cwi_test(b , a);
2387
2395
ALTER TABLE cwi_test DROP CONSTRAINT cwi_uniq_idx,
2388
2396
ADD CONSTRAINT cwi_replaced_pkey PRIMARY KEY
@@ -2398,6 +2406,14 @@ NOTICE: ALTER TABLE / ADD CONSTRAINT USING INDEX will rename index "cwi_uniq2_i
2398
2406
Indexes:
2399
2407
"cwi_replaced_pkey" PRIMARY KEY, btree (b, a)
2400
2408
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
+
2401
2417
DROP INDEX cwi_replaced_pkey; -- Should fail; a constraint depends on it
2402
2418
ERROR: cannot drop index cwi_replaced_pkey because constraint cwi_replaced_pkey on table cwi_test requires it
2403
2419
HINT: You can drop constraint cwi_replaced_pkey on table cwi_test instead.
0 commit comments