About the postgresql update problem
Ah, I see the problem.

When Postgresql runs into an IntegrityError (the exception that occurs when you violate the unique constraint, e.g.) then you *have* to rollback the transaction. The connection gets into a bad state and no further queries can be run until you rollback. The problem is you have started your Tx before you insert the first row. So when you are forced to rollback, you are rolling back the insert.
I am using pgsql 13.2, I tried to execute the following code, and I commented the commit, but an error occurred after executing the update, may I ask where the problem is, thank you very much
```
from peewee import *

db = PostgresqlDatabase('peewee_test',user='postgres',host="10.10.17.2",password='11')
db2 = PostgresqlDatabase('peewee_test',user='postgres',host="10.10.17.2",password='11')  # 2nd connection

class Reg(Model):
    name = CharField(null=True,unique=True)
    key = TextField()
    class Meta:
        database = db

class Reg2(Reg):  # model class for accessing table using 2nd conn
    class Meta:
        database = db2
        table_name = 'reg'

class Test():

    def test_db(self):
        db.create_tables([Reg])

        with db.manual_commit() as tx:
            db.begin()
            for i in range(1,10):
                try:
                    Reg.create(key='k1',name="test")  # create a row using first conn
                    print("11111")
                except:
                    Reg.update(key='k2').where(Reg.name == "test22").execute()
                    print("22222")

                db2.connect()  # query table using 2nd conn
                print('is "k1" visible to conn2 BEFORE commit?')
                print('rows in "reg" table: %s' % Reg2.select().count())

                #db.commit()
                print('is "k1" visible to conn2 AFTER commit?')
                print('rows in "reg" table: %s' % Reg2.select().count())

                db2.close()

        #db.drop_tables([Reg])

T=Test()
T.test_db()
```