Re: [JDBC] Support for JDBC setQueryTimeout, et al.

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>, Radosław Smogura <rsmogura(at)softperience(dot)eu>, Magnus Hagander <magnus(at)hagander(dot)net>, David Fetter <david(at)fetter(dot)org>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>, PostgreSQL JDBC List <pgsql-jdbc(at)postgresql(dot)org>, robertmhaas(at)gmail(dot)com
Subject: Re: [JDBC] Support for JDBC setQueryTimeout, et al.
Date: 2010-10-15 20:58:15
Message-ID: 20101015205815.GU26232@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> Stephen Frost <sfrost(at)snowman(dot)net> writes:
> >> The whole problem with search_path and role is very frustrating. We've
> >> taken to just hacking things to be dynamic SQL whenever it's
> >> role-specific, but that's a really poor solution. I wonder if it would
> >> be possible to have the function and prepare'd plan caches be key'd off
> >> of the search_path and role too..? So if you change one of those you
> >> end up having to re-plan it, but then that's also cached, etc..
>
> FWIW, I can see the point of making cached plan lookup be
> search-path-specific. But why does the active role need to factor
> into it?

Because of $user being used in the search_path. Thinking about it, I'm
sure we'd handle the look-up at query time and would resolve the $user
in the search_path to an actual schema first, so the cache doesn't need
to be keyed off role itself.

IOW, yeah, you're right, the role doesn't really matter. One thing that
occurs to me when I last ran into a problem with this- it was painful to
debug because the "permission denied" error didn't indicate which schema
the table it was trying to access was in. I wonder if we could fix
that.

Thanks,

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2010-10-15 21:03:14 Re: Git migration deadline for Buildfarm
Previous Message Dimitri Fontaine 2010-10-15 20:45:18 Trailing Whitespace Tips (was: Re: starting to review the Extend NOT NULL representation to pg_constraint patch)

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2010-10-15 21:26:16 Re: [JDBC] Support for JDBC setQueryTimeout, et al.
Previous Message Tom Lane 2010-10-15 20:22:51 Re: [JDBC] Support for JDBC setQueryTimeout, et al.