Skip site navigation (1) Skip section navigation (2)


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>
Date: 2007-03-27 14:29:53
Message-ID: (view raw, whole thread or download thread mbox)
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.


Attachment: dealloc_all.diff
Description: application/octet-stream (6.6 KB)


pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group