public inbox for [email protected]  
help / color / mirror / Atom feed
From: Jim Jones <[email protected]>
To: Peter Smith <[email protected]>
To: PostgreSQL Hackers <[email protected]>
Subject: Re: PSQL - prevent describe listing tables that are already in listed schemas
Date: Tue, 19 May 2026 08:23:27 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAHut+PvSOmRrQX+VrFYHtFipV9hM=p99FeOwYCzkuU2BOaLu7Q@mail.gmail.com>
References: <CAHut+PvSOmRrQX+VrFYHtFipV9hM=p99FeOwYCzkuU2BOaLu7Q@mail.gmail.com>

Hi Peter

On 18/05/2026 05:20, Peter Smith wrote:
> Here are a couple more reasons why I think this patch is helpful:
> 
> 1. If the specified table had a row filter, then it is confusing to
> display that row filter under "Tables:" when at the same time the DOCS
> [2] says "The row filter on a table becomes redundant if FOR TABLES IN
> SCHEMA is specified and the table belongs to the referred schema."
> 
> 2. The output will become still more confusing after the FOR TABLES IN
> SCHEMA EXCEPT gets implemented [1]. Because it is not obvious, you
> need to read this a couple of times to be sure what is in and out.
> e.g. Output with the EXCEPT patch applied:
> Tables:
>     "myschema2.t2"
> Tables from schemas:
>     "myschema2"
> Except tables:
>     "myschema2.t1"
> 
> ~~~
> 
> PSA patch v1. Thoughts?

+1

I agree that the proposed paatch makes it easier to read the listed
tables and better aligns with the docs.

CREATE SCHEMA s;
CREATE TABLE public.t1(c int);
CREATE TABLE s.t2(c int);
CREATE TABLE s.t3(c int);
CREATE TABLE s.t4(c int);
CREATE PUBLICATION pub1 FOR
  TABLES IN SCHEMA s,
  TABLE s.t3, s.t4, s.t2 WHERE (c > 42), public.t1;

With this patch I get:

postgres=# \dRp+ pub1
                                                     Publication pub1
 Owner | All tables | All sequences | Inserts | Updates | Deletes |
Truncates | Generated columns | Via root | Description
-------+------------+---------------+---------+---------+---------+-----------+-------------------+----------+-------------
 jim   | f          | f             | t       | t       | t       | t
     | none              | f        |
Tables:
    "public.t1"
Tables from schemas:
    "s"

Without it:

postgres=# \dRp+ pub1
                                                     Publication pub1
 Owner | All tables | All sequences | Inserts | Updates | Deletes |
Truncates | Generated columns | Via root | Description
-------+------------+---------------+---------+---------+---------+-----------+-------------------+----------+-------------
 jim   | f          | f             | t       | t       | t       | t
     | none              | f        |
Tables:
    "public.t1"
    "s.t2" WHERE (c > 42)
    "s.t3"
    "s.t4"
Tables from schemas:
    "s"

One nitpick: you forgot a \n at the end of "WHERE pn.pnpubid = '%s')".

Best, Jim








reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: PSQL - prevent describe listing tables that are already in listed schemas
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox