The thing is, I don't get what happens. In the PQConnection unit, there is this function:
procedure TPQConnection.GetExtendedFieldInfo(cursor: TPQCursor;
Bindings: TFieldBindings);
Var
tt,tc,Tn,S : String;
I,J : Integer;
Res : PPGResult;
toid : oid;
begin
s:='';
For I:=0 to Length(Bindings)-1 do
if (Bindings[i].TypeOID>0) then
begin
if (S<>'') then
S:=S+', ';
S:=S+IntToStr(Bindings[i].TypeOID);
end;
if (S='') then
exit;
Res:=Cursor.Handle.Exec(S,False,'Error getting typeinfo');
try
For I:=0 to PQntuples(Res)-1 do
begin
toid:=Strtoint(pqgetvalue(Res,i,0));
tn:=pqgetvalue(Res,i,1);
tt:=pqgetvalue(Res,i,2);
tc:=pqgetvalue(Res,i,3);
J:=length(Bindings)-1;
while (J>= 0) do
begin
if (Bindings[j].TypeOID=toid) then
Case tt of
'e':
Bindings[j].ExtendedFieldType:=eftEnum;
'citext':
Bindings[j].ExtendedFieldType:=eftCitext;
end;
Dec(J);
end;
end;
finally
PQClear(Res);
end;
end;
According to the code, it is used to convert the TypeOID of a field to the extended type info. The thing is, it executes a query, that consists of a list of numbers, separated by comma's: the TypeOID's. That's it. In this case there's just one: '3910'.
So, it doesn't execute something like this: "select extendedtype from infotable where type in (3910);" or such. Just "3910". Which gives an error, of course, as that isn't a valid query.
At the top of the unit, there is this definition, to muddy the waters:
// TField and TFieldDef only support a limited amount of fields.
// TFieldBinding and TExtendedFieldType can be used to map PQ types
// on standard fields and retain mapping info.
TExtendedFieldType = (eftNone,eftEnum,eftCitext);
TFieldBinding = record
FieldDef : TSQLDBFieldDef; // FieldDef this is associated with
Index : Integer; // Tuple index
TypeOID : oid; // Filled with type OID if it is not standard.
TypeName : String; // Filled with type name by GetExtendedFieldInfo
ExtendedFieldType: TExtendedFieldType; //
end;
Because that isn't what happens.