Arrow types to postgres types

Is there some table that would provide information on what is the mapping of Arrow types to postgres types?
For example, I have Arrow type Int8, what is the equivalent type in postgres?

What do you mean with that Arrow type?
Can't find it in the doc The Rust Programming Language - The Rust Programming Language

There is this tool. I never used it as types for both systems are rather self-explanatory and it is easy to do the conversion by hand.

Given that you ask this question in a Rust forum you probably want to implement your data types in Rust as well, in which case using your Rust types as the desired representation and letting tools like arrow2_convert and sqlx do the converting for you would be my preferred choice of implementation. So say you have to load some external data given to you in as arrow tables and you want to store it in Postgres, I would think about how I would represent that data in native Rust types first and then derive the Postgres tables from the Rust types, possibly with the help of an ORM that sets up the tables for you.

1 Like

Some of them are self explanatory indeed. Some of them are not. What is the equivalent of Arrows's Int8 in Postgres, and Arrow's Int16 in Postgres for example?

smallint suffices for both, but you can use any numeric type that is large enough to fit one or two bytes.

1 Like

So both Arrow types have the same equivalent in Postgres?

You see, immediately it is not that obvious and self explanatory.

Also, I'm of course using some type of lib in rust to communicate with postgres and I found that:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.