英文:
Retrieve value from a oid type in PostgreSql
问题
如何从PostgreSQL中的oid列类型中检索值。此表是由应用程序生成的,而不是由用户生成的,根据产品文档的描述,它以二进制格式存储事务数据。当我浏览数据时,它的最大长度为6或7,但当我将产品配置到另一个数据库,如H2时,我可以看到在相同列中存储了更多的数据。
英文:
How to retrieve values from an oid column type in PostgreSQL This table is generated by an application and not by the user, and as per the documentation of the product, it says that it stores transaction data in binary format. When I browse through the data, it has a maximum length of 6 or 7, but when I configure the product with another database, like H2, I can see more data stored in the same column.
答案1
得分: 0
这是因为您似乎正在使用大对象。您不应该这样做,而应该使用bytea
,它将按您的期望行事。大对象是一项传统功能,可能会给您带来各种麻烦。
您必须明确使用该oid
打开并读取大对象。
英文:
That's because you seem to be using large objects. You shouldn't be doing that, but use bytea
instead, which would behave as you expect. Large objects are a legacy feature that is likely to cause all kinds of trouble for you.
You have to open an read the large object with that oid
explicitly.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论