PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB » Bug #6329

tableInfo() for postgres driver returns -1 as field length for type varchar

Details

Submitted2005-12-22 14:59 UTC
Fromccasal at centrixpr dot com
StatusWont fix
PackageDB
PHP Version4.3.9
OSLinux
Roadmaps(Not assigned)

Comments

[2005-12-22 14:59 UTC] ccasal at centrixpr dot com

Description:
------------
pear DB 1.7.6 stable

tableInfo() uses pg_fieldsize to determine length of field on table and pg_fieldsize returns the internal storage size of the postgres field, not the actual maximum length of field.

This causes a len = -1 on the array structure which tableInfo creates.

pg_fieldsize reference

http://www.php.net/manual/en/function.pg-field-size.php

Test script:
---------------
DB/pgsql.php line 938
-------------------

'len' => @pg_fieldsize($id, $i),