I remember having some issues like this, and the need to get more informations than what Fieldschema was returning.
so I asked postgres directly about his schema like this, at the beginning of the app to store it localy in app properties.
this method is in a database subclass. "Alerte" method is like msgbox.
Private Sub postgresLoadFieldSchema(forceReload as Boolean = False, schemaName as String="public")
' --------------------------------------------------------------------------------
' lire toutes les fields d'une base PostgreSQL en direct
' --------------------------------------------------------------------------------
dim ch as String
dim rs2 as RecordSet
if UBound(postgresField_table_name)<0 or forceReload then
' liste toutes les fields de la base et les stocke localement une seule fois
' table_name,column_name,ordinal_position,data_type,is_nullable,character_maximum_length
ch = "SELECT table_name,column_name,ordinal_position,data_type,is_nullable,character_maximum_length,udt_name FROM information_schema.columns WHERE table_schema = '"
ch = ch + schemaName +"' ORDER BY table_name,ordinal_position ASC"
rs2 = SQLSelect( ch)
if rs2<>nil then
do
postgresField_table_name.Append rs2.IdxField(1).StringValue
postgresField_column_name.Append rs2.IdxField(2).StringValue
postgresField_ordinal_position.Append rs2.IdxField(3).StringValue
postgresField_data_type.Append rs2.IdxField(7).StringValue // udt_name est plus explicite
postgresField_is_nullable.Append rs2.IdxField(5).StringValue
postgresField_character_maximum_length.Append rs2.IdxField(6).StringValue
rs2.MoveNext
loop until rs2.EOF
else
Alerte "postgresLoadFieldSchema: rs2 is nil !"
end if
end if
End Sub