Re: [GENERAL] Using a pointer as statetype for an aggregate

2006-05-02 Thread Florian G. Pflug
Tom Lane wrote: > "Florian G. Pflug" <[EMAIL PROTECTED]> writes: >>why doesn't postgres allow "internal" as statetype? > > Because it's not a type. If it were, it certainly wouldn't have the > semantics you seem to hope for (ie, "pass by reference type but don't > actually try to copy the bits")

Re: [GENERAL] Using a pointer as statetype for an aggregate

2006-05-02 Thread Tom Lane
"Florian G. Pflug" <[EMAIL PROTECTED]> writes: > why doesn't postgres allow "internal" as statetype? Because it's not a type. If it were, it certainly wouldn't have the semantics you seem to hope for (ie, "pass by reference type but don't actually try to copy the bits") r

[GENERAL] Using a pointer as statetype for an aggregate

2006-05-02 Thread Florian G. Pflug
Hi I've now completed my implementation of a collect_distinct aggregate, and it seems to work. My statetype is basically a pointer to a hashtable (allocated from the aggcontext). Since using internal as statetype is unsupported, I use int8, and just cast my pointer back and forth from int8. It a