Re: Weird problems with C extension and bytea as input type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Weird problems with C extension and bytea as input type
Дата
Msg-id 25771.1300889298@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Weird problems with C extension and bytea as input type  (Adrian Schreyer <ams214@cam.ac.uk>)
Список pgsql-general
Adrian Schreyer <ams214@cam.ac.uk> writes:
> The actual C++ function looks roughly like this

> extern "C"
> char *function(bytea *b)
> {
>    string ism;
>    [...]
>    return ism.c_str();
> }

My C++ is pretty rusty, but is the pointer returned by c_str() still
valid after the string variable goes out of scope?  I'm wondering if you
need a pstrdup before returning.

            regards, tom lane

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: Weird problems with C extension and bytea as input type
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: RAID 1 - drive failed - very slow queries even after drive replaced