it's tested with pglib v8 against a postgres v8. i don't know, if it fits to other versions!
the array field is handled as a memo field. the formatting of array values is
{v1,v2,v3}
lines to be added:
in file "\src\dbc\ZDbcPostgreSqlUtils.pas":
function "PostgreSQLToSQLType" (around line 284)
Code: Select all
----- orig -----
else if (TypeName = 'int2vector') or (TypeName = 'oidvector')
or (TypeName = '_aclitem') then
Result := stAsciiStream
----- new -----
// CHANGED 2007-01 MS
else if (TypeName[1] = '_') then // ARRAY TYPES
Result := stAsciiStream
----- orig -----
else
Result := stUnknown;
end;
in file "\src\dbc\ZDbcPostgreSqlUtils.pas":
function "PostgreSQLToSQLType" (around line 328)
Code: Select all
----- orig -----
1042: Result := stString; { bpchar }
22,30: Result := stAsciiStream; { int2vector/oidvector. no '_aclitem' }
----- new -----
// CHANGED 2007-01 MS
651, 1000..1028: Result := stAsciiStream;
----- orig -----
else
Result := stUnknown;
end;
end;
if you use the official 6.6, you need to add one more line
in file "\src\plain\ZPlainPostgreSqlDriver.pas":
function "TZPostgreSQL8PlainDriver.DecodeBYTEA" (around line 995)
Code: Select all
----- orig -----
decoded:=ZPlainPostgreSql8.PQunescapeBytea(pansichar(value),@len);
SetLength(result,len);
dest:=pchar(result);
----- new -----
// CHANGED 2007-01 MS
if len > 0 then
----- orig -----
Move(decoded^,result[1],len);
ZPlainPostgreSql8.PQFreemem(decoded);
end;
Enjoy it!
Cheers,
Marco