I think this can be even more awesome: you pass the table name, and let the DB tell you which columns are not nullable, (i.e. required). See [this post](http://stackoverflow.com/questions/5345380/finding-columns-that-are-not-null-in-postgresql)