[#1010460] Making pgbouncer to accept connections to any existing database

View Trackers | Patches | Download .csv | Monitor

Date:
2008-08-25 21:31
Priority:
3
State:
Closed
Submitted by:
David Galoyan (davojan)
Assigned to:
Marko Kreen (mkz)
Category:
Group:
Resolution:
Accepted
 
Summary:
Making pgbouncer to accept connections to any existing database

Detailed description
This patch introduces new functionality for pgbouncer-1.2.3 via 2 new configuration options:

[pgbouncer]

; If the client application is trying to connect to the database that is not
; listed in [databases] section, than this server connection settings are used.
; The format is the same as any connection string in the [databases] section
autodb_connstr = user=example port=6000

; if an auto-database has no connections more than this many seconds
; it is dropped with it's pool (releasing resources)
autodb_idle_timeout = 86400

I have hundreds of databases and they are appering dynamically, so I can't configure every one in the ini-file. The second option is because most of databases are used rarely and should not waste resources.

With this feature I completely replaced ugly pgpool (as a connection pooler).

To apply the patch:

$ tar -zxf pgbouncer-1.2.3.tgz
$ cd pgbouncer-1.2.3
$ patch -p1 < /path/to/pgbouncer-auto-database.patch

P.S.: Special thanks to developers for their wonderful very readable and understandable code. It let me add the feature very fast.

Hope this patch (after revision) will be included in main product. You are permitted to use my code.

P.P.S.: I'm sorry for my terrible English.

Followup

Message
Date: 2009-01-13 13:47
Sender: Marko Kreen

Committed to CVS, to be released with 1.3
Date: 2008-08-27 12:26
Sender: Marko Kreen

Thanks, the patch seems reasonable.

Attached Files:

Attachments:
pgbouncer-auto-database.patch

Changes:

Field Old Value Date By
status_idOpen2009-01-13 13:47mkz
ResolutionNone2009-01-13 13:47mkz
close_date2009-01-13 13:472009-01-13 13:47mkz
assigned_tonone2008-08-27 06:57davojan
File Added353: pgbouncer-auto-database.patch2008-08-25 21:31davojan
Powered By FusionForge