<@U088WCP3B4P> I am running schema change tests on...
# ask-elementary-ai
a
@kapa.ai I am running schema change tests on a postgres db and am running into this error Runtime Error in test elementary_source_schema_changes_from_baseline_public_timeline_logs_ (models/staging/_stg_public__sources.yml) Relation name '"test_66002f4014_elem__schema_baseline__tmp_20250521110256333910"' is longer than 63 characters
k
A message from kapa.ai
A message from kapa.ai
New message text here
There are several known issues and limitations when running Elementary schema change tests on a Postgres database: 1. Relation Name Length Limit: Postgres has a 63-character limit for relation (table) names. If your model or schema names are long, the temporary tables created by Elementary for schema change tests may exceed this limit, resulting in errors like:
Copy code
Relation name '"test_3833998b25_eleme__schema_changes__tmp_20231018180218723620"' is longer than 63 characters
The only workaround mentioned is to shorten your model or schema names to avoid hitting this limit. There is no indication in the knowledge sources of a built-in fix for this in Elementary itself at this time [Relation name too long issue](https://github.com/elementary-data/elementary/issues/1235). 2. Cross-Database References Not Allowed: Postgres does not support cross-database references. If your Elementary or dbt configuration tries to reference tables across different databases, you will encounter errors such as:
Copy code
ERROR: Cross-db references not allowed in postgres (elementary_dev vs dbt_dev)
This is a Postgres limitation, and you may need to adjust your schema/database setup or look into workarounds like foreign data wrappers, as discussed in the dbt community [Cross-db references not allowed](https://slack.com/archives/C02CTC89LAX/p1701400872234469). 3. Schema/Profiles Configuration Issues: If Elementary is looking for tables in the wrong schema, double-check your
profiles.yml
and ensure the correct schema is specified. Sometimes, a mismatch between your local and project
profiles.yml
can cause Elementary to look in the wrong place [Schema configuration issue](https://slack.com/archives/C02CTC89LAX/p1687777278488809). 4. Test Fails Due to Data Type Name Differences: The
schema_changes_from_baseline
test may fail if there are differences in how data types are named (e.g.,
VARCHAR
vs.
character varying
,
BOOL
vs.
boolean
). This can happen even if the underlying type hasn't changed, especially across different Postgres versions. There is no clear solution in the knowledge sources, but ensuring consistent environment versions and regenerating the baseline may help [Data type name differences](https://slack.com/archives/C02CTC89LAX/p1679319966726349). If you can share the specific error message you're seeing, I can help further narrow down the cause and potential solution.