Re: create subscription with (origin = none, copy_data = on) - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: create subscription with (origin = none, copy_data = on)
Date
Msg-id CAA4eK1LO-nRNeYp4y-=5nLG0HHFnrCZaychbyvUaV43=cWOsbQ@mail.gmail.com
Whole thread Raw
In response to Re: create subscription with (origin = none, copy_data = on)  (vignesh C <vignesh21@gmail.com>)
List pgsql-hackers
On Sat, Jan 18, 2025 at 10:31 AM vignesh C <vignesh21@gmail.com> wrote:
>
> Attached patch has the fix for this issue which includes the partition
> tables also for the publication now and throws a warning
> appropriately.
>

The corresponding query (see "To find which tables might potentially
include non-local origins .." on [1]) on the create_subscription doc
page.

*
@@ -1147,10 +1151,12 @@ pg_get_publication_tables(PG_FUNCTION_ARGS)
     *schemarelids;

  relids = GetPublicationRelations(pub_elem->oid,
+ allparttables ? PUBLICATION_PART_ALL :
  pub_elem->pubviaroot ?
  PUBLICATION_PART_ROOT :
  PUBLICATION_PART_LEAF);
  schemarelids = GetAllSchemaPublicationRelations(pub_elem->oid,
+ allparttables ? PUBLICATION_PART_ALL :
  pub_elem->pubviaroot ?
  PUBLICATION_PART_ROOT :
  PUBLICATION_PART_LEAF);

Don't we need to add similar handling FOR ALL TABLES case? If not, why?

BTW, the proposed fix is not backpatcheable as it changes the catalog
which requires catversion bump. However, as this is a WARNING case, if
we can't find a fix that can't be backpatched, we can fix it in
HEAD-only.

[1] - https://www.postgresql.org/docs/devel/sql-createsubscription.html#SQL-CREATESUBSCRIPTION-NOTES

--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: Replace current implementations in crypt() and gen_salt() to OpenSSL
Next
From: "ISHAN CHHANGANI ."
Date:
Subject: How to deinitialize a connection for background worker