Thread: Beta of DBD::Pg 1.44 available

Beta of DBD::Pg 1.44 available

From
"Greg Sabino Mullane"
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


The first beta of DBD::Pg version 1.44 is now available at:

http://search.cpan.org/~dbdpg/

SHA1 and MD5 Checksums for the tarball:

1c8593d2bf66562ac9ff1f169bb02aabb178ad00  DBD-Pg-1.43_1.tar.gz
a5752ac6d69928f7a8b2254ae8377ee0  DBD-Pg-1.43_1.tar.gz

This version has some deep changes, so testing is much appreciated. In
particular, both the do() and quote() methods have been rewritten.
In addition, the get_info() information has been greatly expanded.
Information I was not sure about is marked with a "## ??" in the Pg.pm
code - anyone familiar with the ODBC / ANSI standards, please take a look.

Here is the complete list of changes:
- Added $dbh->{pg_default_port} method [GSM]- Overhaul get_info data, add many more values [GSM]- Overhaul type_info
data(fixes CPAN bug #13806) [GSM]- Explicitly prevent any parsing of statements for placeholders  unless they begin
with"SELECT", "INSERT", "UPDATE", or "DELETE"  Suggested by (and fixes) CPAN bug #13608 [GSM]- Rewrite some of the
quotingfunctions, reduce dependence  on libpq versions. [GSM]- Rewrite and optimize the do() method. Should be much
faster when called without placeholders. Thanks to Tom Lane  for suggesting this. [GSM]- Double check PQserverVersion
returnand use alternate  method if it returns 0 (CPAN bug #14302)- Add support for specifying type in $dbh->quote(),
suchas $dbh->quote($var, {pg_type => DBD::Pg::PG_BYTEA}).  Also support type => SQL_xx [GSM] (fixes CPAN bug #13942)-
Fixpg_notifies() bug (CPAN bug #14232) [door@lcpi.ru]- Add pg_ping() method [GSM]- Make sure ping returns true, even if
infailed transaction state.  [thanks to Bill Moseley] [GSM]- Fix COPY-related core dump [GSM]- Fix strncpy bug in
quote.c[Jun Kuriyama]- Fix error in is_high_bit_set(). [Alexey Tourbin] (CPAN bug #13406) 
 
- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200509132018
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFDJ2yFvJuQZxSWSsgRAg+xAKD6sNJTITEnLDYxpENjPWZinotGpwCfdI/+
tvg9CbWzz9B8jBf132dv/6o=
=ev63
-----END PGP SIGNATURE-----




Re: Beta of DBD::Pg 1.44 available

From
Sean Davis
Date:


On 9/13/05 8:24 PM, "Greg Sabino Mullane" <greg@turnstep.com> wrote:

> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> The first beta of DBD::Pg version 1.44 is now available at:
> 
> http://search.cpan.org/~dbdpg/
> 
> SHA1 and MD5 Checksums for the tarball:
> 
> 1c8593d2bf66562ac9ff1f169bb02aabb178ad00  DBD-Pg-1.43_1.tar.gz
> a5752ac6d69928f7a8b2254ae8377ee0  DBD-Pg-1.43_1.tar.gz
> 
> This version has some deep changes, so testing is much appreciated. In
> particular, both the do() and quote() methods have been rewritten.
> In addition, the get_info() information has been greatly expanded.
> Information I was not sure about is marked with a "## ??" in the Pg.pm
> code - anyone familiar with the ODBC / ANSI standards, please take a look.
> 
> Here is the complete list of changes:
> 
> - Added $dbh->{pg_default_port} method [GSM]
> - Overhaul get_info data, add many more values [GSM]
> - Overhaul type_info data (fixes CPAN bug #13806) [GSM]
> - Explicitly prevent any parsing of statements for placeholders
>  unless they begin with "SELECT", "INSERT", "UPDATE", or "DELETE"
>  Suggested by (and fixes) CPAN bug #13608 [GSM]

Greg,

Thanks for doing all of this.  I will give it a whirl.  Just a quick
question on the point directly above: does this imply that explain and
explain analyze are excluded from placeholder parsing?  I don't personally
use them programmatically, but I think that particularly for count(*) types
of queries or receiving estimates of the number of returned tuples without
executing the query, people could potentially use explain select....  Pardon
my laziness for not looking at the code for my own answers.

Thanks,
Sean



Re: Beta of DBD::Pg 1.44 available

From
"Greg Sabino Mullane"
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
>> - Explicitly prevent any parsing of statements for placeholders
>>  unless they begin with "SELECT", "INSERT", "UPDATE", or "DELETE"
>>  Suggested by (and fixes) CPAN bug #13608 [GSM] 
> Thanks for doing all of this.  I will give it a whirl.  Just a quick
> question on the point directly above: does this imply that explain and
> explain analyze are excluded from placeholder parsing?  I don't personally
> use them programmatically, but I think that particularly for count(*) types
> of queries or receiving estimates of the number of returned tuples without
> executing the query, people could potentially use explain select....  Pardon
> my laziness for not looking at the code for my own answers. 
Excellent question. There obviously needs to be a way around this, as your
explain scenario points out. I have another parameter "pg_client_prepare" waiting
in the wings for just such an occasion. The question becomes, do we make parsing
the default, and break lots of future apps that start using the "dollar-quoting"
feature, or do we make the default to only parse DML statements, possibly breaking
lots of older apps? I'm leaning heavily towards the latter, not least of which
is because the backend's PREPARE only accepts DML as well, but welcome any
discussion on the subject. A third (and probably best) option is to make the parser
inside of DBD::Pg recognize dollar-quoting. I'll play around with that one some
more. 
- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200509141424
https://www.biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 
-----BEGIN PGP SIGNATURE-----

iD8DBQFDKLeWvJuQZxSWSsgRAriGAJsG5AML1mv8qYGvaFYqQ1VYohaicgCgsHkN
gqzxS8R7GNH6NsF1kyBGfr0=
=GWQc
-----END PGP SIGNATURE-----




Re: Beta of DBD::Pg 1.44 available

From
Tom Lane
Date:
"Greg Sabino Mullane" <greg@turnstep.com> writes:
>> Thanks for doing all of this.  I will give it a whirl.  Just a quick
>> question on the point directly above: does this imply that explain and
>> explain analyze are excluded from placeholder parsing?

The existing approach for that isPREPARE foo(parameter types) AS SELECT ...EXPLAIN [ANALYZE] EXECUTE foo(parameter
values)

> ... A third (and probably best) option is to make the parser
> inside of DBD::Pg recognize dollar-quoting.

I think you need to do that, independently of anything else ...
        regards, tom lane


Re: Beta of DBD::Pg 1.44 available

From
"Greg Sabino Mullane"
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
>> ... A third (and probably best) option is to make the parser
>> inside of DBD::Pg recognize dollar-quoting. 
> I think you need to do that, independently of anything else ...

Yes, I agree, this is the route to go. Which will also solve the
original problem. Stay tuned for a beta2.

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200509152041
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

-----BEGIN PGP SIGNATURE-----

iD8DBQFDKhTQvJuQZxSWSsgRAh6VAJ4jNeRfrMfaTpGdcWzXuJUhd40MhQCguJFa
YeQqUW5tk2A7oBk/myEyPOA=
=2sWA
-----END PGP SIGNATURE-----