Added foreign key support for postgres