-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Long table names can be truncated on Postgres (at least) silently #2197
Labels
bug
Something isn't working
good_first_issue
Straightforward + self-contained changes, good for new contributors!
redshift
snapshots
Issues related to dbt's snapshot functionality
Milestone
Comments
drewbanin
added
bug
Something isn't working
redshift
snapshots
Issues related to dbt's snapshot functionality
labels
Mar 11, 2020
5 tasks
5 tasks
drewbanin
added
the
good_first_issue
Straightforward + self-contained changes, good for new contributors!
label
Jun 24, 2020
Add a runtime error to |
4 tasks
elexisvenator
added a commit
to elexisvenator/dbt
that referenced
this issue
Oct 26, 2020
Related: dbt-labs#2197 The currently postgres `make_temp_relation` adds a 29 character suffix to the end of the temp relation identifier (9 from default suffix and 20 from timestamp). This is a problem now that relations with more than 63 characters raise exceptions. The fix is to shorten the suffix and also trim the base_relation identifier so that the total length is always less than 63 characters. An exception can also be raised if the default suffix is overridden with a value that is too long.
4 tasks
elexisvenator
added a commit
to elexisvenator/dbt
that referenced
this issue
Nov 3, 2020
Related: dbt-labs#2197 The currently postgres `make_temp_relation` adds a 29 character suffix to the end of the temp relation identifier (9 from default suffix and 20 from timestamp). This is a problem now that relations with more than 63 characters raise exceptions. The fix is to shorten the suffix and also trim the base_relation identifier so that the total length is always less than 63 characters. An exception can also be raised if the default suffix is overridden with a value that is too long.
iknox-fa
pushed a commit
that referenced
this issue
Feb 8, 2022
Related: #2197 The currently postgres `make_temp_relation` adds a 29 character suffix to the end of the temp relation identifier (9 from default suffix and 20 from timestamp). This is a problem now that relations with more than 63 characters raise exceptions. The fix is to shorten the suffix and also trim the base_relation identifier so that the total length is always less than 63 characters. An exception can also be raised if the default suffix is overridden with a value that is too long. automatic commit by git-black, original commits: c3b5b88
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
good_first_issue
Straightforward + self-contained changes, good for new contributors!
redshift
snapshots
Issues related to dbt's snapshot functionality
Describe the bug
Long table names appear to be truncated by Postgres, but this behavior could also be present on other databases. This was just reproduced with a temp table suffix in a Snapshot query on Postgres, but I imagine this could just happen with exceptionally long table names:
The truncation will cause lots of problems across dbt, but the proximate issue here is that a subsequent information schema query will return zero rows (it's looking for the wrong identifier) which bricks a snapshot run. The quick user-space fix is to shrink the "base" name of the table, but we should also take action here to:
More info on this PG constraint here.
Example informations schema query
System information
Which database are you using dbt with?
The output of
dbt --version
:The text was updated successfully, but these errors were encountered: