{"record":{"id":"fc1c98ef9185e555","repo":"dbt-labs/dbt-core","slug":"only-available-with-postgres-and-redshift-adapters","errorCode":null,"errorMessage":"only available with Postgres and Redshift adapters","messagePattern":"only available with Postgres and Redshift adapters","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-adapter/src/adapter/adapter_impl.rs","lineNumber":4786,"sourceCode":"\n        let tags = (&ColumnTagsLoader as &dyn ComponentConfigLoader<DatabricksRelationMetadata>)\n            .from_local_config(model)?;\n        Ok(tags.to_jinja())\n    }\n    /// Trims surrounding whitespace and strips a single trailing semicolon.\n    ///\n    /// DatabricksAdapter https://github.com/databricks/dbt-databricks/blob/2f11abb306a400cde32b27891b766bf41a11fb1f/dbt/adapters/databricks/impl.py#L966\n    pub fn clean_sql(&self, sql: &str) -> AdapterResult<String> {\n        debug_assert!(\n            self.adapter_type() == Databricks,\n            \"clean_sql is a Databricks-specific adapter operation\"\n        );\n        Ok(crate::relation::databricks::config::components::query::clean_sql(sql))\n    }\n\n    /// relation_max_name_length\n    pub fn relation_max_name_length(&self) -> AdapterResult<u32> {\n        unimplemented!(\"only available with Postgres and Redshift adapters\")\n    }\n\n    /// This uses the BigQuery SDK's copy_table API instead of SQL to properly handle partitioned\n    /// tables.\n    /// Reference: https://cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.client.Client.html#google_cloud_bigquery_client_Client_copy_table\n    ///\n    /// BigQueryAdapter https://github.com/dbt-labs/dbt-adapters/blob/0efd8d3d1081e1ab43e38797d5104f7b424a6284/dbt-bigquery/src/dbt/adapters/bigquery/impl.py#L510\n    pub fn copy_table(\n        &self,\n        state: &State,\n        conn: &'_ mut dyn Connection,\n        source: &Arc<dyn BaseRelation>,\n        dest: &Arc<dyn BaseRelation>,\n        materialization: String,\n        token: CancellationToken,\n    ) -> AdapterResult<()> {\n        match self.adapter_type() {\n            Bigquery => {","sourceCodeStart":4768,"sourceCodeEnd":4804,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-adapter/src/adapter/adapter_impl.rs#L4768-L4804","documentation":"`relation_max_name_length` is a stub on the generic AdapterImpl that deliberately panics via `unimplemented!` with the note that the maximum relation name length is only available with the Postgres and Redshift adapters. The Rust Fusion adapter has not ported this capability for other engines, so any call on a non-Postgres/Redshift adapter aborts the process/thread. It signals 'this API surface exists but is unimplemented for your adapter', not a runtime failure of your SQL.","triggerScenarios":"Calling `adapter.relation_max_name_length()` (typically from a macro or Jinja helper that queries the max identifier length) while the active adapter type is anything other than Postgres or Redshift — e.g. Snowflake, BigQuery, Databricks, DuckDB.","commonSituations":"Porting a dbt project from Postgres/Redshift to another warehouse whose macros call relation_max_name_length; running cross-adapter macro code that assumes the Python adapter behavior; testing adapter-agnostic SQL generation paths.","solutions":["Avoid calling relation_max_name_length on non-Postgres/Redshift adapters; hardcode or approximate the max length per target warehouse in your macro.","Guard the call with an adapter-type check (adapter.type() in ['postgres','redshift']) and provide a fallback value otherwise.","If you need this for another adapter, file/track an upstream feature request to implement relation_max_name_length for that engine."],"exampleFix":"// before\n{% set max_len = adapter.relation_max_name_length() %}\n// after\n{% set max_len = 63 if adapter.type() in ['postgres','redshift'] else 255 %}","handlingStrategy":"type-guard","validationCode":"// Rust\nfn supports_max_name_len(t: &AdapterType) -> bool {\n    matches!(t, AdapterType::Postgres | AdapterType::Redshift)\n}","typeGuard":"let max_len = if supports_max_name_len(&adapter.adapter_type()) {\n    Some(adapter.relation_max_name_length())\n} else { None };","tryCatchPattern":"// Jinja (macros cannot catch panics; guard instead)\n{% if adapter.type() in ['postgres', 'redshift'] %}\n  {% set max_len = adapter.relation_max_name_length() %}\n{% else %}\n  {% set max_len = 255 %}\n{% endif %}","preventionTips":["Check adapter type before calling adapter-specific methods","Keep adapter-specific capability calls in per-adapter dispatched macros","Search macros for relation_max_name_length when porting between warehouses"],"tags":["unimplemented","adapter","postgres","redshift"],"backgroundTag":"method-not-implemented","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}