PostgreSQL UID
Posted: 08.03.2018, 11:54
Hi,
After every upgrade to Zeos 7.2/7.1 we are dealing with the following problem:
-we are using UID types in PostgreSQL and in unit ZDbcPostgreSqlUtils, function PostgreSQLToSQLType we must update the script to:
-in the same unit, PostgreSQLToSQLType function
-in unit ZDbcPostgreSqlResultSet DefinePostgreSQLToSQLType procedure:
-in unit ZDbcPostgreSqlResultSet GetBytes function:
Could you update it in the original code or could you give a solution for UID types?
I placed the same request to 7.2 forum also.
Thank you and best regards.
After every upgrade to Zeos 7.2/7.1 we are dealing with the following problem:
-we are using UID types in PostgreSQL and in unit ZDbcPostgreSqlUtils, function PostgreSQLToSQLType we must update the script to:
Code: Select all
else if (TypeName = 'int2vector') or (TypeName = 'oidvector') then
Result := stAsciiStream
else if (TypeName <> '') and (TypeName[1] = '_') then // ARRAY TYPES
Result := stAsciiStream
else if (TypeName = 'uuid') then
Result := stGUID
else
Result := stUnknown;
Code: Select all
1270,1561,1563,2201,2207..2211,2949,2951,3643,3644,3645,3735,3770 : { other array types }
Result := stAsciiStream;
2950: Result := stGuid;
else
Code: Select all
case TypeOid of
2950: ColumnInfo.Precision := 38; { uuid }
790: ColumnInfo.Currency := True; { money }
Code: Select all
end else if FpgOIDTypes[ColumnIndex] = 26 { oid } then
Result := TZPostgreSQLOidBlob.Create(FPlainDriver, nil, 0, FHandle,
RawToIntDef(FPlainDriver.GetValue(FQueryHandle, RowNo - 1, ColumnIndex), 0), FChunk_Size).GetBytes
else if FpgOIDTypes[ColumnIndex] = 2950 {uuid} then begin
TempString := '{' + DecodeString(InternalGetString(ColumnIndex{$IFNDEF GENERIC_INDEX}+1{$ENDIF})) + '}';
SetLength(Result, 16);
ValidGUIDToBinary(PAnsiChar(@TempString[1]), @Result[0]);
end else
Result := StrToBytes(DecodeString(InternalGetString(ColumnIndex)));
Could you update it in the original code or could you give a solution for UID types?
I placed the same request to 7.2 forum also.
Thank you and best regards.