Re: New driver snapshot - 07.03.0209

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Philippe Lang" <philippe(dot)lang(at)attiksystem(dot)ch>
Cc: <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: New driver snapshot - 07.03.0209
Date: 2004-04-19 08:31:33
Message-ID: 03AF4E498C591348A42FC93DEA9661B889FAA6@mail.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

> -----Original Message-----
> From: Philippe Lang [mailto:philippe(dot)lang(at)attiksystem(dot)ch]
> Sent: 19 April 2004 08:57
> To: Dave Page
> Subject: RE: [ODBC] New driver snapshot - 07.03.0209
>
> Hello,
>
> After a quick test, I would say the driver works fine,
> thanks. I use a LATIN1 encoded database, though.

Thanks for the feedback.

> Regarding the issue we have been talking about in this
> newsgroup, the "SELECT @@IDENTITY" problem, is there a way of
> incorporing that in the driver itself? Your mention in your
> last message:
>
> > Standard answer: The best method would be to do a "SELECT
> currval('seq_name');"
> > when required on the relevant sequence.
>
> Are you talking about a sequence in the driver? Could you
> point me to the place where you beleive changes could be
> made? I could make a few tests here, but I have to say I
> absolutely don't know where to start, nor if it's possible to
> fix the driver...

It's more of an app-level thing. There are various problems to consider:

- The sequence must be identified - that means executing a query to look
at the schema and figure out what sequence is generating the ID (if
any).

- What if the pkey is multi-part?

- What if you ignore pkeys, and look for columns with a default of
nextval(something or other) - what if there are 2? Which one should you
return?

- How do you identify an insert in the driver? Do you need to parse
*every* statement, or will this only work for cursors (which I never use
and cannot help much with).

Doing this properly requires changes to the fe/be protocol imho. If the
CommandComplete message could be changed to return the pkey values for
any affected rows, that would be ideal at first thought (though anything
more than a couple of records should probably have a dedicated query
message to prevent unnecessary data transfers). 2 problems there though
- firstly, Tom just changed the fe/be protocol for 7.4 and I seriously
doubt he (or any of the other hackers) would want it to change again,
and secondly, the driver doesn't even support the 7.4 protocol yet
(though Hiroshi did mention he had a patch once), never mind a future
version.

I think this is a non-starter :-(

Regards, Dave.

Browse pgsql-odbc by date

  From Date Subject
Next Message David P. Lurie 2004-04-19 14:57:32 "Use Declare/Fetch" option
Previous Message Jennie 2004-04-18 02:24:38 Graphic tool