DEALLOCATE ALL

From: "Marko Kreen" <markokr(at)gmail(dot)com>
To: PGSQL-Patches <pgsql-patches(at)postgresql(dot)org>
Cc: "Andrzej Rusin" <Andrzej(dot)Rusin(at)interia(dot)pl>
Subject: DEALLOCATE ALL
Date: 2007-03-27 14:29:53
Message-ID: e51f66da0703270729n4726dd14s992f6a2ed2e351@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

When pooling connections where prepared statements are in use,
it is hard to give new client totally clean connection as
there may be allocated statements that give errors when
new client starts preparing statements again.

Currently PgPool solves the situation by parsing all queries
and keeping list of prepares statements. This may not be a big
problem for it as it parses the queries anyway, but for simple
pooler like PgBouncer (see pgfoundry) that does not look inside
libpq packets it is huge problem.

Attached is a patch that allows keyword ALL to be used with
DEALLOCATE and then frees all prepared queryes. I think it is
useful for most pooling situations, not only PgBouncer.
Also its similar in the spirit to RESET ALL.

I did it slightly hacky way - if DeallocateStmt->name is
NULL is signifies DEALLOCATE ALL command. All the code
that looks into DeallocateStmt seems to survive the situation
so it should be problem. If still a new node is needed
or additional field in the node I can rework the patch.

--
marko

Attachment Content-Type Size
dealloc_all.diff application/octet-stream 6.6 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2007-03-27 14:29:54 Re: Unbroke srcdir!=builddir compilation
Previous Message Bruce Momjian 2007-03-27 14:28:54 Re: Fast CLUSTER