On Sat, Dec 11, 2010 at 11:40:17PM +0100, hubert depesz lubaczewski wrote: > Hi, > another question: is there any way to change database connections > options from config? > I.e. I want to change what's being passed as 4th argument to > DBI->connect().
You'd need to patch DBIx::SearchBuilder to provide an option for RT to
use and then patch RT to use that option.
-kevin
> Reason for this is pretty simple: I'm using PostgreSQL, and DBD::Pg is
> choosing by default to use server side prepared statements. I don't like
> them, and would like to disable them, but I'd prefer not to modify RT
> source itself, so I was hoping for some way to make it happen from
> config.
>
> To show some example.
>
> When $dbh is created like this;
>
> $dbh = DBI->connect( 'dbi:Pg:dbname=xxx', 'yy', 'zz' );
>
> DBD::Pg will use server side prepared statements.
>
> To disable this "feature", one have to either:
>
> $dbh->{pg_server_prepare} = 0;
>
> or:
>
> $dbh = DBI->connect( 'dbi:Pg:dbname=xxx', 'yy', 'zz', { pg_server_prepare =>
> 0 } );
>
> In case you need to know why i want to disable server side prepared
> statements:
> 1. http://www.depesz.com/index.php/2008/05/10/prepared-statements-gotcha/
> 2. it breaks connection pooling with pgbouncer (and I know I can use
> different pooling mode, but "session pooling" is pretty much useless)
pgpcT8tVBTr3H.pgp
Description: PGP signature
