MS Access ODBC with PostgreSQL Table Write Conflict
Solution 1:
I know that this question is old, but problem still exists (tested on MS Access 2013) and some people might be looking for solution.
According to PostgreSQL FAQ this is caused by slight differences between Access and Postgre in 2 specific cases. While updating a record, access adds some conditions to ensure that record wasn't changed by anybody. If any of them fail database returns that no records were updated, which is interpreted as they were modified in the meantime.
Empty strings
Access doesn't know the difference between empty string (''
) and NULL while postgre does. If you leave empty string in a field, Access add ... AND column_name IS NULL"
which fails in database. There's only workaround currently - make sure that all empty strings are stored as NULL.
Timestamps
PostgreSQL timestamp has microsecond precision while Access supports only milliseconds. In this case Access rounds the excess, so for example 2016-02-22 12:34:56.788952
is converted to 2016-02-22 12:34:56.789
which later fails on comparison. This can be fixed by lowering precision of the timestamp in database. Change timestamp
type to timestamp(3)
(for millisecond precision) or timestamp(0)
(for second precision).
I hope it helped.