From what I read in the PostgreSQL documentation, it seems that queries like
UPDATE accounts SET balance = balance + 100 WHERE account_id = 12345
are atomic and can be safely executed concurrently. Is this only the case when a single integer column is updated? In my Django app I have a query like this (generated by the ORM):
UPDATE "mytable" SET "counter" = ("mytable"."counter" + 1),
"owner" = NULL, "updated" = '2018-04-12T12:53:17.826257+00:00'::timestamptz
WHERE "mytable"."id" = 27; args=(1, datetime.datetime(2018, 4, 12, 12, 53, 17, 826257, tzinfo=<UTC>), 27)
which is executed concurrently by multiple background jobs. Will the counter be updated atomically in this case? I'm using the autocommit mode (Django default).