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

Fix postgres text handling (#781) #1420

Merged
merged 3 commits into from
Apr 30, 2019

Conversation

beckjake
Copy link
Contributor

Fixes #781

Fix incorrect maximum text field length on redshift (255 -> 256)
On postgres, pass through text without size information to fix archival of long text fields
Add a test that makes sure archives work with very long text entries on postgres

Jacob Beck added 2 commits April 26, 2019 13:50
Fix incorrect maximum text field length on redshift
On postgres, pass through text without size information to fix archival of long text fields
Add a test that makes sure postgres archives work with very long text entries
Fix tests
Add a redshift test
Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment here, but this largely looks great! Approved pending that one change

from dbt.logger import GLOBAL_LOGGER as logger # noqa


class RedshiftAdapter(PostgresAdapter):
ConnectionManager = RedshiftConnectionManager
# postgres overrides this, so override the override.
Column = Column
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any merit to making a RedshiftColumn type that just inherits from Column? I think that might be a little more clear that the override override

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that's totally reasonable.


insert into {database}.{schema}.super_long (id, longstring, updated_at) VALUES
(1, 'short', current_timestamp),
(2, repeat('a', 500), current_timestamp);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL!

@beckjake beckjake merged commit acca6a7 into dev/wilt-chamberlain Apr 30, 2019
@beckjake beckjake deleted the fix/postgres-text-types branch April 30, 2019 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

archive table making incorrect column lengths on PostgreSQL
2 participants