Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aP4OC-0000Y5-Qc for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Jan 2016 08:26:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aP4OC-0005TO-2q for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Jan 2016 08:26:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aP4NZ-0004mG-F2 for pgsql-bugs@postgresql.org; Fri, 29 Jan 2016 08:26:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aP4NV-0005yc-CU for pgsql-bugs@postgresql.org; Fri, 29 Jan 2016 08:26:04 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u0T8PskY015527; Fri, 29 Jan 2016 03:25:56 -0500 From: Tom Lane To: Michael Paquier cc: reece@harts.net, PostgreSQL mailing lists Subject: Re: BUG #13899: \det ignores visibility; patch attached In-reply-to: References: <20160129003430.2537.11998@wrigleys.postgresql.org> Comments: In-reply-to Michael Paquier message dated "Fri, 29 Jan 2016 13:55:11 +0900" Date: Fri, 29 Jan 2016 09:25:54 +0100 Message-ID: <2482.1454055954@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Michael Paquier writes: > On Fri, Jan 29, 2016 at 9:34 AM, wrote: >> --- src/bin/psql/describe.c.orig 2016-01-28 16:22:33.782890246 -0800 >> +++ src/bin/psql/describe.c 2016-01-28 16:31:08.052200101 -0800 >> @@ -4412,7 +4412,8 @@ >> "d.objoid = c.oid AND d.objsubid = 0\n"); >> >> processSQLNamePattern(pset.db, &buf, pattern, false, false, >> - NULL, "n.nspname", "c.relname", NULL); >> + NULL, "n.nspname", "c.relname", >> + "pg_catalog.pg_table_is_visible(c.oid)"); >> >> appendPQExpBufferStr(&buf, "ORDER BY 1, 2;"); > Hm. I don't think so, the current behavior looks to be on purpose. \dE > instead can be used to match the visibility with search_path, so I > would rather modify the documentation to mention that \d[Eitstv] > matches the schema visibility in search_path instead and let \det > alone. No, I think it's just plain broken. There are two bugs there, not just one, as can be seen by comparison of this processSQLNamePattern call to every other one that's dealing with schema-qualifiable names. It should be more like processSQLNamePattern(pset.db, &buf, pattern, false, false, "n.nspname", "c.relname", NULL, "pg_catalog.pg_table_is_visible(c.oid)"); As-is, it's passing nspname for "namevar" and relname for "altnamevar". That sort of manages to not fail for unqualified names, but even there, I fail to see how matching to schema names is anything but a bug. This code came in with some other \d commands for other FDW-related objects that do not have schema-qualified names, so I guess that it was just mis-copied-and-pasted from one of those. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs