Changes to modified jugglingdb adapter for postgres (adds UNIQUE constraint)
Small refactoring