On Thu, August 17, 2006 14:43, Lumir Vanek wrote:
> Hi,
> I tried to update bytea field, using prepared statement, and have problem:
> There are twice escaped characters stored in database. First esaping cause
> "Esc = T.esc_raw(...)", second one cause "I(Esc);"
>
> It is possible pass raw data to prepare::invocation(), to avoid this
> behavior ?

IIRC that is exactly what you are supposed to do.  Prepared statement
parameters are different in that they need no escaping.


>     char buffer1[bufSize]; // some raw data - begin of PNG file

[...]

>     const std::string Esc = T.esc_raw(reinterpret_cast <const unsigned
> char *> (&buffer1), bufSize);

Don't write "&buffer1" here!  Since buffer1 is an array, just "buffer1"
will return a pointer to its first element.  When you add the "&", you
take the address of that pointer instead of of the first element itself.

Some compilers may understand what you mean here, but that's not a good
thing to count on...


Jeroen


_______________________________________________
Libpqxx-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Reply via email to