can't figure string compare result (using also custom C function) - Mailing list pgsql-general

From Edoardo Panfili
Subject can't figure string compare result (using also custom C function)
Date
Msg-id 4995E6C5.8060603@aspix.it
Whole thread Raw
Responses Re: can't figure string compare result (using also custom C function)
Re: can't figure string compare result (using also custom C function)
List pgsql-general
I have this query: (1 result)

SELECT idSpecie,nome  FROM specienomi
WHERE idspecie=37026 and nome='X Agropogon littoralis (Sm.) C.E. Hubb.';
  idspecie |                  nome
----------+-----------------------------------------
     37026 | X Agropogon littoralis (Sm.) C.E. Hubb.

The same query but without one condition: no results.

SELECT idSpecie,nome  FROM specienomi
WHERE nome='X Agropogon littoralis (Sm.) C.E. Hubb.';
  idspecie | nome
----------+------
(0 rows)

I can't figure why, can someone tell me how investigate?

specienomi is a view
idSpecie is a numeric field (the  key of another table)
nome is a text field generated by a custom C function (using 18 fields
(1 enumerate type, 1 boolean, 16 text).

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)

Thank you
Edoardo


pgsql-general by date:

Previous
From: Ray Stell
Date:
Subject: 8.3 doc issue
Next
From: Sam Mason
Date:
Subject: Re: can't figure string compare result (using also custom C function)