Re: DEALLOCATE ALL - Mailing list pgsql-patches

From Marko Kreen
Subject Re: DEALLOCATE ALL
Date
Msg-id e51f66da0703300700r7852653w662b9fb90a871b3@mail.gmail.com
Whole thread Raw
In response to Re: DEALLOCATE ALL  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: DEALLOCATE ALL
List pgsql-patches
On 3/30/07, Alvaro Herrera <alvherre@commandprompt.com> wrote:
> If by destruction you mean something different than pfree, then maybe
> hash_remove in a loop is the best solution, the other idea being passing
> a function pointer to hash_destroy_deep to call on each element, which
> is probably too messy an API.

Yes, callback function is needed, either in HASHCTL or as
argument to deep_free().

> In any case it's not likely that there are going to be thousands of
> prepared statements, so is this really an issue?

I think the issue is here that its very common thing to do,
so open-coding it everywhere is waste, there should be some
utility function for that.

void hash_foreach(HTAB, void (*cb_func)(void *));

--
marko

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: DEALLOCATE ALL
Next
From: Alvaro Herrera
Date:
Subject: Re: DEALLOCATE ALL