{"record":{"id":"ce7e6240dd5823a6","repo":"diesel-rs/diesel","slug":"expected-name-to-be-also-present-help-make-sure","errorCode":null,"errorMessage":"expected `name` to be also present\nhelp: make sure `name` is present, `#[diesel(postgres_type(name = \"...\", schema = \"{}\"))]`","messagePattern":"expected `name` to be also present\nhelp: make sure `name` is present, `#\\[diesel\\(postgres_type\\(name = \"\\.\\.\\.\", schema = \"(.+?)\"\\)\\)\\]`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"diesel_attribute_parser/src/parsers/postgres_type.rs","lineNumber":90,"sourceCode":"            \"the correct format looks like either `#[diesel({POSTGRES_TYPE_NOTE})]` or `#[diesel({POSTGRES_TYPE_NOTE_ID})]`\"\n        );\n\n        if let Some((_, name)) = name {\n            if let Some((oid, _)) = oid {\n                Err(syn::Error::new(\n                    oid.span(),\n                    format!(\"unexpected `oid` when `name` is present\\nhelp: {help}\"),\n                ))\n            } else if let Some((array_oid, _)) = array_oid {\n                Err(syn::Error::new(\n                    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    }","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/diesel-rs/diesel/blob/6fa6ed01b24b24248ab2a611698d0a7c6a2e9120/diesel_attribute_parser/src/parsers/postgres_type.rs#L72-L108","documentation":"Compile-time error validating #[diesel(postgres_type(...))] arguments. `schema = \"...\"` is only meaningful as a qualifier for a name-based lookup; this guard fires when `schema` is given without a `name` attribute in the same attribute list. Fix: add `name = \"...\"` alongside `schema`, or remove the schema argument.","triggerScenarios":"Thrown at diesel_attribute_parser/src/parsers/postgres_type.rs:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a `name = \"...\"` entry alongside `schema`","Remove `schema` if lookup by name is not intended"],"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"}