Re: can't figure string compare result (using also custom C function)

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: can't figure string compare result (using also custom C function)
Date: 2009-02-13 22:23:27
Message-ID: 20090213222327.GM32672@frubble.xen.chris-lamb.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Feb 13, 2009 at 10:31:49PM +0100, Edoardo Panfili wrote:
> The problem arises only with particular records, when the first
> character of the string is generated by my function [1].
> When the first character is copied from postgres parameter [2] all works
> fine.
>
> [1] buffer[0]='X'; buffer[1]=' ';
> [2] memcpy(buffer,VARDATA(part),VARSIZE(part)-VARHDRSZ)

I'm not much of an expert with extending PG in C; but my first
suggestion would be are you null terminating the string?

If you are, could you include a (cut down) portion of the code that
demonstrates the problem?

--
Sam http://samason.me.uk/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Erik Jones 2009-02-13 22:35:59 Re: 8.3 doc issue
Previous Message Edoardo Panfili 2009-02-13 21:31:49 can't figure string compare result (using also custom C function)