New backend functions? [was Re: JDBC changes for 7.2... some questions...]

Поиск
Список
Период
Сортировка
От Ned Wolpert
Тема New backend functions? [was Re: JDBC changes for 7.2... some questions...]
Дата
Msg-id XFMail.20010823104235.ned.wolpert@knowledgenet.com
обсуждение исходный текст
Ответ на Re: JDBC changes for 7.2... some questions...  (Barry Lind <barry@xythos.com>)
Ответы Re: New backend functions? [was Re: JDBC changes for 7.2... some questions...]  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-jdbc
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

(For those unfamiliar with the topic, looking for a way to get the last
inserted OID through a sql call, rather than a method call off the JDBC
driver)

On 23-Aug-2001 Barry Lind wrote:
> I would only agree to this functionality if it where a backend function.

For me, the best method to deal with this problem is implement the returning
clause on the backend... but isn't an option in the short term....

> For the front end to understand the function it needs to parse the SQL
> statement.  Thus under your proposal every select statement needs to be
> parsed to see if one of the selected items is the special function.  I
> strive to ensure that the jdbc code does not need to parse the SQL
> statements and understand the grammer of the SQL language.  Since
> functions can appear in select lists, where clauses, orderbys, and even

This is a problem, I agree.  In short, supporting 'select @@last_oid' (my
original syntax) is not a framework within itself, but a short-term "kludge" as
you mentioned.

But what are the options that should be pursued?  I want to solve this one way
or another.  (And willing to work on an acceptable solution.)

> Given that the JDBC driver already does provide the information via the
> getLastOID() method,  we are really dealing with a small isolated
> problem here because of the use of a connection pool that doesn't let
> you get at that method.  (Unfortunatly for you, it is the problem you
> are facing).

Well, it's not really that isolated.  The method call 'getLastOID()' isn't in
the backend either.  That's the problem.  This method provides functionality
which is very useful, but not in a uniformally applied way where each driver
can benefit either.

> If the function was implemented in the backend, I think it would be a
> good idea.

Perhaps this is the solution after all.  (And the reason I forward this to the
pghackers list as well)  Should the backend support the function
getLastInsertedOID() or even getLastInsertedPrimaryKey() (or both)?  Now, I can
try to write the functions, and see if it can be separated into the contrib
section of the psql repository if people would like.

Does this work for you? (And anyone else reading this)



Virtually,
Ned Wolpert <ned.wolpert@knowledgenet.com>

D08C2F45:  28E7 56CB 58AC C622 5A51  3C42 8B2B 2739 D08C 2F45
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7hUCLiysnOdCML0URArdAAJ4kI4S00AVzGgazsGS5nTMu+0X8CwCeOLQ8
TVTTzaQdEt6uJrbVAm0Dd4s=
=U3aZ
-----END PGP SIGNATURE-----

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

Предыдущее
От: Barry Lind
Дата:
Сообщение: Re: JDBC changes for 7.2... some questions...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: New backend functions? [was Re: JDBC changes for 7.2... some questions...]