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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
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 21:26:16
Message-ID: 16569.1287177976@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

Stephen Frost <sfrost(at)snowman(dot)net> writes:
> 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.

Hm, are you sure you actually got a "permission denied" error? Because
AFAICS such a message would name the schema:

regression=> select * from s1.t1;
ERROR: permission denied for schema s1

The part that is a bit nasty is if you try to put a schema in your
search_path that you don't have permissions for. My recollection is
that we just silently drop it out of the effective search path, so:

regression=> set search_path = s1, public;
SET
regression=> select current_schemas(false);
current_schemas
-----------------
{public}
(1 row)

regression=> select * from t1;
ERROR: relation "t1" does not exist

This isn't terribly user-friendly, but I'm not sure how to do better.
We can't really throw an error at the point of setting the search
path, because there are too many scenarios where a default search
path is effectively set up for you, and it might or might not list
some unsearchable (or even nonexistent) schemas.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-10-15 21:32:13 Re: Git migration deadline for Buildfarm
Previous Message Robert Haas 2010-10-15 21:13:55 Re: string function - "format" function proposal

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2010-10-16 00:51:48 Re: DatabaseMetaData.getTablePrivileges()
Previous Message Stephen Frost 2010-10-15 20:58:15 Re: [JDBC] Support for JDBC setQueryTimeout, et al.