Re: \d is not showing global(normal) table info if we create temporary table with same name as global table

Robert Haas <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.general
Message-ID <CA+TgmoYiebnrAb+h=_gC8oU7m0vu7dLEMDcVaTm+BFhY6gPN=g@mail.gmail.com>
On Thu, Jan 2, 2020 at 12:59 PM Mahendra Singh <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.