问题描述
我们正在使用pg工具从postgres数据库导出数据并将其从一个服务器实例导入到另一个服务器实例:
例如:导出:
pg_dump.exe --file "my_table.sql" --host %connectionHost% --port "5432" --no-owner --username 'myUserName' --no-password --verbose --format=c --blobs --table "table_name" "MyDatabase"
例如:导入
pg_restore.exe --host "myhost" --port "5432" --username "myUserName" --no-password --dbname "MyDatabase" --data-only --verbose --schema "public" --table "table_name" "my_table.sql"
导出或导入数据时都没有错误。
但是,当我尝试打开具有bytea(Lob)
类型列的页面时,应用程序将失败,并在日志中显示以下错误消息:
org.springframework.orm.jpa.JpaSystemException: Unable to access lob stream; nested exception is org.hibernate.HibernateException: Unable to access lob stream
...
Caused by: org.hibernate.HibernateException: Unable to access lob stream
at org.hibernate.type.descriptor.java.DataHelper.extractString(DataHelper.java:270)
...
Caused by: org.postgresql.util.PSQLException: ERROR: large object 32882 does not exist
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455)
我的休眠资源带有@Transactional
的注释
当我们在空实例中创建新数据时,只有当我们将数据从一个实例导出到另一个实例时,才会出现此问题。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)