Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bi1XV-0004T1-Bi for pgsql-bugs@arkaria.postgresql.org; Thu, 08 Sep 2016 15:46:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bi1XU-0006q2-Me for pgsql-bugs@arkaria.postgresql.org; Thu, 08 Sep 2016 15:46:56 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bi1XT-0006nK-II for pgsql-bugs@postgresql.org; Thu, 08 Sep 2016 15:46:55 +0000 Received: from hogranch.com ([75.101.82.47]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bi1XP-0000Ms-QB for pgsql-bugs@postgresql.org; Thu, 08 Sep 2016 15:46:54 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id u88Fklv07996; Thu, 8 Sep 2016 08:46:47 -0700 Subject: Re: BUG #14317: psql \dt not working as expected To: lucian.ciufudean@gmail.com, pgsql-bugs@postgresql.org References: <20160908154003.1410.72854@wrigleys.postgresql.org> From: John R Pierce Message-ID: Date: Thu, 8 Sep 2016 08:46:42 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160908154003.1410.72854@wrigleys.postgresql.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -3.0 (---) 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 On 9/8/2016 8:40 AM, lucian.ciufudean@gmail.com wrote: > If one creates a table with the same name as one of the pg_catalog tables > > 1. CREATE TABLE pg_tables ( > name varchar(80), > location point > ); > > then \dt will not show it: > > List of relations > Schema | Name | Type | Owner > --------+--------+-------+---------- > public | cities | table | postgres > (1 row) > > while this query will: > > select * from pg_tables; > > Expectations: \dt shows all tables in the public schema. > > Note that it is also unexpected that this query: > > select * from pg_tables; > > goes to pg_catalog.pg_tables instead of public.pg_tables. this is because pg_catalog is implicitly in the search path in front of any explicit search path you specify, including the default of `$user,public` ... suggestion: don't use names like pg_XXXXX for anything. -- john r pierce, recycling bits in santa cruz -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs