PostgreSQL table creation script.  Developed on 9.x, but should work back to at least 8.x.