| From: | Jim Jones <jim(dot)jones(at)uni-muenster(dot)de> |
|---|---|
| To: | Peter Smith <smithpb2250(at)gmail(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: PSQL - prevent describe listing tables that are already in listed schemas |
| Date: | 2026-05-20 07:03:26 |
| Message-ID: | 3af67526-2de8-4451-99be-ea5ae6dccf82@uni-muenster.de |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 20/05/2026 01:59, Peter Smith wrote:
> Apparently, there was no existing test case to demonstrate that \d+
> case you found. Do we need to bother adding one?
I think adding a test here would be worthwhile -- publications.sql
already defines the tables and publications, and a test would help catch
regressions caused by future refactoring.
What about this?
diff --git a/src/test/regress/sql/publication.sql
b/src/test/regress/sql/publication.sql
index 041e14a4de6..fac54b02e27 100644
--- a/src/test/regress/sql/publication.sql
+++ b/src/test/regress/sql/publication.sql
@@ -83,6 +83,8 @@ CREATE PUBLICATION testpub_forschema FOR TABLES IN
SCHEMA pub_test;
CREATE PUBLICATION testpub_for_tbl_schema FOR TABLES IN SCHEMA
pub_test, TABLE pub_test.testpub_nopk;
RESET client_min_messages;
\dRp+ testpub_for_tbl_schema
+-- table also covered by a published schema should appear only once in
\d output
+\d pub_test.testpub_nopk
-- weird parser corner case
CREATE PUBLICATION testpub_parsertst FOR TABLE pub_test.testpub_nopk,
CURRENT_SCHEMA;
@@ -406,6 +408,9 @@ CREATE PUBLICATION testpub6 FOR TABLES IN SCHEMA
testpub_rf_schema2;
ALTER PUBLICATION testpub6 SET TABLES IN SCHEMA testpub_rf_schema2,
TABLE testpub_rf_schema2.testpub_rf_tbl6 WHERE (i < 99);
RESET client_min_messages;
\dRp+ testpub6
+-- table with a row-filter, also covered by a published schema, should
appear
+-- only once in \d output and without the row filter
+\d testpub_rf_schema2.testpub_rf_tbl6
-- fail - virtual generated column uses user-defined function
-- (Actually, this already fails at CREATE TABLE rather than at CREATE
-- PUBLICATION, but let's keep the test in case the former gets
I previously said the issue was in \d+, but it’s actually in \d. I’ve
updated the commit message accordingly.
db=# \d testpub_rf_schema2.testpub_rf_tbl6
Table "testpub_rf_schema2.testpub_rf_tbl6"
Column | Type | Collation | Nullable | Default
--------+---------+-----------+----------+---------
i | integer | | |
Publications:
"testpub6" WHERE (i < 99)
"testpub6"
PSA v5.
Thanks!
Best, Jim
| Attachment | Content-Type | Size |
|---|---|---|
| v5-0001-Fix-psql-duplicate-items-for-dRp-and-d.patch | text/x-patch | 6.8 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Fujii Masao | 2026-05-20 07:04:06 | Re: pg_recvlogical: honor source cluster file permissions for output files |
| Previous Message | shveta malik | 2026-05-20 06:32:11 | Re: Proposal: Conflict log history table for Logical Replication |