I'm using Hibernate 2.1.7 with PostgresQL 7.4.7-5 on Debian Linux.
My goal is to produce a unique key constraint on fields 'name' and 'scope'.
Once I generate the DDL from my mappings and deploy it via 'psql', I see a message indicating that psql created an implicit index on the name field defined as a property. This is not what I want, since
name=hello, scope=world
name=hello, scope=universe
is valid.
Oracle & Hypersonic work as expected with my mappings. How can I keep Postgres from creating this implicit index?
Thanks.
*** Mapping snippet:
<property
name="name"
type="java.lang.String"
update="true"
insert="true"
>
<column
name="name"
unique-key="def_name_scope_uidx"
/>
</property>
<property
name="scope"
type="java.lang.String"
update="true"
insert="true"
>
<column
name="scope"
unique-key="def_name_scope_uidx"
/>
</property>
*** The generated DDL ('schemaexport') looks ok:
create table defs (
id int8 not null,
version int8 not null,
name varchar(255),
scope varchar(255),
primary key (id),
unique (name, scope)
);
*** Psql log:
...
CREATE TABLE
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "defs_pkey" for table "defs"
NOTICE: CREATE TABLE / UNIQUE will create implicit index "defs_name_key" for table "defs"
|