jpg error 53
Posted: 13.03.2014, 14:27
I am using a 7.1 alpha version that seems to be working quite well for me.
Recently we have tried to upgrade to PostgreSQL 9.3. Everything works well, except for the jpg that my software stores in a bytea field. It can be stored without an error message, but I get jpg error 53 when I try to view it.
While trying to get more info, I backed up a database created in PostgreSQL 8.1, and restored it in 9.3. The jpg could be viewed with no error message. Therefore, I think the problem occurs when putting the jpg into the database.
I did a bug report on the PostgreSQL web site, and found that it is not actually a bug, but a known change. Prior to PostgreSQL 9.1, the standard_conforming_strings setting defaulted to OFF. In 9.1 and later, it defaults to ON. I think that is what I need to change, but I am not completely sure how I do it in Zeos.
My guess is that I have to add a line to the properties of the connection:
standard_conforming_strings=OFF
However, I just tried this, and when I tried to run the project I got an EZSQLException error: Parameter "standard_conforming_strings" cannot be changed. So how do I change this setting? (Maybe this setting can only be changed in PostgreSQL 9.1 and higher?)
The PostgreSQL documentation says that ON is more like the rest of the world, and there was another suggestion. This was to set bytea_output = escape. Would this be more appropriate? The first suggestion seems like it is definitely backward compatible. (My users must be able to backup an 8.1 database and restore it in 9.x and still view the jpg.) I am not so sure about this 2nd solution. If it is "better", how would I change it?
EgonHugeist, you have helped me in the past -- I know this is a simple question for you, and thanks in advance for your help!
Recently we have tried to upgrade to PostgreSQL 9.3. Everything works well, except for the jpg that my software stores in a bytea field. It can be stored without an error message, but I get jpg error 53 when I try to view it.
While trying to get more info, I backed up a database created in PostgreSQL 8.1, and restored it in 9.3. The jpg could be viewed with no error message. Therefore, I think the problem occurs when putting the jpg into the database.
I did a bug report on the PostgreSQL web site, and found that it is not actually a bug, but a known change. Prior to PostgreSQL 9.1, the standard_conforming_strings setting defaulted to OFF. In 9.1 and later, it defaults to ON. I think that is what I need to change, but I am not completely sure how I do it in Zeos.
My guess is that I have to add a line to the properties of the connection:
standard_conforming_strings=OFF
However, I just tried this, and when I tried to run the project I got an EZSQLException error: Parameter "standard_conforming_strings" cannot be changed. So how do I change this setting? (Maybe this setting can only be changed in PostgreSQL 9.1 and higher?)
The PostgreSQL documentation says that ON is more like the rest of the world, and there was another suggestion. This was to set bytea_output = escape. Would this be more appropriate? The first suggestion seems like it is definitely backward compatible. (My users must be able to backup an 8.1 database and restore it in 9.x and still view the jpg.) I am not so sure about this 2nd solution. If it is "better", how would I change it?
EgonHugeist, you have helped me in the past -- I know this is a simple question for you, and thanks in advance for your help!