Re: UDFs
| От | Martijn van Oosterhout |
|---|---|
| Тема | Re: UDFs |
| Дата | |
| Msg-id | 20070813084252.GB7252@svana.org обсуждение исходный текст |
| Ответ на | UDFs (jf <jf@danglingpointers.net>) |
| Ответы |
Re: UDFs
|
| Список | pgsql-general |
On Mon, Aug 13, 2007 at 03:17:36PM +0000, jf wrote: > Hi. > > Trying to implement some simple digest routines via UDFs and for whatever > reason I get: ERROR: invalid memory alloc request size 4294967293 on > PG_RETURN_TEXT_P(); any ideas what the issue is exactly? A few points about your code: - The tests against NULL are useless: palloc never returns NULL and the argument to the function won't be NULL either (it's decalred STRICT). - Your palloc should be for more, the header may be more than one byte VAR_HEADER_LEN or some such would be more appropriate) - Finally, what is probably the actual problem, at no point did you assign a length to the hash variable, ie VARLEN(hash)=foo. Hope this helps, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to litigate.
Вложения
В списке pgsql-general по дате отправления: