Oh, my bad, didn't read carefully. And not, i am not using 7.3, that's
another failure in my copy-paste skills :)
2010/5/15 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Oliver Kindernay <oliver(dot)kindernay(at)gmail(dot)com> writes:
>> Hi. I am using libpq in my C application to comunicate with database.
>> Application gets input from untrustworthy source and then uses it in
>> SQL requests. To avoid SQL injection I want to use PQescapeStringConn
>> function. The problem is, that i don't know how to properly use this
>> How can I know the size of "to" buffer before I call this function?
> I trust you're not *really* using Postgres 7.3? But in any case,
> that documentation says
> to shall point to a buffer that is able to hold at least one more byte
> than twice the value of length
> ie maximum output is 2 bytes per input byte, plus a null terminator.
> regards, tom lane
In response to
pgsql-novice by date
|Next:||From: David Jarvis||Date: 2010-05-16 02:25:47|
|Subject: Bulk Insert|
|Previous:||From: Tom Lane||Date: 2010-05-15 17:13:32|
|Subject: Re: PQescapeStringConn problem |