Issue 18488

Summary: unable to store images into a PostgreSQL db
Product: Base Reporter: andremachado <andremachado>
Component: codeAssignee: marc.neumann
Status: CLOSED FIXED QA Contact: issues@dba <issues>
Severity: Trivial    
Priority: P3 CC: issues
Version: OOo 1.1 RC3   
Target Milestone: OOo 2.0   
Hardware: All   
OS: Linux, all   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description andremachado 2003-08-21 12:26:39 UTC
Hello, 
I am trying to use OpenOffice.org and a form to store images into a Postgresql 7.3.2 db, 
connected through psqlodbc 7.03.0100 (the latest for windoze) or unixodbc 2.2.6 (the latest for 
linux). 
I am able to DISPLAY previously inserted images on records. But unable to insert new ones. 
After contacting the postgresql ODBC driver authors, sql logs were sent, and you can read 
below an excerpt of the last message: 
 
>  
> I guess that openoffice escapes the binary file, in order to to 
> pass it by value into a SQL statement, as it is recommended for 
> bytea and for mysql BLOBs. But pg odbc driver expects raw binary 
> file, not escaped one, for longvarbinary. And postgresql/contrib/lo 
> also does expect a file name, not a parsed by value. 
 
The problem I see in the log you sent is 
 
        [ODBC][7485][SQLBindParameter.c][186] 
                Entry:             
                        Statement = 0x81e39b0             
                        Param Number = 2             
                        Param Type = 1             
                        C Type = -2 SQL_C_BINARY             
                        SQL Type = -2 SQL_C_BINARY 
 
OpenOffice is binding SQL_BINARY(SQL_C_BINARY seems a unixODBC's 
bug) SQL Type parameter not an SQL_LONGVARBINARY one. Unfortunately 
I don't understand the reason. 
 
Though I don't love the *bytea* type, you can turn on 
the *bytea as LO* DSN option. *bytea* is only for not 
so large objects. 
 
regards, 
Hiroshi Inoue 
        http://www.geocities.jp/inocchichichi/psqlodbc/ 
http://gborg.postgresql.org/project/psqlodbc/projdisplay.php
Comment 1 Frank Schönheit 2003-08-21 14:26:46 UTC
correcting sub component and default owner
Comment 2 marc.neumann 2003-08-26 15:31:15 UTC
something for you I think.
Comment 3 ocke.janssen 2003-08-29 12:36:23 UTC
set target
Comment 4 ocke.janssen 2003-08-29 14:11:20 UTC
.
Comment 5 ocke.janssen 2004-01-30 14:23:34 UTC
seems to be fixed in cws oj08
Comment 6 hans_werner67 2004-02-02 12:18:08 UTC
change subcomponent to 'none'
Comment 7 ocke.janssen 2004-02-02 13:44:40 UTC
fixed.
Comment 8 marc.neumann 2004-03-01 15:00:20 UTC
set to fixed
Comment 9 marc.neumann 2004-03-01 15:00:43 UTC
verify in CWS oj08
Comment 10 marc.neumann 2004-04-27 09:58:53 UTC
Hi,

fixed in current developer build -> close.
The current developer build can be found at
http://download.openoffice.org/680/index.html
Feel free to reopen if this issue is not fixed in the developer build.

Bye Marc