Closed brunosimioni closed 11 years ago
Table oris_fdw_sm has 4 columns--numeric,numeric,numeric,int and SQLServer table columns are int,numeric,int,datetime.The 4th column in oris_fdw_sm is being mapped to the 4th column in SQLServer table(as it should be,since there is no explicit mapping).Hence,there is conflict between the datatypes of the columns(int in oris_fdw_sm and datatime in SQLServer table) and hence the error.
Right, I get it now.
I do suggest that it must have at least one of this three behaviors:
That are only some suggestions for improve user experience.
There is an error mapping datetime type from SQLServer to PostgreSQL via JDBC_FDW.
Environment: jtds-1.2.4.jar postgresql-9.1.5 (compiled from source). jdbc_fdw compiled from source.
SQLServer table columns (at SQLServer): IDINDICE int VALORDE numeric ANOMESINICIO int DATALANCAMENTO datetime VALORATE numeric VALORRETORNO numeric ANOMESFINAL int IDUSUARIO int
Row from table at SQLServer (same order that is declared above) 1001 0 200401 2004-01-01 00:00:00.0 999,999,999 240 200505 5
Foreign Table (at PostgreSQL) CREATE FOREIGN TABLE oris_fdw_sm ( valorretorno numeric, anomesinicio numeric, anomesfinal numeric, idindice int ) SERVER oris_fdw_server OPTIONS ( table 'oris.oris.eveinddet' );
SQL Statement (at PostgreSQL) select * from oris_fdw_sm;
Error (at PostgreSQL) ERROR: invalid input syntax for integer: "2004-01-01 00:00:00.0"
\ Error **
ERROR: invalid input syntax for integer: "2004-01-01 00:00:00.0" SQL state: 22P02
Notice that I haven't mapped DATALANCAMENTO column, although the error raised when getting this content.