Postgresql 弹簧靴vs Postgres vs蟑螂->;fastpath函数lo_creat未知

Postgresql 弹簧靴vs Postgres vs蟑螂->;fastpath函数lo_creat未知,postgresql,spring-boot,cockroachdb,Postgresql,Spring Boot,Cockroachdb,在我的Spring boot应用程序中将Postgres改为Cockroach后,我开始遇到以下问题: The fastpath function lo_creat is unknown. 然后记录: org.postgresql.util.PSQLException: The fastpath function lo_creat is unknown. at org.postgresql.fastpath.Fastpath.getID(Fastpath.java:297) ~[pos

在我的Spring boot应用程序中将Postgres改为Cockroach后,我开始遇到以下问题:

The fastpath function lo_creat is unknown.
然后记录:

org.postgresql.util.PSQLException: The fastpath function lo_creat is unknown.
    at org.postgresql.fastpath.Fastpath.getID(Fastpath.java:297) ~[postgresql-42.2.14.jar!/:42.2.14]
    at org.postgresql.fastpath.Fastpath.fastpath(Fastpath.java:146) ~[postgresql-42.2.14.jar!/:42.2.14]
    at org.postgresql.fastpath.Fastpath.getInteger(Fastpath.java:158) ~[postgresql-42.2.14.jar!/:42.2.14]
    at org.postgresql.fastpath.Fastpath.getOID(Fastpath.java:209) ~[postgresql-42.2.14.jar!/:42.2.14]
    at org.postgresql.largeobject.LargeObjectManager.createLO(LargeObjectManager.java:295) ~[postgresql-42.2.14.jar!/:42.2.14]
    at org.postgresql.largeobject.LargeObjectManager.createLO(LargeObjectManager.java:278) ~[postgresql-42.2.14.jar!/:42.2.14]
    at org.postgresql.jdbc.PgPreparedStatement.setClob(PgPreparedStatement.java:1215) ~[postgresql-42.2.14.jar!/:42.2.14]
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.setClob(HikariProxyPreparedStatement.java) ~[HikariCP-3.4.5.jar!/:na]

  
在spring boot中是否有一个简单的解决方法?因为它似乎不适用于蟑螂


它似乎与hibernate和DB文本字段有关。

您认为CockroachDB与PostgreSQL兼容


但是,它们的兼容性似乎没有扩展到大型对象,因此您不应该调用
org.postgresql.largeobject.LargeObjectManager

Spring Boot应该允许您配置DB方言。能否尝试设置以下各项:

spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.CockroachDB201Dialect

CockroachDB方言应该避免使用这些LOB函数。

一般来说,不建议在Postgres中使用“大对象”。使用
bytea
PreparedStatement.setBytes()
是一个更好的选择使用模式注册表应用程序。。。我没有机会改变的地方:(