Re: hashtable issue - HASH_FIND??

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jay Flattery <jaycode(at)rocketmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: hashtable issue - HASH_FIND??
Date: 2010-08-04 14:46:24
Message-ID: 18599.1280933184@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jay Flattery <jaycode(at)rocketmail(dot)com> writes:
> I'm looking to use the PostgreSQL Hash Table for some custom functions.
> However, the example, as per http://wiki.postgresql.org/wiki/HashTable crashes
> postmaster (or segfaults from the cmd line) when trying to retrieve an element
> from the hash.

I think the "palloc(sizeof(key))" bits ought to be
"palloc(sizeof(*key))" ... or personally I'd have used
sizeof(HashKey). Although offhand it looks like that should
be the same size or larger, so it doesn't seem to explain a crash.
Where's the crash happening exactly?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gauthier, Dave 2010-08-04 14:50:02 Re: killing idle attaches without killing others
Previous Message John R Pierce 2010-08-04 14:37:25 Re: killing idle attaches without killing others