laurenz / oracle_fdw

PostgreSQL Foreign Data Wrapper for Oracle
http://laurenz.github.io/oracle_fdw/
Other
496 stars 156 forks source link

Support mapping to postgresql boolean #719

Closed nmoreaud closed 6 days ago

nmoreaud commented 1 week ago

Hello I would like to map "NUMBER(1,0)" with postgresql boolean type. I know I can create a view that handles the conversion, but it would be more practical if it was an option of the foreign table declaration. Would it be possible to handle it as an option of the foreign tables?

laurenz commented 1 week ago

That should work out of the box. Just define the foreign table column with type boolean.

nmoreaud commented 6 days ago

This seems to work well with an alter table, thanks :-)

alter table "user_account" alter column "active" type boolean;

For now, I import tables with IMPORT FOREIGN SCHEMA. If I use IMPORT FOREIGN TABLE instead, can I declare only the columns for which I want to adapt the type?

laurenz commented 6 days ago

No, there is no way to influence the data type IMPORT FOREIGN SCHEMA chooses on the PostgreSQL side.

nmoreaud commented 6 days ago

Okay, thanks