Обсуждение: DBD::Pg 2.0.0 release candidate available for testing
-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 The first release candidate for the new version of DBD::Pg is now available for testing. This is a very major change from the current version (1.49), so if you are using DBD::Pg, it is highly recommended you test it out early and thoroughly, so we can iron out any problems before the final release. Among the major changes are: * Full support for arrays: Perl arrays are transformed to Postgres arrays automatically, and vice-versa. * Asynchronous queries, which let's you start a query, go off and do other things, and check back to see if it has finished, and fetch the data when you are ready to. This also allows you to cancel running queries. * The minimum supported version of Postgres is now 7.4. * Experimental support for bind_param_inout(). The complete list is in the Changes file: http://svn.perl.org/modules/DBD-Pg/trunk/Changes The tarball can be downloaded here: http://svn.perl.org/modules/DBD-Pg/trunk/DBD-Pg-2.0.0_1.tar.gz SHA1 for this file: ec9badc51a1a987215553e4e6fee0c0955cfa8b3 DBD-Pg-2.0.0_1.tar.gz Please direct any DBD-Pg specific responses, or any other questions or bug reports, to dbd-pg@perl.org. This version also implements three other major changes: * Moved from gborg to perl.org * Moved from cvs to subversion. * Moved from two-part to three-part version numbers. - -- Greg Sabino Mullane greg@turnstep.com End Point Corporation PGP Key: 0x14964AC8 200801152251 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iD8DBQFHjYTrvJuQZxSWSsgRA9MrAKCv9HjRfE8bPyBQnEYB1vJHTVNR+ACg4dng iddOoa9K4gOpMbXi1BPY5xc= =Ef/I -----END PGP SIGNATURE-----
Greg Sabino Mullane wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: RIPEMD160 > > > The first release candidate for the new version of DBD::Pg is > now available for testing. This is a very major change from the > current version (1.49), so if you are using DBD::Pg, it is highly > recommended you test it out early and thoroughly, so we can iron > out any problems before the final release. > > Among the major changes are: > > * Full support for arrays: Perl arrays are transformed to Postgres > arrays automatically, and vice-versa. I presume this is "array type stored in a column", not "array for bulk loading" ? Does Pg support native array binding of tuples yet ? The docs could be a bit confusing. E.g., I'm not certain what "Supported by this driver as proposed by DBI." means ? You may want to clarify that bit, and the difference between "bind array to a column" vs. "binding an array of parameters") Esp., does the COPY IN support native array binding (not the DBI default iterator) ? > > * Asynchronous queries, which let's you start a query, go off and do > other things, and check back to see if it has finished, and fetch the > data when you are ready to. This also allows you to cancel running queries. > Groovy! I'll have to give this a go w/ DBIx::Threaded's async wrappers. BTW: Do you have any examples that are "smarter" about testing ready() ? I.e., grab the Pg socket, do a select() or poll(), and only call ready() when there's activity on the socket ? I've implemented a driver-specific function in DBD::Teradata to do that internally (essentially, a select() for $dbh's + other filehandles). Might be something to consider for Pg (I'd suggest support at the DBI layer, except some drivers (e.g., ODBC) may not have access to the underlying communication channel. Great work! Dean Arnold Presicient Corp.
-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 >> * Full support for arrays: Perl arrays are transformed to Postgres >> arrays automatically, and vice-versa. > I presume this is "array type stored in a column", > not "array for bulk loading" ? Correct. > Does Pg support native array binding of tuples yet ? The docs could be > a bit confusing. E.g., I'm not certain what "Supported by this driver > as proposed by DBI." means ? You may want to clarify that bit, and the > difference between "bind array to a column" vs. "binding an array > of parameters") It does both, if I am understanding you correctly. That is, you can do: $sth->execute([1,2,3]); ## or more nested $sth->execute($myarrayref); as well as: $sth->bind_param_array(1, [ 30, 31, 32 ], SQL_INTEGER); ...which do very different things, of course. > Esp., does the COPY IN support native array binding (not the DBI > default iterator) ? Don't follow you at all here, but I suspect the answer is "no" if you mean putting pg_getcopydata into an arrayref. >> * Asynchronous queries, which let's you start a query, go off and do >> other things, and check back to see if it has finished, and fetch the >> data when you are ready to. This also allows you to cancel running queries. > BTW: Do you have any examples that are "smarter" about > testing ready() ? I.e., grab the Pg socket, do a select() or poll(), > and only call ready() when there's activity on the socket ? No, I've left that as an exercise to the reader, or in this case, the application writer. :) Should be easy enough to modify the example here: http://www.postgresql.org/docs/current/interactive/libpq-example.html Doc patches always welcome, naturally. > I've implemented a driver-specific function in DBD::Teradata to > do that internally (essentially, a select() for $dbh's + other filehandles). > Might be something to consider for Pg (I'd suggest support > at the DBI layer, except some drivers (e.g., ODBC) may not have access > to the underlying communication channel. I wouldn't let that stop you - there are lots of bits of DBI that are not usable and/or implemented by various DBDs, right? I'd also love to see some more standardizing and eventually deprecate as many of the pg_* functions as we can. Thanks for the feedback - -- Greg Sabino Mullane greg@turnstep.com End Point Corporation PGP Key: 0x14964AC8 200801171054 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iD8DBQFHj3pIvJuQZxSWSsgRA7pgAKDHONFc5lb0pTmL1IJUpvObArrXhwCffZPM RCidp40mCrPWLuE4xpGmyaw= =KydL -----END PGP SIGNATURE-----