Peewee/psychopg2 always in transaction mode
>When there's a database error, postgres leaves me in a failed transaction.

Yes, in which case you should issue a rollback.

Peewee is currently designed to work *with* psycopg2's transaction handling. Setting `autocommit=True` may break Peewee's transactional APIs or may have other unintended consequences. Unless you're very familiar with both peewee's transaction semantics and psycopg2's, I wouldn't recommend setting pg to autocommit.

If the issue is simply that you are issuing queries that fail due to errors, I suggest you fix your queries to make them more robust, and wrap them with peewee's `atomic` (or ensure that you properly roll-back upon a query failure).

By the way, your traceback is not relevant I don't think, since that is the query you are attempting to execute *after* a previous query failed.
When there's a database error, postgres leaves me in a failed transaction. This appears to be because psycopg2 [defaults to manual commits](https://www.psycopg.org/docs/connection.html#connection.autocommit). So I updated the connection to pass through `autocommit=True` but it appears I'm still stuck in failed transactions when there are errors:

Here's my connection code:
```
database = PostgresqlExtDatabase(
    config.database('dbname'),
    host=config.database('host'),
    user=config.database('username'),
    password=config.database('password'),
    autocommit=True
)
```
Is that the right way to connect with autocommit?

Here's the traceback if it helps:

```
Traceback (most recent call last):
  File "/var/task/handler/trial.py", line 97, in handler
    return trial_new(event)
  File "/var/task/handler/trial.py", line 22, in trial_new
    client = User.get(User.mobile == mobile)
  File "/var/task/peewee.py", line 6384, in get
    return sq.get()
  File "/var/task/peewee.py", line 6807, in get
    return clone.execute(database)[0]
  File "/var/task/peewee.py", line 1886, in inner
    return method(self, database, *args, **kwargs)
  File "/var/task/peewee.py", line 1957, in execute
    return self._execute(database)
  File "/var/task/peewee.py", line 2129, in _execute
    cursor = database.execute(self)
  File "/var/task/playhouse/postgres_ext.py", line 490, in execute
    cursor = self.execute_sql(sql, params, commit=commit)
  File "/var/task/peewee.py", line 3106, in execute_sql
    self.commit()
  File "/var/task/peewee.py", line 2873, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)
  File "/var/task/peewee.py", line 183, in reraise
    raise value.with_traceback(tb)
  File "/var/task/peewee.py", line 3099, in execute_sql
    cursor.execute(sql, params or ())
```