mirror of
https://github.com/postgres/postgres.git
synced 2026-06-08 16:26:30 -04:00
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>
This commit is contained in:
parent
f112f175a4
commit
2d460179ba
1 changed files with 3 additions and 4 deletions
|
|
@ -2537,10 +2537,9 @@ describeOneTableDetails(const char *schemaname,
|
|||
{
|
||||
printfPQExpBuffer(&buf,
|
||||
"SELECT pub.pubname\n"
|
||||
" FROM pg_catalog.pg_publication pub\n"
|
||||
" LEFT JOIN pg_catalog.pg_publication_rel pr\n"
|
||||
" ON (pr.prpubid = pub.oid)\n"
|
||||
"WHERE pr.prrelid = '%s' OR pub.puballtables\n"
|
||||
" FROM pg_catalog.pg_publication pub,\n"
|
||||
" pg_catalog.pg_get_publication_tables(pub.pubname)\n"
|
||||
"WHERE relid = '%s'\n"
|
||||
"ORDER BY 1;",
|
||||
oid);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue