{"id":"7a0deb9a77eecc95","repo":"jackc/pgx","slug":"unknown-format-code-d-7a0deb","errorCode":null,"errorMessage":"unknown format code %d","messagePattern":"unknown format code (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/record_codec.go","lineNumber":88,"sourceCode":"\t}\n\n\treturn nil\n}\n\nfunc (RecordCodec) DecodeDatabaseSQLValue(m *Map, oid uint32, format int16, src []byte) (driver.Value, error) {\n\tif src == nil {\n\t\treturn nil, nil\n\t}\n\n\tswitch format {\n\tcase TextFormatCode:\n\t\treturn string(src), nil\n\tcase BinaryFormatCode:\n\t\tbuf := make([]byte, len(src))\n\t\tcopy(buf, src)\n\t\treturn buf, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown format code %d\", format)\n\t}\n}\n\nfunc (RecordCodec) DecodeValue(m *Map, oid uint32, format int16, src []byte) (any, error) {\n\tif src == nil {\n\t\treturn nil, nil\n\t}\n\n\tswitch format {\n\tcase TextFormatCode:\n\t\treturn string(src), nil\n\tcase BinaryFormatCode:\n\t\tscanner := NewCompositeBinaryScanner(m, src)\n\t\t// The field count is a hint for the initial allocation only. Append the\n\t\t// values actually present rather than indexing into a presized slice, as\n\t\t// the source may carry more or fewer fields than the header claims.\n\t\tvalues := make([]any, 0, scanner.FieldCount())\n\t\tfor scanner.Next() {","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/record_codec.go#L70-L106","documentation":"Error \"unknown format code %d\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/record_codec.go:88 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","schemaVersion":2}