Skip to content

Commit bc18c38

Browse files
committed
Prevent UNIQUE indexes for non-btree access methods.
1 parent 3827f4e commit bc18c38

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/backend/commands/defind.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.9 1996/11/13 20:48:22 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.10 1997/01/18 05:48:07 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -105,7 +105,10 @@ DefineIndex(char *heapRelationName,
105105
heapRelationName);
106106
}
107107
relationId = tuple->t_oid;
108-
108+
109+
if (unique && strcmp(accessMethodName,"btree") != 0)
110+
elog(WARN, "DefineIndex: unique indexes are only available with the btree access method");
111+
109112
/*
110113
* compute access method id
111114
*/

0 commit comments

Comments
 (0)