[ruby-dbi-users] dbd_pg and deallocating prepared statements

Erik Hollensbe erik at hollensbe.org
Mon Sep 1 17:11:16 EDT 2008


On Tuesday 26 August 2008 18:56:40 KUBO Takehiro wrote:
> Pardon me if I'm not correct. I have been interested in how various
> DBMSs implement prepared statements. But I have not used postgresql
> for 9 years.
>
> dbd_pg uses prepared statements for all queries. But who deallocate the
> prepared statements? "@stmt.clear if @stmt" doesn't do it.
> IMO, if a ruby process uses one database session for all SQL statements
> and issues them periodically, server side (postmaster) memory will be
> increased as time goes.
>
> See: http://www.postgresql.org/docs/8.3/static/libpq-exec.html#AEN30965
>      http://www.postgresql.org/docs/8.3/static/sql-deallocate.html

This bug (and a type handling bug in mysql) have been fixed in the recent git 
push. If anyone has some spare time and would just like to run the test suite 
which should reveal any issues in either of these changes, it'll ease my mind 
to release it today.

Thanks again for the help in solving this problem.

-Erik


More information about the ruby-dbi-users mailing list