PostgreSQL UID

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

PostgreSQL UID

Postby NavigatorSW » 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:

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
Gold Boarder
Gold Boarder
Posts: 671
Joined: 17.01.2011, 14:17

Re: PostgreSQL UID

Postby marsupilami » 08.03.2018, 12:04

Closed because this is a duplicate of viewtopic.php?f=40&t=72757 . Please post there.


Return to “ZeosLib 7.1 stable Forum”

Who is online

Users browsing this forum: No registered users and 1 guest