On Mon, 2 Jun 2014 13:19:56 -0400, Greg Sabino Mullane
<g...@turnstep.com> wrote:

> Version 3.3.0 of DBD::Pg, DBI driver for PostgreSQL, is
> now available. This release enhances UTF-8 support a
> great deal, thanks to the work of Dagfinn Ilmari Mannsåker
> and Nicholas Clark. As always, you can find it on CPAN at:

I am unsure yet if I see this new UTF8 support as improvement for the
general public. An example:

--8<--- dbd-pg3.pl
#!/pro/bin/perl

use 5.18.2;
use warnings;

use DBI;

my $dbh = DBI->connect ("dbi:Pg:");
$dbh->{AutoCommit} = 1;

say "Connected with DBI-$DBI::VERSION using DBD::Pg-$DBD::Pg::VERSION (",
    $dbh->{pg_lib_version}, " -> ", $dbh->{pg_server_version}, ")";

$dbh->do ("create temp table hash (c_hash bytea primary key, v_hash bytea)");

my $stt = $dbh->prepare ("select * from hash");
   $stt->execute;
my @typ = @{$stt->{TYPE}};
   $stt->finish;
my $sth = $dbh->prepare ("insert into hash values (?, ?)");
   $sth->bind_param (1, undef, $typ[0]);
   $sth->bind_param (2, undef, $typ[1]);

say "c_hash $typ[0]\nv_hash $typ[1]";

$sth->execute ("key", "value");
$sth->execute ("eur", "\x{20ac}");

$sth->finish;
$dbh->do ("drop table hash");
$dbh->disconnect;
-->8---

Connected with DBI-1.631 using DBD::Pg-2.18.1 (90304 -> 90304)
c_hash -3
v_hash -3
Connected with DBI-1.631 using DBD::Pg-2.19.0 (90304 -> 90304)
c_hash -3
v_hash -3
Connected with DBI-1.631 using DBD::Pg-2.19.1 (90304 -> 90304)
c_hash -3
v_hash -3
Connected with DBI-1.631 using DBD::Pg-2.19.2 (90304 -> 90304)
c_hash -3
v_hash -3
Connected with DBI-1.631 using DBD::Pg-2.19.3 (90304 -> 90304)
c_hash -3
v_hash -3
Connected with DBI-1.631 using DBD::Pg-3.0.0 (90304 -> 90304)
c_hash -3
v_hash -3
Connected with DBI-1.631 using DBD::Pg-3.1.0 (90304 -> 90304)
c_hash -3
v_hash -3
Connected with DBI-1.631 using DBD::Pg-3.1.1 (90304 -> 90304)
c_hash -3
v_hash -3
Connected with DBI-1.631 using DBD::Pg-3.2.0 (90304 -> 90304)
c_hash -3
v_hash -3
Connected with DBI-1.631 using DBD::Pg-3.2.1 (90304 -> 90304)
c_hash -3
v_hash -3
Connected with DBI-1.631 using DBD::Pg-3.3.0 (90304 -> 90304)
c_hash -3
v_hash -3
Wide character in subroutine entry at /home/merijn/dbd-pg3.pl line 27.
Exit 255

That does *not* make me happy

> http://search.cpan.org/dist/DBD-Pg/
> 
> Checksums:
> 
> 547de1382a47d66872912fe64282ff55  DBD-Pg-3.3.0.tar.gz
> 9ec52d0d75463e6a448760e2d2fcbc41ca6201e1  DBD-Pg-3.3.0.tar.gz
> 
> Complete list of changes:
> 
> Version 3.3.0  Released May 31, 2014 (git commit 
> 055f788cf96b380b9fe0e80b6cedb88f8d1799b8)
> 
>   - Major cleanup of UTF-8 support:
>       Fix quoting of UTF-8 values
>       Add support for UTF-8 statement strings
>       Fix UTF-8 support in placeholders and return values
>     [Dagfinn Ilmari Mannsåker] (CPAN bug #95214 and #91655)
>       Test that the Pg server agrees with us about the lengths of input 
> strings.
>       Refactor Unicode test to use anon hashes to describe the tests to run.
>       Test pg_enable_utf8 of -1, in addition to 0 and 1.
>       Extend the Unicode round-trip tests to verify ASCII, BMP and non-BMP 
> code points.
>       Test that characters created in the server reach the client correctly.
> 
>   - Rewrite foreign_key_info to be just one query
>     [Dagfinn Ilmari Mannsåker]
> 
>   - Remove ODBC support from foreign_key_info
>     [Dagfinn Ilmari Mannsåker]
> 
>   - Remove use of dTHX in functions in quote.c and types.c
>     [Nicholas Clark]

-- 
H.Merijn Brand    mer...@procura.nl   (072) 567 13 51
PROCURA B.V.    http://www.procura.nl    KvK 37140650
Ban de e-mail disclaimers:  http://tinyurl.com/kmne65

Reply via email to