I need to automate the below commands through batch job, is there a way to do it. Currently command prompt is stopping after executing the first step(psql -U nrgadmin -d enwdb). Inside the enwdb database, I need to manually execute the steps from begin to commit. Any help would be appreciated.
psql -U nrgadmin -d enwdb;
begin;
alter schema asset_enw rename to asset_enw_backup;
alter schema asset_import rename to asset_enw;
alter table enw.geom rename to geom_backup;
alter table enw.geom_backup set schema asset_enw_backup;
alter table import.geom set schema enw;
commit;