Обсуждение: PQunescapeBytea Question

Поиск
Список
Период
Сортировка

PQunescapeBytea Question

От
Jerry LeVan
Дата:
Is there any chance that PQunescapeBytea will
always have a \000 at the end of the
unescaped buffer?

unescvalue = PQgetvalue(lastResult, row, fieldNum);
value = PQunescapeBytea(unescvalue, &size);

ie  is "value" a C string or do I have to make
another copy so I can append a \000 byte?

Sigh, I expect the latter...

Jerry


Re: PQunescapeBytea Question

От
Kris Jurka
Дата:

On Thu, 5 Aug 2004, Jerry LeVan wrote:

> Is there any chance that PQunescapeBytea will
> always have a \000 at the end of the
> unescaped buffer?

What would the point of that be?  It's binary data and may have embedded
nulls so you'll need to always keep track of length separately.

Kris Jurka