One Star

[resolved] BYTEA

hello,
I have a postgresql table with bytea.
I want to get a file with my field bytea but I don't know how to unescape my field with talend so the size of my flied is X2.
thanks
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] BYTEA

I find.
It is not a talend problem.
It's a conf postgresql problem (we must have bytea_output = 'escape' in postgresql.conf)
It could be closed.
5 REPLIES
Seventeen Stars

Re: [resolved] BYTEA

It is hard for me to understand what do you mean and whats your problem. Perhaps you spend some more sentences to explain your issue a bit deeper.
http://www.postgresql.org/docs/9.0/static/datatype-binary.html
One Star

Re: [resolved] BYTEA

Sorry
I use a tPostgresqlInput to access my table. My query returns just one blob (one column and one row). So, in the schema, I have just one column (type=byte[] and db type=BYTEA).
I join the tPostgresql to a tFileOutputDelimeted in which the output schema has one row with the type byte[].
When I execute the job, the size of the output file is X2 rather the size of bytea field.
I have the same jobs with a tDB2Input or a tMysqlInput and they are OK.
I think, it's because of the representation of bytea type and how talend reads it. I don't know if I must change my query, choose another java type in my schema or something else.
thanks
Seventeen Stars

Re: [resolved] BYTEA

If I understood you correctly you want to get the content as String.
I would check what you get if you setup the schema column to the data type String (with the dbType VARCHAR).
I would bet you will get the correct content.
One Star

Re: [resolved] BYTEA

I find.
It is not a talend problem.
It's a conf postgresql problem (we must have bytea_output = 'escape' in postgresql.conf)
It could be closed.
One Star

Re: [resolved] BYTEA

You can mark it at resolved Smiley Wink