Re: user defined C-lang pg function bug - Mailing list pgsql-general

From Tom Lane
Subject Re: user defined C-lang pg function bug
Date
Msg-id 15048.1163783348@sss.pgh.pa.us
Whole thread Raw
In response to user defined C-lang pg function bug  ("James Moss" <jpmoss@gmail.com>)
List pgsql-general
"James Moss" <jpmoss@gmail.com> writes:
> I could use a helpful suggestion or two as to why the following is
> occuring or more to the matter, how I might work around it.  Certainly
> appears to be a bug or some sort of misunderstanding on my part.

The content of a text datum is not guaranteed null-terminated, hence
you can't just take VARDATA(a) as being a C string.  The cleanest way
to convert to C string if you need to is to call textout() --- look
around in the sources for examples to copy.

            regards, tom lane

pgsql-general by date:

Previous
From: "James Moss"
Date:
Subject: user defined C-lang pg function bug
Next
From: "Ardian Xharra"
Date:
Subject: Re: Why the data changes it's value by itself!