singer-io/tap-postgres

Domain types unsupported

Opened this issue · 0 comments

Catalog domain types correctly

This would result in no additional catalog modifications are required after discovery for domain types prior to running Singer. Currently we get errors if a primary key is a domain type as it's automatically excluded.

There seems to be a line of SQL commented out above the system information query which would handle this use case, based on the postgres documentation, but I can't see any reference to why it is excluded?

https://github.com/singer-io/tap-postgres/blob/e990e88e4c41720e982c49f77dee8fc6149124de/tap_postgres/__init__.py

Expected

The type of a domain type is catalogued as the underlying data type, e.g if I create a domain as such

CREATE DOMAIN posint AS integer CHECK (VALUE > 0);
CREATE TABLE mytable (id posint);

Then the type of the posint column would be integer, rather than posint.

Actual

Domain types are catalogued with their type as the domain name, rather than the underyling data type.

This type is then marked as unsupported and excluded by default, even if the column is a primary key with a supported underlying data type.