Re: \d is not showing global(normal) table info if we createtemporary table with same name as global table - Mailing list pgsql-hackers

From Robert Haas
Subject Re: \d is not showing global(normal) table info if we createtemporary table with same name as global table
Date
Msg-id CA+TgmoYiebnrAb+h=_gC8oU7m0vu7dLEMDcVaTm+BFhY6gPN=g@mail.gmail.com
Whole thread Raw
In response to \d is not showing global(normal) table info if we create temporarytable with same name as global table  (Mahendra Singh <mahi6run@gmail.com>)
Responses Re: \d is not showing global(normal) table info if we create temporary table with same name as global table  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Jan 2, 2020 at 12:59 PM Mahendra Singh <mahi6run@gmail.com> wrote:
> While reading code and doing some testing, I found that if we create a temporary table with same name as we created a
normal(global)table, then \d is showing only temporary table info.
 

That's because the query that \d issues to the backend includes:

  AND pg_catalog.pg_table_is_visible(c.oid)

So I'd say it's not a bug, because that bit of SQL didn't get included
in the query by accident.

Whether it is the behavior that everybody wants is debatable, but I
think it's been this way since 2002. See commit
039cb479884abc28ee494f6cf6c5e7ec26b88fc8.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: backup manifests
Next
From: Tom Lane
Date:
Subject: Re: \d is not showing global(normal) table info if we create temporary table with same name as global table