Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
julienChe
Contributor

insert JSONB in Postgresql

Hello community,

On talend 8 ETL License with Java11, how to insert JSON in POSTGRESQL 16 in a JSONB column ? thanks

Labels (2)
3 Replies
quentin-vigne
Partner - Creator II

Hello @julienChe 

You need to start setting up the desired column in Talend to "string"

Then in your tDBOutput go to Advanced Settings

Capture d'écran 2025-03-05 094736.png

And in Additional Column add a new value with the same name as your output column :

quentinvigne_1-1741164720441.png

 

in SQL Expression add : 

"?::json"

 

This help convert your string to json. We use "?" because it's a pattern matching character. 

In Position select Replace and in Reference column select the output column.

 

If we say that your json string is "abcdef" then Talend will output your data it will look like this : 

INSERT INTO table VALUES ("abcdef"::json)

 

- Quentin

julienChe
Contributor
Author

Hello @quentin-vigne ,

thank you very much for your reply, I'll test it as soon as possible and get back to you.
have a nice day!

quentin-vigne
Partner - Creator II

If it works don't forget to accept it as a solution 

Have a good day

 

- Quentin