From: | "Andrew L(dot) Gould" <algould(at)datawok(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | FYI: Avoiding write conflict errors in MS Access clients |
Date: | 2003-09-04 16:15:53 |
Message-ID: | 200309041115.53202.algould@datawok.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
This email is semi-off topic; but documents a problem and the server-side
solution when using MS Access as a client to many (all?) database servers. I
decided to post the problem/solution because the MS Access error message is
very misleading.
For those of you creating applications using PostgreSQL with MS Access
clients:
PostgreSQL will allow bit fields to hold null values. I consider this to be
valuable because a null boolean field tells me the information is incomplete
(a question hasn't been answered, for example); which is, itself,
information.
MS Access will allow users to insert records into linked tables with null
values in bit fields. Unfortunately, when the user tries to update the
record later, Access will interpret the null value as a data type violation
and will produce a "Write conflict" error message telling the user that
someone else has edited the record since the user started editing the record.
(I was the only user.) The user can drop the changes or copy them to the
clipboard; but no changes will be allowed to the data table.
This problem is prevented by using "not null" and assigning default values
when the table is created in PostgreSQL. If you are dealing with the problem
after the fact, use psql to change all of the null values in bit fields to 0
(or false, for boolean fields). Then use the "alter table" sql command to
add default values and the "not null" attribute to the table structure.
Best of luck,
Andrew Gould
From | Date | Subject | |
---|---|---|---|
Next Message | Adam Kavan | 2003-09-04 16:32:42 | Re: pg_autovacuum |
Previous Message | Alvaro Herrera Munoz | 2003-09-04 16:10:16 | Re: [HACKERS] tablelevel and rowlevel locks |