Re: [opendbx] Add patch of backend ( PGSQL) for support BYTES TYPE(odbx_escapt)
Brought to you by:
nose
From: Norbert S. <no...@li...> - 2011-07-07 07:03:24
|
On 07/05/2011 12:08 PM, Zhao Tongyi wrote: > the pre patch at pgsql_odbx_get_option lose break.sorry > > 2011/7/5 Zhao Tongyi<zha...@gm...>: >> I need to insert the "BYTEA" type data into the PGSQL database, but >> found OPENDBX on pgsql_odbx_escapt function call the PGEscaptSring, so >> I added this patch at opendbx-1.4.5, use odbx_set_option set using >> PGEscaptString or PGEscaptBytea. >> In addition to the Opendbx project not update at long time . I've thought some time about your implementation and requirements and I'm not sure it's the right solution for the problem. If I understand correctly, only binary values have to be escaped using the PQescapeByteaConn/PQescapeBytea function before they can inserted into a SQL string. This means, that this function doesn't work for string values and depending on your column, you have to switch between the PQescapeByteaConn and PQescapeStringConn functions. Therefore, using a connection option to switch between those functions doesn't seem to be at good solution. Furthermore, I was wondering if we can integrate such special handling for a specific backend at all of if it's too special. A solution would then to provide a function that returns the bare connection handle of the native database library. This could then be used to call the native library function directly but have to be used with care and doing this isn't portable. What do you think? Norbert |