Re: DBD::PostgreSQL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: DBD::PostgreSQL
Дата
Msg-id 22797.1037600116@sss.pgh.pa.us
обсуждение исходный текст
Ответ на DBD::PostgreSQL  (David Wheeler <david@wheeler.net>)
Ответы Re: DBD::PostgreSQL  (David Wheeler <david@wheeler.net>)
Список pgsql-interfaces
David Wheeler <david@wheeler.net> writes:
> * In DBD::Pg's dbdimp.c, the dbd_db_commit() function attempts a 
> commit, and if it's successful, it then starts another transaction. Is 
> this the proper behavior? The other DBDs I looked at don't appear to 
> BEGIN a new transaction in the dbd_db_commit() function.
> * A similar question applies to dbd_db_rollback(). It does a rollback, 
> and then BEGINs a new transaction. Should it be starting another 
> transaction there?

Both of these seem pretty bogus to me.  Ideally the driver should not
issue a "begin" until the application issues the first command of the
new transaction.  Otherwise you get into scenarios where idle
connections are holding open transactions, and ain't nobody gonna be
happy with that.

> (BTW, I can see why preparsing would be necessary here!) Now, if I'm 
> understanding this correctly, the PREPARE statement would need to have 
> the data types of each of the parameters specified. Is this something 
> that's done in other DBI drivers?

Probably not --- the SQL spec seems to think that the server can intuit
appropriate datatypes for each parameter symbol.  (Which I suppose may
be true, in a datatype universe as impoverished as the spec's is;
but it won't work for Postgres.  Thus we have a nonstandard syntax for
PREPARE.)  So you'll probably have to do some driver-specific coding here.

No ideas about your other questions, but I hope the DBI folk can answer.

> Okay, sorry for all the questions. My motivation is to make a new 
> PostgreSQL DBI driver that's one of the best DBI drivers around. Any 
> help would go a long way toward helping me to reach my goal.

Go to it ;-)
        regards, tom lane


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

Предыдущее
От: David Wheeler
Дата:
Сообщение: DBD::PostgreSQL
Следующее
От: Ian Barwick
Дата:
Сообщение: Re: DBD::PostgreSQL