{"record":{"id":"85580ca02890b668","repo":"apache/shardingsphere","slug":"can-not-find-value-s-in-postgresql-column-type","errorCode":null,"errorMessage":"Can not find value `%s` in PostgreSQL column type.","messagePattern":"Can not find value `(.+?)` in PostgreSQL column type\\.","errorType":"exception","errorClass":"PostgreSQLProtocolException","httpStatus":null,"severity":"error","filePath":"database/protocol/dialect/postgresql/src/main/java/org/apache/shardingsphere/database/protocol/postgresql/packet/command/query/extended/PostgreSQLBinaryColumnType.java","lineNumber":279,"sourceCode":"     */\n    public static boolean isUUID(final int jdbcType, final String columnTypeName) {\n        return Types.OTHER == jdbcType && \"uuid\".equalsIgnoreCase(columnTypeName);\n    }\n    \n    /**\n     * Value of.\n     *\n     * @param value value\n     * @return PostgreSQL column type\n     * @throws PostgreSQLProtocolException PostgreSQL protocol exception\n     */\n    public static PostgreSQLBinaryColumnType valueOf(final int value) {\n        for (PostgreSQLBinaryColumnType each : values()) {\n            if (value == each.value) {\n                return each;\n            }\n        }\n        throw new PostgreSQLProtocolException(\"Can not find value `%s` in PostgreSQL column type.\", value);\n    }\n}\n","sourceCodeStart":261,"sourceCodeEnd":282,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/database/protocol/dialect/postgresql/src/main/java/org/apache/shardingsphere/database/protocol/postgresql/packet/command/query/extended/PostgreSQLBinaryColumnType.java#L261-L282","documentation":"Thrown by PostgreSQLBinaryColumnType.valueOf(int) when the integer value does not match any enum constant. The PostgreSQL wire protocol identifies column types by integer type OIDs; this lookup maps an OID received in a packet (e.g. from a Bind/Describe exchange or a client-driven extended query) to the known binary column type set. An unknown OID means the peer sent a type identifier this build of the protocol dialect does not recognize.","triggerScenarios":"A client or upstream driver sends a Parse/Bind/Describe message whose parameter or result column type OID is not one of the OIDs enumerated in PostgreSQLBinaryColumnType (e.g. a newly added PostgreSQL type OID, or a custom type), and the packet parser calls PostgreSQLBinaryColumnType.valueOf(value) while decoding.","commonSituations":"Using a PostgreSQL server/driver version newer than the ShardingSphere build (new OIDs), proxying custom extension types, or a malformed/fuzzed packet containing garbage type integers.","solutions":["Check which type OID the client actually sent (enable protocol/packet logging) and identify the PostgreSQL type it maps to","Upgrade ShardingSphere to a version whose protocol dialect knows that OID","If the OID is a custom/extension type, bind the parameter as text format or cast it to a supported built-in type in the SQL","File an issue with the OID value so the enum can be extended"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"int oid = ...; // from packet\nboolean known = java.util.Arrays.stream(PostgreSQLBinaryColumnType.values()).anyMatch(t -> t.getValue() == oid);\nif (!known) { /* reject or fall back to text format before binding */ }","typeGuard":null,"tryCatchPattern":"catch (PostgreSQLProtocolException e) { if (e.getMessage().contains(\"PostgreSQL column type\")) { /* log OID, fall back to text parameter format */ } throw e; }","preventionTips":["Prefer text format for bind parameters of custom/extension types","Keep ShardingSphere version aligned with the newest PostgreSQL server you proxy","Log unknown OIDs once at protocol level to detect client/driver mismatches early"],"tags":["postgresql","protocol","type-oid","enum-lookup"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}