postgresql database schema validation and creation