-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Trouble w/ PostgresQL & implicit index creation
PostPosted: Tue May 03, 2005 7:18 am 
Newbie

Joined: Fri Feb 20, 2004 6:26 am
Posts: 12
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"


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 03, 2005 8:45 am 
Newbie

Joined: Fri Feb 20, 2004 6:26 am
Posts: 12
Solved. Sorry for the inconvenience.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.