Content-Length: 268061 | pFad | http://github.com/postgrespro/postgres/commit/2d460179baa8744e9e2a183a5121306596c53fba

8B psql: Fix display of whether table is part of publication · postgrespro/postgres@2d46017 · GitHub
Skip to content

Commit 2d46017

Browse files
committed
psql: Fix display of whether table is part of publication
If a FOR ALL TABLES publication was present, \d of a table would claim for each table that it was part of the publication, even for tables that are ignored for this purpose, such as system tables and unlogged tables. Fix the query by using the function pg_get_publication_tables(), which was intended for this purpose. Reported-by: tushar <tushar.ahuja@enterprisedb.com> Reviewed-by: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> Reviewed-by: Kuntal Ghosh <kuntalghosh.2007@gmail.com>
1 parent f112f17 commit 2d46017

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/bin/psql/describe.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2537,10 +2537,9 @@ describeOneTableDetails(const char *schemaname,
25372537
{
25382538
printfPQExpBuffer(&buf,
25392539
"SELECT pub.pubname\n"
2540-
" FROM pg_catalog.pg_publication pub\n"
2541-
" LEFT JOIN pg_catalog.pg_publication_rel pr\n"
2542-
" ON (pr.prpubid = pub.oid)\n"
2543-
"WHERE pr.prrelid = '%s' OR pub.puballtables\n"
2540+
" FROM pg_catalog.pg_publication pub,\n"
2541+
" pg_catalog.pg_get_publication_tables(pub.pubname)\n"
2542+
"WHERE relid = '%s'\n"
25442543
"ORDER BY 1;",
25452544
oid);
25462545

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/2d460179baa8744e9e2a183a5121306596c53fba

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy