Using a pointer as statetype for an aggregate

From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: Postgresql-General <pgsql-general(at)postgresql(dot)org>
Subject: Using a pointer as statetype for an aggregate
Date: 2006-05-02 09:57:27
Message-ID: 44572D07.6090307@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 appears to work on both my dev (32bit) and my production (64bit) machine,
and it doesn't crash even when used heavily. Is there some drawback to my
approach? If not - why doesn't postgres allow "internal" as statetype?

greetings, Florian Pflug

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Markus Schiltknecht 2006-05-02 11:37:54 Unnecessary function calls
Previous Message Csaba Nagy 2006-05-02 09:45:10 Re: Alternative for vacuuming queue-like tables