>From what I can make out, the following code should return the Local
Type Name for each column in the select. Now, nine times out of ten it
does. However there are holes. For example $sth->{TYPE} in the example
below returns [4, 12, 1184]. There's no problem with 4 () or 12 (), but
1184? What is that? There's no corresponding entry in data_types_all().
Am I missing something? Is this broken? Is it broken in Pg or in DBI?

Cheers!
Rick

== PERL CODE FOLLOWS ==

use DBI;

$dbh = DBI->connect("dbi:Pg:dbname=rickm", "", "");

$sth = $dbh->prepare("select Id, Name, datetest from users");
$sth->execute;

foreach (@{ $sth->{TYPE} }) {
        printf("%4s : %s\n",  $_, (eval{$dbh->type_info($_)->{LOCAL_TYPE_NAME}}
|| "UNKNOWN DATA TYPE"));
}

== PERL CODE ENDS ==

== RESULT FOLLOWS ==
   4 : INTEGER
  12 : TEXT
1184 : UNKNOWN DATA TYPE
== RESULT ENDS ==

Reply via email to