Thanks to new resources (postgresql_default_priviledges) and some fixes Terraform can now add new databases and manage ownership / access to them.
This example creates new database and two users. You can use owner to create new tables and run migrations and user for normal read/write access to database.