One Star

Issue using tPostgresqlOutput to create a table with big decimal : NUMERIC,0

Hi,

 

I tried with different versions of TOS DI (6.4.1, 6.4.0, 6.3.2, 6.2.1) but the code generated to create a table when choosing "Drop table if exists then create it" is always :

 

...\"Article\" INT4 ,\"Annee_2014\" NUMERIC,0 ,\"Annee_2015\" NUMERIC,0...

 

A Big Decimal is casted in a NUMERIC DB type field but with a 0 behind (default value? precision?). This SQL statement retrieve a "org.postgresql.util.PSQLException: ERROR: syntax error at or near "0"" at each time.

 

According to PostgreSQL manuals, a NUMERIC field may have a precision or a scale but between brackets, not a coma :

https://www.postgresql.org/docs/9.6/static/datatype-numeric.html

 

I use Talend with the tPostgresqlOutput and PostgreSQL for a while.... I don't understand...

Any clue please?

 

Capture.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: Issue using tPostgresqlOutput to create a table with big decimal : NUMERIC,0

Hi
You need to specify the length and precision of column on the schema if you want to create the table on tPostgresqlOutput component.

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
2 REPLIES
Community Manager

Re: Issue using tPostgresqlOutput to create a table with big decimal : NUMERIC,0

Hi
You need to specify the length and precision of column on the schema if you want to create the table on tPostgresqlOutput component.

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Issue using tPostgresqlOutput to create a table with big decimal : NUMERIC,0

PostgreSQL don't require precision or scale :

"without any precision or scale creates a column in which numeric values of any precision and scale can be stored, up to the implementation limit on precision."

 

It is unfortunate that Talend return an error whereas the SQL statement will be correct without the 0 added.

 

Whatever, thanks a lot Shong for your quick answer!!