Skip to content
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

archive table making incorrect column lengths on PostgreSQL #781

Closed
joevandyk opened this issue May 22, 2018 · 4 comments · Fixed by #1420
Closed

archive table making incorrect column lengths on PostgreSQL #781

joevandyk opened this issue May 22, 2018 · 4 comments · Fixed by #1420
Labels
snapshots Issues related to dbt's snapshot functionality

Comments

@joevandyk
Copy link
Contributor

joevandyk commented May 22, 2018

(this might be related to a dbt seed issue regarding column types: #684)

I have a PostgreSQL 10 table with text columns.

However, the archive tool creates the archive table with columns of type character varying(255)-- causing errors like value too long for type character varying(255) when the archive table is populated.

@joevandyk
Copy link
Contributor Author

joevandyk commented May 22, 2018

@drewbanin
Copy link
Contributor

Thanks @joevandyk - does this happen on the first dbt archive? Or does it happen on subsequent archives?

Archive uses a create table as (....) to initially build the archive table, so i'd be surprised if this doesn't work on the first run. For subsequent runs, dbt will execute insert statements to add new data to the archive table. Sometimes the new data is "wider" than the existing columns, but dbt should be able to widen the column automatically.

Any other information you can share here would be really helpful!

@joevandyk
Copy link
Contributor Author

I messaged you the log in the dbt slack channel

@drewbanin
Copy link
Contributor

Thanks! Yeah - text has a max width of 256 on Redshift, but it can be an unlimited size on Postgres. We should 1) change our hardcoded 255 to 256 everywhere (don't know how that happened) and 2) fix the logic around text types on Postgres

@drewbanin drewbanin added the snapshots Issues related to dbt's snapshot functionality label Jul 11, 2018
@drewbanin drewbanin added this to the Wilt Chamberlain milestone Nov 28, 2018
beckjake added a commit that referenced this issue Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
snapshots Issues related to dbt's snapshot functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants