Re: \d don't print all the tables

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: \d don't print all the tables
Date: 2023-07-24 13:17:45
Message-ID: ecdc6051-906b-343d-ac54-294fd2d81716@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7/23/23 21:25, Wen Yi wrote:
> Hi community,
> here's my shell:
>
> postgres=# \d
> Did not find any relations.
> postgres=# create schema namespace_a;
> CREATE SCHEMA
> postgres=# create schema namespace_b;
> CREATE SCHEMA
> postgres=# create table simple (name varchar);
> CREATE TABLE
> postgres=# create table namespace_a.simple (name varchar);
> CREATE TABLE
> postgres=# create table namespace_b.simple (name varchar);
> CREATE TABLE
> postgres=# \d
>          List of relations
>  Schema |  Name  | Type  |  Owner
> --------+--------+-------+----------
>  public | simple | table | postgres
> (1 row)
>
> postgres=#
>
> I think it should print the table on namespace_a & namespace_b, not just
> public, it really confused me.
> Can someone give me some advice?

Add namespace_a and namespace_b to your search_path.  Then it will work.

Off the top of my head:
SET search_path = namespace_a, namespace_b, public;

--
Born in Arizona, moved to Babylonia.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2023-07-24 13:21:08 Re: Grant all privileges to user on a database
Previous Message Kaushal Shriyan 2023-07-24 13:15:42 Grant all privileges to user on a database