I’m using PostgreSQL (v9.1) and would like to create a new table (using my postgres user) then alter the ownership of the table and grant some permissions to a couple of groups.
The works fine, but I couldn’t find any way to alter the owner or perform the grants without using custom sql in the same changeSet. This works correctly BUT, LiquiBase apparently cannot rollback this change. When I try a rollback, I get a RollbackImpossibleException related to the (I believe).
1) is there a better/preferred way to create the table with the ownership change and grants I need? For security reasons my owner cannot actually create the table, I have to use postgres to create it then switch ownership.
2) Is there a way to specify how to rollback the change? In this case the RawSql is not relevant, “rollback” just means I want the table dropped.
For reference, here’s the xml for the changeSet:
ALTER TABLE abcproxy OWNER TO tableowner;
GRANT ALL ON TABLE abcproxy TO tableowner;
GRANT ALL ON TABLE abcproxy TO tableusersgroup;