PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

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),