Re: URL Managment - C Function help

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Samuel ROZE <samuel(dot)roze(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: URL Managment - C Function help
Date: 2009-10-21 15:42:16
Message-ID: 28761.1256139736@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Samuel ROZE <samuel(dot)roze(at)gmail(dot)com> writes:
> The problem is that they don't work fine... :/

I think the problem is that you are passing C strings to code that
expects pointers to text datums --- which are not the same thing
at all. (text has a length word, not a null terminator byte.)
It's pure accident that your first example works, and entirely
unsurprising that the second one doesn't. Some CStringGetTextDatum
calls might help.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2009-10-21 15:42:17 Re: URL Managment - C Function help
Previous Message Dave Page 2009-10-21 15:42:12 Re: Application name patch - v2