Re: Problems converting between C string and Datum

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Problems converting between C string and Datum
Дата
Msg-id 20060920192947.GD7888@svana.org
обсуждение исходный текст
Ответ на Problems converting between C string and Datum  ("Jack Orenstein" <jack.orenstein@gmail.com>)
Список pgsql-general
On Wed, Sep 20, 2006 at 11:19:29AM -0400, Jack Orenstein wrote:
> Thanks for all your help with the memory management problems. Next
> problem: I'm having problems converting from a char* to a Datum and back
> again.
>
> I have a char* which I need as a Datum, for use with a plan returned
> from SPI_prepare, so I'm doing this:

<snip>

They look OK. For examples see the PG_STR_GET_TEXT() and
PG_TEXT_GET_STR() macros in utils/adt/varlena.c.

> This crashes doing the ereport:
>
>    psql:test.sql:23: server closed the connection unexpectedly
>         This probably means the server terminated abnormally
>        before or while processing the request.

Obviously something is going wrong. Perhaps you should enable coredumps
and use gdb to examine them, or attach gdb to the running backend to
catch the error.

> 2) Is there some neater way to generate debug output than ereport(WARNING,
> ...)?
> The output is quite verbose, e.g.

Try elog(), but the details are also controlled by the client also,
perhaps you can reduce the verbosity there also?

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: 8.2: select from an INSERT returning?
Следующее
От: CSN
Дата:
Сообщение: Selecting from two unrelated tables