Re: PQgetlength vs. octet_length()

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: PQgetlength vs. octet_length()
Дата
Msg-id 407d949e0908180915t1ccabad1r69fbd814373628f9@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PQgetlength vs. octet_length()  (Michael Clark <codingninja@gmail.com>)
Ответы Re: PQgetlength vs. octet_length()  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Список pgsql-hackers
On Tue, Aug 18, 2009 at 4:04 PM, Michael Clark<codingninja@gmail.com> wrote:
> Hello - am I in the wrong mailing list for this sort of problem? :-

Probably but it's also a pretty technical point and you're programming
in C so it's kind of borderline.

If you're using text-mode then your datum that you're getting from
libpq is a text representation of the datum. For bytea in released
versions that means anything which isn't a printable ascii character
will be octal encoded like \123. You can use PQunescapeBytea to
unescape it.

If you use binary encoding then you don't have to deal with that.
Though I seem to recall there is still a gotcha you have to worry
about if there are nul bytes in your datum. I don't recall exactly
what that meant you had to do though.

-- 
greg
http://mit.edu/~gsstark/resume.pdf


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: "make install" now tries to build the documentation
Следующее
От: Tom Lane
Дата:
Сообщение: Re: "make install" now tries to build the documentation