Re: user defined C-lang pg function bug

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "James Moss" <jpmoss(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: user defined C-lang pg function bug
Date: 2006-11-17 17:09:08
Message-ID: 15048.1163783348@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"James Moss" <jpmoss(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ardian Xharra 2006-11-17 17:29:36 Re: Why the data changes it's value by itself!
Previous Message James Moss 2006-11-17 17:03:01 user defined C-lang pg function bug