Re: getting tables list of other schema too

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Atul Kumar <akumar14871(at)gmail(dot)com>, Thomas Boussekey <thomas(dot)boussekey(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: getting tables list of other schema too
Date: 2021-02-24 11:11:31
Message-ID: 4c0611239a1d6e481c439fd9b626268d632ff760.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2021-02-24 at 15:54 +0530, Atul Kumar wrote:
>
> > > I have postgres 9.6 cluster running on centos 7 machine.
> > > when I set search_path to any user made schema with below command
> > > [enterprisedb(at)stg-edb02 ~ 01:51:39]$ psql edb
> > > edb=# \c test
> > > set search_path to college;
> > > and after listing the tables with command \dt, we should get list of
> > > tables of schema college only.
> > > but here I am getting list of tables of schema college and list of
> > > tables of schema sys along with it.
> > > Why is it happening, please suggest.
> > > test=# \dt
> > > List of relations
> > > Schema | Name | Type | Owner
> > > --------+---------------------------------+-------+--------------
> > > college | ta_rule_error | table | college
> > > college | team_import | table | college
> > > college | test_24022021 | table | enterprisedb
> > > sys | callback_queue_table | table | enterprisedb
> > > sys | dual | table | enterprisedb
> > > sys | edb$session_wait_history | table | enterprisedb
> > > sys | edb$session_waits | table | enterprisedb
> > > sys | edb$snap | table | enterprisedb
> > > sys | edb$stat_all_indexes | table | enterprisedb
> > > sys | edb$stat_all_tables | table | enterprisedb
> > > sys | edb$stat_database | table | enterprisedb
> > > sys | edb$statio_all_indexes | table | enterprisedb
> > > sys | edb$statio_all_tables | table | enterprisedb
> > > sys | edb$system_waits | table | enterprisedb
> > > sys | plsql_profiler_rawdata | table | enterprisedb
> > > sys | plsql_profiler_runs | table | enterprisedb
> > > sys | plsql_profiler_units | table | enterprisedb
> > > sys | product_component_version | table | enterprisedb
> > > sys | scheduler_0100_component_name | table | college
> > > sys | scheduler_0200_program | table | college
> > > sys | scheduler_0250_program_argument | table | college
> > > sys | scheduler_0300_schedule | table | college
> > > sys | scheduler_0400_job | table | college
> > > sys | scheduler_0450_job_argument | table | college
>
> yes I know that, but my doubt is why \dt is showing tables of other
> schemas even I am setting the search_path.

The problem is that you are not running PostgreSQL, but EnterpriseDB's
closed source fork, and they obviously hacked the "search_path" so that
it automatically includes a "sys" schema, but they were not consistent
enough to exclude that schema from "\dt".

You could complain to EnterpriseDB --- in my opinion, that schema should
only show up in "\dtS" output.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2021-02-24 11:12:26 Re: getting tables list of other schema too
Previous Message Atul Kumar 2021-02-24 10:24:42 Re: getting tables list of other schema too