Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

schema migration



I am currently in the process of refactoring my database schema. 
As part of that I am changing the primary key on one of my tables.

The first thing I did was place a unique contraint on the column I want
to be the new pk, then for each table with a foriegn key I added a new
colum, populated that column, then replaced the foriegn key.

Then I dropped the old primary key from the original table, then created
the new primary key.

The question is, I would like to drop the now redundant unique contraint, but all of the foriegn keys are now dependent on the unique constraint, not the primary key. 

I guess the big question is, is this even important? Is there a
performance penalty here?

I'm doing the work on my development machine, not my production server
so I have the option of trying things another way. 




Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group