I kind of ran into something interesting. I’ve executed a SQL script using pgAdmin as GUI. With both autocommit on and off respectably.
Executed script contains these statements as follows:
`begin;
insert into test values (5);
rollback;
insert into test values (6);
rollback;
insert into test values (7);
commit;`
I get this as result with both executions.
WARNING: there is no transaction in process
WARNING: there is no transaction in process
COMMIT
Obviously both warnings are contributed by the second rollback and the last commit. But why is there no difference in between those two executions although auto commit value is different when executing these scripts?
I’ve looked up for any explanation for this, but couldn’t find anything useful for this kind of behavior.
What’s the explanation for this?
kenshinakamura is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.