problems ...* pg_field_prtlen ... gives the actual size of the field back (it shows the count of the content allready inside the field - not the possible max-len)* pg_filed_size ... can't be used for varchar or bpchar fields

...but there is a way to get the real-max-length of a field in postgreSQL via the system tables:

//returns an array with infos of every field in the table (name, type, length, size)function SQLConstructFieldsInfo($TABLE, $DBCON){ $s="SELECT a.attname AS name, t.typname AS type, a.attlen AS size, a.atttypmod AS len, a.attstorage AS i FROM pg_attribute a , pg_class c, pg_type t WHERE c.relname = '$TABLE' AND a.attrelid = c.oid AND a.atttypid = t.oid";