Re: logical replication: \dRp+ and "for all tables"

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: logical replication: \dRp+ and "for all tables"
Date: 2017-06-14 23:47:15
Message-ID: CAKFQuwbCQ-pQjyJKFPiYxeYFMeRCG6X-KmggZ39gJx7siRts7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 14, 2017 at 4:10 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> I was hoping we'd get some more votes in this thread, but it seems like
> we've only got three, and by my count two of them are for just printing
> "all tables".

The following looks right - given a publication it would nice to know if
its for all tables or not.

\dRp
! List of publications
! Name | Owner | All Tables | Inserts |
Updates | Deletes
!
--------------------+--------------------------+------------+---------+---------+---------
! testpib_ins_trunct | regress_publication_user | f | t | f
| f
! testpub_default | regress_publication_user | f | t | t
| t

This [I couldn't find a regression diff entry where "All Tables" is true :(
...]

\dRp+ testpub3
! Publication testpub3
! All Tables | Inserts | Updates | Deletes
! ------------+---------+---------+---------
! f | t | t | t
Tables:
"public.testpub_tbl3"
"public.testpub_tbl3a"

I agree with Tom and Masahiko Sawada, if "All Tables" is false we continue
to show "Tables:\n\t[tables]" but when "All Tables" is true we'd write
something like "Tables: All Tables in Database". The user can query the
database if they wish to know the names of all those tables exactly.

I suppose we could go further here, say by simplifying "public.tbl1,
public.tbl2", when public only contains two tables, to "public.*". Or
consider never listing more than some small number of rows and provide a
"show all" option (\dRp++ or just a function/view) that would list every
single table. But I would go with the default "+" behavior being to show
table names when the listing of tables is fixed and to say "All Tables in
Database" when it is dynamic. In "+" mode that makes the "All Tables"
boolean redundant though I'd keep it around for consistency.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Kirkwood 2017-06-14 23:48:39 Re: logical replication: \dRp+ and "for all tables"
Previous Message Andres Freund 2017-06-14 23:29:22 Re: subscription worker signalling wal writer too much