Re: New driver snapshot - 07.03.0209

Поиск
Список
Период
Сортировка
От Dave Page
Тема Re: New driver snapshot - 07.03.0209
Дата
Msg-id 03AF4E498C591348A42FC93DEA9661B889FAA6@mail.vale-housing.co.uk
обсуждение исходный текст
Ответ на New driver snapshot - 07.03.0209  ("Dave Page" <dpage@vale-housing.co.uk>)
Список pgsql-odbc

> -----Original Message-----
> From: Philippe Lang [mailto:philippe.lang@attiksystem.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.

В списке pgsql-odbc по дате отправления:

Предыдущее
От: "Dave Page"
Дата:
Сообщение: Re: New driver snapshot - 07.03.0209
Следующее
От: "David P. Lurie"
Дата:
Сообщение: "Use Declare/Fetch" option