Thanks for the reply Thomas.

Is there any reason not to change the behaviour? Doesn't it make sense
to actually display the constraint name, since it is what is being
violated?

After taking a look at the INFORMATION.CONSTRAINTS table, I see the
following:
For example, here's a table:
CREATE TABLE SUPPLIERS (
  SUPPL_ID    BIGINT AUTO_INCREMENT(1,1),
  SUPPL_DESC  VARCHAR(50) NOT NULL,

  CONSTRAINT PK_SUPPLIERS PRIMARY KEY (SUPPL_ID),
  CONSTRAINT UQ_SUPPLIERS_DESC UNIQUE (SUPPL_DESC)
);

After creating it, the index name of the UQ_SUPPLIERS_DESC is
UQ_SUPPLIERS_DESC_INDEX_A (which I can live with), but the name of the
primary key index is PRIMARY_KEY_A. I cannot rely on that name being
unique if I decided to change the database provider (or rebuild DB).


On Sep 6, 9:14 pm, Thomas Mueller <[email protected]>
wrote:
> Hi,
>
> I'm sorry, but I don't think I will change the behavior. I understand
> it would be nicer to use the constraint name, but I think given the
> index name usually starts with the constraint name, it should be
> relatively easy to see what constraint is violated. As for the primary
> key constraint, it's similar (there can only be one primary key per
> table).
>
> Regards,
> Thomas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to