On Tue, May 06, 2008 at 09:39:50AM -0600, Dan Heron Myers wrote:
> Using DatumToCString(mytextvariable), I get single-character-length
> strings that do not match the data actually in the fields.
Correct, because it's not a cstring. Pretending it is one gives you
garbage.
> Using VARDATA(mytextv
Martijn van Oosterhout wrote:
You do realise that VARDATA does not return a null terminated string?
I did not realize that... but it led me in the right direction.
Try using something like text_to_cstring or using elog(NOTICE) to
display what's actually being compared.
I've outputted some
On Mon, May 05, 2008 at 11:43:40PM -0600, Dan Heron Myers wrote:
> I have a custom C function that takes two text*s and returns a text*.
>
> text* calling_party = PG_GETARG_TEXT_P(0);
>
> char* thestr = VARDATA(calling_party);
> if(thestr[20] == ')')
>
Harvey, Allan AC wrote:
Try if(thestr[20] == 0x29)
might reveal something in the parsing if it works.
No effect.
- Dan
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
I have a custom C function that takes two text*s and returns a text*.
My problem is with this code:
PG_FUNCTION_INFO_V1(get_agent);
PGMODULEEXPORT Datum get_agent(PG_FUNCTION_ARGS)
{
if(!PG_ARGISNULL(0))
{
text* calling_party = PG_GETARG_TEXT_P(0);