This just breaks down the indices in to three groups:
non-unique: stay as they were
unique and primary: become listed as primary keys
unique and non-primary: become listed as unique keys
I also made it so that it shows the names of check constraints ie:
Check: "$1" (a > 5)
Chris