{"record":{"id":"99ddd446bf5c4e07","repo":"diesel-rs/diesel","slug":"expected-oid-and-array-oid-attribute-or-name","errorCode":null,"errorMessage":"expected `oid` and `array_oid` attribute or `name` attribute\nhelp: {help}","messagePattern":"expected `oid` and `array_oid` attribute or `name` attribute\nhelp: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"diesel_attribute_parser/src/parsers/postgres_type.rs","lineNumber":101,"sourceCode":"                    array_oid.span(),\n                    format!(\"unexpected `array_oid` when `name` is present\\nhelp: {help}\"),\n                ))\n            } else {\n                Ok(PostgresType::Lookup(name, schema.map(|s| s.1)))\n            }\n        } else if let Some((schema, lit)) = schema {\n            Err(syn::Error::new(\n                schema.span(),\n                format!(\n                    \"expected `name` to be also present\\n\\\n                     help: make sure `name` is present, `#[diesel(postgres_type(name = \\\"...\\\", schema = \\\"{}\\\"))]`\",\n                    lit.value()\n                ),\n            ))\n        } else if let (Some((_, oid)), Some((_, array_oid))) = (oid, array_oid) {\n            Ok(PostgresType::Fixed(oid, array_oid))\n        } else {\n            Err(syn::Error::new(\n                input.span(),\n                format!(\n                    \"expected `oid` and `array_oid` attribute or `name` attribute\\nhelp: {help}\"\n                ),\n            ))\n        }\n    }\n}\n","sourceCodeStart":83,"sourceCodeEnd":110,"githubUrl":"https://github.com/diesel-rs/diesel/blob/6fa6ed01b24b24248ab2a611698d0a7c6a2e9120/diesel_attribute_parser/src/parsers/postgres_type.rs#L83-L110","documentation":"Compile-time error validating #[diesel(postgres_type(...))] arguments. This is the completeness check of validate_and_build: when neither the oid form (`oid`/`array_oid`) nor the name form (`name`, optionally with `schema`) was supplied, the attribute identifies nothing and this fallback error fires with a help line describing both accepted formats. Fix: provide either `name = \"...\"` or `oid = ...`/`array_oid = ...`.","triggerScenarios":"Thrown at diesel_attribute_parser/src/parsers/postgres_type.rs:101 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide both `oid` and `array_oid`","Provide `name = \"...\"` for lookup by name"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6fa6ed01b24b24248ab2a611698d0a7c6a2e9120","analyzedAt":"2026-09-07T01:50:13.074Z","contentChangedAt":"2026-09-07T01:50:13.074Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}