Search Postgresql Archives

Re: Problems converting between C string and Datum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux