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<zhaoton...@gmail.com>:
>> 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

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
libopendbx-devel mailing list
libopendbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libopendbx-devel
http://www.linuxnetworks.de/doc/index.php/OpenDBX

Reply via email to