pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Davide Romanini <romaz@libero.it>
To: pgsql-odbc@postgresql.org
Subject: The way Access/ODBC does updates to records
Date: Mon, 17 Mar 2003 20:16:00 +0100
Message-ID: <3E761EF0.40901@libero.it> (raw)

Hi,

When I link postgreSQL tables to access, and try to modify a record, I 
found that odbc sends a query to postgresql containing a lot of fields 
in the WHERE clause. For example:

I have a table names with fields id, name, surname, address.
When I modify an existing record changing the name from Davide to 
Daniele, I expect that odbc sends a query like this:
UPDATE names SET name='Daniele' WHERE id=1;
or, in the case it looks for contamporary changes:
UPDATE names SET name='Daniele' WHERE id=1 AND name='Davide';

Instead I see it uses:
UPDATE names SET name='Daniele' WHERE id=1 AND name='Davide' AND 
surname='Romanini' AND address='My address';

It wouldn't be a problem, but with some datatypes (dates, doubles for 
example) and sometimes with triggers that change data before updates, 
it has problems like the "Another user is changing the same data".

I want to know if there's a way to force access (or odbc) to use only 
primary key fields in the WHERE clause for un UPDATE (there aren't 
reasons to use other fields).

Thanks, Romaz
--
Davide Romanini




view thread (2+ messages)  latest in thread

Message-ID: <3E761EF0.40901@libero.it>
Permalink:  ../3E761EF0.40901@libero.it/
Also on:    postgresql.org/message-id/3E761EF0.40901@libero.it

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: romaz@libero.it
  Subject: Re: The way Access/ODBC does updates to records
  In-Reply-To: <3E761EF0.40901@libero.it>
  References: <3E761EF0.40901@libero.it>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox