Migration from SQL Server database to PostgreSQL database in corda

572 views Asked by At

We are using pgloader to migrate from a SQL Server database to a Postgresql database. During this process, I'm getting this exception:

Exception during node startup: Could not read entity state from ResultSet :
EntityKey[net.corda.node.internal.schemas.NodeInfoSchemaV1$DBPartyAndCertificate#O=N4-sh3, L=Mumbai, C=IN] [errorCode=1p2luf, moreInformationAt=https://errors.corda.net/OS/4.0/1p2luf]

org.hibernate.exception.DataException: Could not read entity state from ResultSet :
EntityKey[net.corda.node.internal.schemas.NodeInfoSchemaV1$DBPartyAndCertificate#O=N4-sh3, L=Mumbai, C=IN]

The column party_cert_binary is of type varbinary(max) in SQL Server. To what data type should this be converted in Postgresql?

I notice that some of the varbinary columns in SQL Server are converted to OID data type in Postgresql.

But pgloader by default converts all varbinary to bytea data type.

How should we convert varbinary data types to OID data type in pgloader tool?

1

There are 1 answers

1
AudioBubble On

bytea is a sensible choice as an equivalent for varbinary(max)

Using "large objects" (aka "oid") only make sense if you have values > 1GB or if you need the streaming capabilities that large objects offer.

If in doubt, stick with bytea