PostgreSQL UID

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
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?

Thank you and best regards.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: PostgreSQL UID

Post by marsupilami »

Hello,

Zeos 7.1 will not see any updates anymore. Zeos 7.2 should support reading and writing GUIDs for PostgreSQL for about 6 months now. Could you please check wether the current SVN version of Zeos 7.2 works for you and report problems here?

With best regards,

Jan
NavigatorSW
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 08.03.2018, 11:47

Re: PostgreSQL UID

Post by NavigatorSW »

We are using 7.2.1-rc downloaded in December 2017.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: PostgreSQL UID

Post by marsupilami »

Hello, could you please try the current release candidate 7.2.3?
Post Reply