Hello!
I am working on emulating a Postgres server and am faced with the following
problem:

Postgres `pg_catalog` schema has custom types like `name`, those types can
be easily mapped to calcite basic types. The problem is that several types
in PG can be mapped to one calcite type (for example: `name` and `varchar`
in PG are mapped to `varchar` type in calcite) but postgres has a unique id
for every type.
Some PG clients like Power BI require the right id for the column.
Planner.validateAndGetType() returns row data type for the query, but I can
not derive pg type id from this data type, because calcite data type can
correspond to several PG types.

One solution would be putting some extra information to RelDataType when
the table structure is defined and somehow extracting it when the row type
for query is inferred.

I will be very grateful for your help

Reply via email to