Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-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;
regression=> select current_schemas(false);
(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

pgsql-hackers by date

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

pgsql-jdbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group