Re: Text type reported incorrectly

"Greg Sabino Mullane" <greg-738XdyZ4GzZWk0Htik3J/[email protected]>
Newsgroups gmane.comp.db.postgresql.dbdpg
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


>  my $sth = $dbh->prepare("select * from foo");
>  $sth->execute();
>  print "TYPE: $sth->{TYPE}[0]\nPRECISION: $sth->{PRECISION}[0]\n";
>
> you'll be told that the type is 12 (same as varchar) and the precision
> is 80.  This is indistinguishable from a varchar(76), but the types
> are very different.

Please try out the latest subversion version and see if it responds more 
in line with what you expect (I've completely rewritten great swaths of the 
types mapping system in the last month). Right now TEXT is mapped to 
SQL_LONGVARCHAR, which returns a {TYPE} of -1. You might also want to consider 
using $sth->{pg_type}, which returns 'text', as the mapping from Postgres types to SQL 
types is limited due to going from the specific to the abstract, and {TYPE} should 
only be used for cross-RDBMS applications.

- --
Greg Sabino Mullane greg-738XdyZ4GzZWk0Htik3J/[email protected]
End Point Corporation
PGP Key: 0x14964AC8 200708191734
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFGyLd4vJuQZxSWSsgRA3iJAKCIiEMq8GIriPWxknLv/ZSUDgNBkACg9KUf
oUVzLI6CxBsx/HLUvxqGShQ=
=auPV
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.