Site icon Java, SQL and jOOQ.

Subtle SQL differences: Constraint names

The various SQL product vendors implement subtle differences in the way they interpret SQL. In this case, I’ve been examining the reuse of constraint names within a schema / database (which is yet another story: what’s a schema, what’s a database?). Here’s the summary:

Constraint names are unique within a schema

Constraint names are unique within a table

The “weird ones”

For most compatibility across databases, it is never a good idea to re-use names. Keep your constraint names unique across a schema.

Exit mobile version