# Problems with 'diff' and primary key names

**URL:** <https://forum.liquibase.org/t/problems-with-diff-and-primary-key-names/1921>\
**Category:** General Discussion\
**Created:** [April 16, 2012, 6:08pm UTC](https://forum.liquibase.org/t/problems-with-diff-and-primary-key-names/1921 "2012-04-16T18:08:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![remo.marti](https://avatars.discourse-cdn.com/v4/letter/r/dc4da7/32.png) [@remo.marti](https://forum.liquibase.org/u/remo.marti)\
**Post date:** [April 16, 2012, 6:08pm UTC](https://forum.liquibase.org/t/problems-with-diff-and-primary-key-names/1921/1 "2012-04-16T18:08:00Z")

</div>

Hi  
  
I’m new to liquibase and have the following issue: We’re comparing two db schemas with the diff functionality of liquibase to make sure no db change was forgotten during development. This works great - only with primary keys, I get a lot of ‘phantom differences’ due to different primary key names. Primary keys have been defined anonymously in the ‘CREATE TABLE’ statement. H2 obviously names them with some internal name that trigger a diff.  
  
Is there a mode where liquibase diff ignores the names and only checks the attribute set of a primary key? Or do I have to name all my primary keys? Is there a way to name a primary key within the create table statement?  
  
Thanks!  
Remo  
  
Example:  
…  
Missing Indexes:   
&nbsp;&nbsp;&nbsp;&nbsp; …  
&nbsp;&nbsp;&nbsp;&nbsp; PRIMARY\_KEY\_38 on INSTALLATION(INSTALLATION\_ID)  
  
Unexpected Indexes:   
&nbsp;&nbsp;&nbsp;&nbsp; …  
&nbsp;&nbsp;&nbsp;&nbsp; PRIMARY\_KEY\_8782E on INSTALLATION(INSTALLATION\_ID)

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [April 16, 2012, 6:08pm UTC](https://forum.liquibase.org/t/problems-with-diff-and-primary-key-names/1921/2 "2012-04-16T18:08:00Z")

</div>

Not a good way in 2.x. The diff/snapshot/comparison functionality is the main focus of 3.0 which should help with this sort of thing.&nbsp;

For now, you’ll just have understand from the diff report that the name differences are not meaningful to you.

Nathan
