oid

PostgreSQL: from OID to Bytea

。_饼干妹妹 提交于 2019-12-04 10:08:17
We have decided to move from OID s in our PostgreSQL 9.0 database and use bytea columns instead. I'm trying to copy the data from one column to the other, but I can't figure out the right query. This is the closest I've gotten to: update user as thistable set pkcs_as_bytea = (select array_agg(mylargeobject.data) from (select * from pg_largeobject where loid = thistable.pkcs12_as_oid order by pageno) as mylargeobject) where thistable.pkcs12 is not null And that gives me the following error message: ERROR: column "pkcs_as_bytea" is of type bytea but expression is of type bytea[] What would be

Convert a bytea column to OID while retaining values

送分小仙女□ 提交于 2019-12-04 04:44:21
问题 I'm trying to alter a bytea column to have type oid and still retain the values. I have tried using queries like: ALTER TABLE mytable ADD COLUMN mycol_tmp oid; UPDATE mytable SET mycol_tmp = CAST(mycol as oid); ALTER TABLE mytable DROP COLUMN mycol; ALTER TABLE mytable RENAME mycol_tmp TO mycol; But that just gives me the error: ERROR: cannot cast type bytea to oid Is there any way to achieve what I want? 回答1: A column of type Oid is just a reference to the binary contents which are actually

How to find counters of printers through SNMP

ぐ巨炮叔叔 提交于 2019-12-02 02:52:23
问题 I'm currently working on a project, involving getting information from printers through SNMP. Now the printer I've been testing/working on, is a Lexmark X950. A problem I've been struggling with, is that I want this program to work for HP or Kyocera or Brother printers aswell, but the OIDs I used only seem to work on Lexmark. Here are some of the OIDs I used: <OID type="counter"> <name>Count total printed</name> <OIDN>1.3.6.1.4.1.641.2.1.5.1</OIDN> </OID> <OID type="counter"> <name>count

How to find counters of printers through SNMP

天大地大妈咪最大 提交于 2019-12-02 02:48:33
I'm currently working on a project, involving getting information from printers through SNMP. Now the printer I've been testing/working on, is a Lexmark X950. A problem I've been struggling with, is that I want this program to work for HP or Kyocera or Brother printers aswell, but the OIDs I used only seem to work on Lexmark. Here are some of the OIDs I used: <OID type="counter"> <name>Count total printed</name> <OIDN>1.3.6.1.4.1.641.2.1.5.1</OIDN> </OID> <OID type="counter"> <name>count total printed since last boot</name> <OIDN>1.3.6.1.2.1.43.10.2.1.5</OIDN> </OID> <OID type="counter"> <name

Convert a bytea column to OID while retaining values

梦想与她 提交于 2019-12-01 21:36:59
I'm trying to alter a bytea column to have type oid and still retain the values. I have tried using queries like: ALTER TABLE mytable ADD COLUMN mycol_tmp oid; UPDATE mytable SET mycol_tmp = CAST(mycol as oid); ALTER TABLE mytable DROP COLUMN mycol; ALTER TABLE mytable RENAME mycol_tmp TO mycol; But that just gives me the error: ERROR: cannot cast type bytea to oid Is there any way to achieve what I want? A column of type Oid is just a reference to the binary contents which are actually stored in the system's pg_largeobject table. In terms of storage, an Oid a 4 byte integer. On the other hand

Java Getting Name/Description for OIDs in MIB

末鹿安然 提交于 2019-12-01 05:25:28
I am programming a network management system, and need to be able to print out meaningful names behind the OIDs that are received from SNMP traps. Due to the nature/size of this system, it would not be a good idea to manually map every OID to a meaningful name for every MIB on every device that is being used. With that said, is there a free (commercial use) way of automatically pairing name/description with their respective OID for all OIDs in a MIB; and then those pairings be used in a Java program? In other words, is there a tool or method that will convert a MIB tree to Java objects that

Java Getting Name/Description for OIDs in MIB

ⅰ亾dé卋堺 提交于 2019-12-01 03:38:22
问题 I am programming a network management system, and need to be able to print out meaningful names behind the OIDs that are received from SNMP traps. Due to the nature/size of this system, it would not be a good idea to manually map every OID to a meaningful name for every MIB on every device that is being used. With that said, is there a free (commercial use) way of automatically pairing name/description with their respective OID for all OIDs in a MIB; and then those pairings be used in a Java

PostgreSQL数据类型:二进制bytea及大对象oid类型

左心房为你撑大大i 提交于 2019-11-29 07:37:51
参考资料 PostgreSQL Doc: http://www.postgresql.org/docs/9.2/static/datatype-binary.html PostgreSQL public API(LargeObject): http://jdbc.postgresql.org/documentation/publicapi/index.html PostgreSQL JDBC Interface: http://jdbc.postgresql.org/documentation/head/binary-data.html 二进制类型 bytea 的操作(在最大值内,有内存限制) Create table byteatable(id int,obj bytea); ①直接强制类型输入: Insert into byteatable values(1, '123'::bytea); //插入文本 ②直接插入逃逸序列 bytea 文本逃逸八进制 http://www.postgresql.org/docs/9.2/interactive/datatype-binary.html#DATATYPE-BINARY-TABLE 十进制数值 描述 输入逃逸形式 例子 输出形式 0 八进制的零 E'\\000' SELECT E'\\000'::bytea; \000 39 单引号

Hibernate, Postgresql: Column “x” is of type oid but expression is of type byte

拟墨画扇 提交于 2019-11-29 01:39:18
I have a strange problem regarding the hibernate mapping containing large objects (BLOB), when switching between different databases. @Lob private byte[] binaryData; The field above creates a byte array field in MySQL and in Oracle, however in PostreSQL it creates a field of type oid. Now when I try to access this field it works fine in the other databases, but in PostgreSQL it fails with the following error Column "binaryData" is of type oid but expression is of type bytea. So I tried to simply remove the "@Lob" annotation, which will solve the problem for PostgreSQL, however in MySQL without

How can I get MIBs list from a remote server by using PHP?

半世苍凉 提交于 2019-11-28 02:24:25
I am working on a project that involves SNMP. Basically I need to construct MIB and OID tree in PHP. I know that there are programs that do this already, but I am trying to implement my own version to incorporate with my webapp. What I know : I am familiar with php SNMP function. I can do SNMPWALk to get OIDs and such. Unfortunately there is no function that I know of that finds all MIBs and parses them. What I need : Get all MIB docs first from remote server, then based on each docs get their Objects. At the end my tree will have this structure: + mib-doc1 | - obc1 - obj2 + mib-doc2 | - obj1