On 23 Apr 2002 15:54:49 -0400
Jeff Boes <[EMAIL PROTECTED]> wrote:
> I've encountered a problem with the statement handle's pg_type
> attribute, under DBI 1.21 and DBD::Pg 1.12.
>
> Assuming a table that looks like this:
>
> CREATE TABLE foo ( bar numeric(2,1) );
>
>
> My script looks like this:
>
> use strict;
> use English;
>
> use DBI;
>
> my $dbh = DBI->connect('dbi:Pg:dbname=...','...','...')
> or die $DBI::errstr;
>
> my $sth = $dbh->prepare('SELECT * FROM foo WHERE FALSE')
> or die $DBI::errstr;
>
> $sth->execute
> or die $DBI::errstr;
>
> my @types = @{ $sth->{pg_type} };
> foreach my $i (0..$sth->{NUM_OF_FIELDS}-1) {
> print $types[$i], "\n";
> print $sth->{pg_type}[$i], "\n";
> }
>
> If you run this, you'll get some unprintable output from the first print
> statement, and the second print causes a segmentation fault.
>
> --
> Jeff Boes vox 616.226.9550 ext 24
> Database Engineer fax 616.349.9076
> Nexcerpt, Inc. http://www.nexcerpt.com
> ...Nexcerpt... Extend your Expertise
>
>
I tried this script under FreeBSD, running PG 7.2.1, DBI 1.20, DBD::Pg 1.01 and
it works perfectly.
I'm going to dig up DBD::Pg 1.12 and see what happens.
Either someone broke it or it is platform dependent.
GB
--
GB Clark II | Roaming FreeBSD Admin
[EMAIL PROTECTED] | General Geek
CTHULU for President - Why choose the lesser of two evils?