Fixed a bug where we didn't always create primary key constraints for postgresql tables.
Also took the opportunity to add a few additional indices.
Authored by: jonas 2005-10-30
Parent: [r2425]
Child: [r2427]