Skip to content

fix(postgresql): Normalize types in Postgres destination#9143

Merged
hermanschaaf merged 1 commit intomainfrom
postgresql-varchar
Mar 17, 2023
Merged

fix(postgresql): Normalize types in Postgres destination#9143
hermanschaaf merged 1 commit intomainfrom
postgresql-varchar

Conversation

@hermanschaaf
Copy link
Copy Markdown
Contributor

Fixes #9141. This will allow CloudQuery to sync to tables that had their schemas created by some external process, as long as the column can be normalized to a CloudQuery type. This is mostly useful for Postgres -> Postgres sync use cases right now. As we improve the internal type system, we should be able to do away with these training wheels and create the same column types on the destination as we find on the source for such cases.

The type normalization is copied from the Postgres source

@candiduslynx candiduslynx requested a review from erezrokah March 17, 2023 10:33
@candiduslynx candiduslynx changed the title fix: Normalize types in Postgres destination fix(postgresql): Normalize types in Postgres destination Mar 17, 2023
@hermanschaaf hermanschaaf merged commit eedea97 into main Mar 17, 2023
@hermanschaaf hermanschaaf deleted the postgresql-varchar branch March 17, 2023 14:06
@erezrokah
Copy link
Copy Markdown
Member

Looks great @hermanschaaf thank you for applying the fix 🚀

kodiakhq bot pushed a commit that referenced this pull request Mar 19, 2023
🤖 I have created a release *beep* *boop*
---


## [3.0.1](plugins-destination-postgresql-v3.0.0...plugins-destination-postgresql-v3.0.1) (2023-03-19)


### Bug Fixes

* **postgresql:** Normalize types in Postgres destination ([#9143](#9143)) ([eedea97](eedea97))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
kodiakhq bot pushed a commit that referenced this pull request Jun 7, 2023

#### Summary

Fixes #11325
Same as #9143 for MySQL destination.
Type handling taken from https://github.com/cloudquery/cloudquery/pull/11214/files#diff-c4ee14fff2e1c7cbea7dfcf122879522b5d817aaa041f54564696293b1c6bc30R90.

Once we have the MySQL source migrated to v3 we can add support for more granular types like `char(x)` or other fixed size types (doing that will be a breaking change).

<!--
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.

bug: postgresql unknown type character varying

5 participants