How to check if autocommit is on or not postgres' psql
According to this Dustin Marx article, you can use:
\echo :AUTOCOMMIT
If it's desired to "always" have autocommit disabled, the \set AUTOCOMMIT off meta-command can be added to one's local ~/.psqlrc file. For an even more global setting, this meta-command can be placed in apsqlrc file in the database's system config directory (which can be located using PostgreSQL operating system-level command pg_config --sysconfdir).