Re: Bug? Prepared queries continue to use search_path from their preparation time

From: Toby Corkindale <toby(dot)corkindale(at)strategicdata(dot)com(dot)au>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Bug? Prepared queries continue to use search_path from their preparation time
Date: 2012-07-13 01:46:54
Message-ID: 4FFF7E0E.2010308@strategicdata.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 13/07/12 02:59, Greg Sabino Mullane wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
>
>
>>> This behavior is intentional.
>
>> In that case, the error lies with the Perl libraries that automatically
>> prepare and cache queries, but do not include the search_path in the
>> cache keys.
>
> You have lost me there. Which Perl libraries are those?

I was thinking of DBIx::Class, which will automatically use the DBI
function prepare_cached() for all the queries it generates.

However I discovered this warning hidden deep in the documentation:

"[..] once your schema is instantiated, you should not change the
PostgreSQL schema search path for that schema's database connection. If
you do, Bad Things may happen."

So they are aware of the problem, but unfortunately I hadn't seen that
warning (and I suspect most users won't) until after they've encountered
the problem.

I guess for now I chalk this up to experience and remember not to do it
again! :)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message raghu ram 2012-07-13 05:23:04 Re: ERROR: out of shared memory - But the table is empty
Previous Message Craig Ringer 2012-07-12 23:57:55 Re: PostgreSQL index issue