\c postgres
create user test_rename_user password 'ttest@123';
\!  @abs_bindir@/gsql -d postgres -U test_rename_user -W ttest@123 -p @portstring@ -r -c "create table rename_test(id int);"
\!  @abs_bindir@/gsql -d postgres -U test_rename_user -W ttest@123 -p @portstring@ -r -c "table rename_test;"
alter user test_rename_user rename to test_rename_user2;
\!  @abs_bindir@/gsql -d postgres -U test_rename_user2 -W ttest@123 -p @portstring@ -r -c "table rename_test;"
\!  @abs_bindir@/gsql -d postgres -U test_rename_user2 -W ttest@123 -p @portstring@ -r -c "alter user test_rename_user2 identified by 'ttest@234' replace 'ttest@123';"
drop user test_rename_user2 cascade;
drop user if exists test_rename_user;

\!  @abs_bindir@/gsql  -d postgres -p @portstring@ -r -c "create user user01 password 'ttest@123';"
\!  @abs_bindir@/gsql  -d postgres -p @portstring@ -r -c "create user user02 password 'ttest@123';"
\!  @abs_bindir@/gsql  -d postgres -p @portstring@ -r -U user01 -W 'ttest@123' -c "set role user03;"
\!  @abs_bindir@/gsql  -d postgres -p @portstring@ -r -U user01 -W 'ttest@123' -c "set role user02;"
drop user user01;
drop user user02;
\!  @abs_bindir@/gsql  -d postgres -p @portstring@ -r -c "create user current_user01 password 'ttest@123';"
\!  @abs_bindir@/gsql  -d postgres -p @portstring@ -r -c "create user current_user02 password 'ttest@123';"
\!  @abs_bindir@/gsql  -d postgres -p @portstring@ -r -U current_user01 -W 'ttest@123' -c "drop user current_user02;"
\!  @abs_bindir@/gsql  -d postgres -p @portstring@ -r -U current_user01 -W 'ttest@123' -c "drop user current_user03;"
\!  @abs_bindir@/gsql  -d postgres -p @portstring@ -r -U current_user01 -W 'ttest@123' -c "alter user current_user02 sysadmin;"
\!  @abs_bindir@/gsql  -d postgres -p @portstring@ -r -U current_user01 -W 'ttest@123' -c "alter user current_user03 sysadmin;"
drop user current_user01;
drop user current_user02;
