Hey team! Thanks for all great stuff you're creati...
# ask-community-for-troubleshooting
v
Hey team! Thanks for all great stuff you're creating🚀 Love Airbyte UI ❤️ I wanted to dig a bit deeper in this conversation (https://airbytehq.slack.com/archives/C021JANJ6TY/p1641999469109500?thread_ts=1641983077.104500&cid=C021JANJ6TY). In short question is - what is the proper way to preserve types in Postgres to Redshift exports? (details in the thread)
1
In details: We've created a table in Postrgres with common datatypes to understand transformations.
Screenshot 2022-01-13 at 19.06.11.png
As I can see from the UI all types will be converted to basic (string, number, boolean, array).
Screenshot 2022-01-13 at 19.07.56.png
And a table created in Redshift has only primitive types
Screenshot 2022-01-13 at 17.36.12.png
Even when I predefine table schema in destination, Airbyte recreates table with it's own types. Can we preserve types during data export to Redshift without extra transformations (i.e. DBT)? Or DBT is the only way to restore types?
u
Hello @Volodymyr Sulevskyi Airbyte read the Postgres message and transform to the AirbyteMessage type. For some types you can loose the data type from the source, there’re some work to improve the data types the AirbyteMessage can handle. At the moment what you can do is: run a first time the sync, export the normalization-dbt project and re-write the data type you want to have.
👍 2
v
Thanks a lot for the help!
p
@[DEPRECATED] Marcos Marx thanks for reply! Is there an example code for such normalisation dbt project? Also does it work with cdc, ie will we be able to get incremental updates with the same method? thank you!
u
Yes, first my recommendation is reading the normalization docs: https://docs.airbyte.com/operator-guides/transformation-and-normalization After there is a video showing how to do custom normalization:

https://www.youtube.com/watch?v=18P5_ohcu5A&ab_channel=Airbyte

👍 2