Search Postgresql Archives

Re: UDFs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux