| От | Martijn van Oosterhout |
|---|---|
| Тема | Re: more custom C function fun |
| Дата | |
| Msg-id | 20080506064826.GC19090@svana.org обсуждение исходный текст |
| Ответ на | more custom C function fun ("Dan \"Heron\" Myers" <heron@xnapid.com>) |
| Ответы |
Re: more custom C function fun
|
| Список | pgsql-general |
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] == ')')
> {
> PG_RETURN_TEXT_P(calling_party);
> }
You do realise that VARDATA does not return a null terminated string?
Try using something like text_to_cstring or using elog(NOTICE) to
display what's actually being compared.
Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера