Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 4FCBA1337B7D for ; Fri, 15 Oct 2010 18:26:30 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 55749-04 for ; Fri, 15 Oct 2010 21:26:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 539DF1335B36 for ; Fri, 15 Oct 2010 18:26:22 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o9FLQGm3016570; Fri, 15 Oct 2010 17:26:16 -0400 (EDT) To: Stephen Frost cc: Dimitri Fontaine , =?utf8?B?UmFkb3PFgmF3?= Smogura , Magnus Hagander , David Fetter , Kevin Grittner , PG Hackers , PostgreSQL JDBC List , robertmhaas@gmail.com Subject: Re: [JDBC] Support for JDBC setQueryTimeout, et al. In-reply-to: <20101015205815.GU26232@tamriel.snowman.net> References: <20101012155531.GB29627@fetter.org> <528f31015d6bf68650646b9b4ba71a10@smogura-softworks.eu> <20101015142126.GQ26232@tamriel.snowman.net> <20260.1287153534@sss.pgh.pa.us> <20101015145248.GR26232@tamriel.snowman.net> <11068.1287174171@sss.pgh.pa.us> <20101015205815.GU26232@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Fri, 15 Oct 2010 16:58:15 -0400" Date: Fri, 15 Oct 2010 17:26:16 -0400 Message-ID: <16569.1287177976@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/1053 X-Sequence-Number: 172093 Stephen Frost 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