PostgreSQL UID

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
Locked
NavigatorSW
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 08.03.2018, 11:47

PostgreSQL UID

Post by NavigatorSW »

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:

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;
-in the same unit, PostgreSQLToSQLType function

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
-in unit ZDbcPostgreSqlResultSet DefinePostgreSQLToSQLType procedure:

Code: Select all

  case TypeOid of
    2950: ColumnInfo.Precision := 38; { uuid }
    790: ColumnInfo.Currency := True; { money }
-in unit ZDbcPostgreSqlResultSet GetBytes function:

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.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1962
Joined: 17.01.2011, 14:17

Re: PostgreSQL UID

Post by marsupilami »

Closed because this is a duplicate of http://zeoslib.sourceforge.net/viewtopi ... 40&t=72757 . Please post there.
Locked