One Star

error Talend

Hi,
I've got a probem when tring to insert in a postgres table,
i got this error :
ERREUR: la valeur d'une clé dupliquée rompt la contrainte unique « res_currency_pkey »
Détail : La clé « (id)=(0) » existe déjà.ERREUR: la transaction est annulée, les commandes sont ignorées jusqu'à la fin du bloc
de la transactionERREUR: la transaction est annulée, les commandes sont ignorées jusqu'à la fin du bloc
de la transactionERREUR: la transaction est annulée, les commandes sont ignorées jusqu'à la fin du bloc
i hecked the table and i found out that id=0 does not exist
Help !
Best regards
Mouad
8 REPLIES
Four Stars

Re: error Talend

Hi moud,
What is the erro, can't understand or interpret the message... need english message for error... else translate and give the mesage.
Thanks
Vaibhav
One Star

Re: error Talend

here is my error:
ERROR: The value of a duplicate key breaks the unique constraint "res_currency_pkey"
Detail: The Key "(id) = (0)» déjà.ERREUR are: the transaction is aborted, commands ignored until end of block
the transactionERREUR: the transaction is aborted, commands ignored until end of block
the transactionERREUR: the transaction is aborted, commands ignored until end of block
Moderator

Re: error Talend

Hi,
What's your job design? Did you want to insert/update data into your postgres DB? Could you please share your component setting screenshot with us?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: error Talend

Hi,
Here is my screenshot
One Star

Re: error Talend

mouadrouass - your insert is violating a unique constraint - trying to insert a value that has already been inserted.
To solve this - change your table load from insert mode to insert/update, and in your tMap output table, check as a "Key" the primary key that is referenced in the unique constraint.
This way, your code will update the record if it exists, not insert it...
One Star

Re: error Talend

it works but i can't insert all the rows because i have an auto increment id, and during the insertion i get just one row that has a id eqals to 0 , how can i start insertion from the last record in the target
One Star

Re: error Talend

Hi
tPostgresqlOutput -> Advanced settings -> Unselect use the batch size (en francais : décocher ' utiliser la taille des lots')
Jr
Seventeen Stars

Re: error Talend

hi all,
use the same procedure as described at Talend help (for Oracle but shoud be the same for postgres) :
https://help.talend.com/search/all?query=Using+an+Oracle+sequence+while+inserting+data&content-lang=...
goal is to use server 'SEQUENCE' and nextVal function to insert new rows begining with the last inserted id.
hope it help
regards
laurent