Hi All,
We have a requirement of changing schemas but it we also need it to revert to the original one.
Alter user <user> with default_schema = <newSchema> does the job of changing the schema.But found that this change is done at the database level and is permanent.Meaning if I change the schema for a user in one connection then it remains the same even after the connection closes and user connects again using a different connection.
We do only read operations after altering a schema so I thought of rolling back the transaction once we change the schema and the query has been executed so that it reverts to original schema.Something like this -->
begin transaction
Alter user <user> with default_schema = <newSchema>;
select * from <tableName>;
rollback transaction
But noticed that rollback does not have any effect.The schema name remains as <newSchema>.
Is there any way of changing the schema just for that particular connection and then revert ?