Re: Allow logical replication to copy tables in binary format
Melih Mutlu <m.melihmutlu@gmail.com>
From: Melih Mutlu <m.melihmutlu@gmail.com>
To: "shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com>,
Jelte Fennema <postgres@jeltef.nl>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: "Takamichi Osumi (Fujitsu)" <osumi.takamichi@fujitsu.com>,
Euler Taveira <euler@eulerto.com>, Amit Kapila <amit.kapila16@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Date: 2023-02-23T11:59:40Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Allow logical replication to copy tables in binary format.
- ecb696527c01 16.0 landed
-
Common function for percent placeholder replacement
- c96de2ce1782 16.0 cited
-
Doc: add XML ID attributes to <sectN> and <varlistentry> tags.
- 78ee60ed84bb 16.0 cited
-
Re-order disable_on_error in tab-complete.
- d547f7cf5efc 16.0 cited
-
Make subscription tests pass with log_error_verbosity=verbose
- 19408aae7fa2 15.0 cited
-
Weaken type-OID-matching checks in array_recv and record_recv.
- 670c0a1d474b 14.0 cited
-
Allow logical replication to transfer data in binary format.
- 9de77b545313 14.0 cited
shiy.fnst@fujitsu.com <shiy.fnst@fujitsu.com>, 23 Şub 2023 Per, 12:29 tarihinde şunu yazdı: > On Thu, Feb 23, 2023 12:40 PM Kuroda, Hayato/黒田 隼人 < > kuroda.hayato@fujitsu.com> wrote: > > > > > > I'm not sure the combination of "copy_format = binary" and > "copy_data = > > false" > > > > should be accepted or not. How do you think? > > > > > > It seems quite useless indeed to specify the format of a copy that > won't > > happen. > > > > I understood that the conbination of "copy_format = binary" and > "copy_data = > > false" > > should be rejected in parse_subscription_options() and > AlterSubscription(). Is it > > right? > > I'm expecting that is done in next version. > > > > The copy_data option only takes effect once in CREATE SUBSCIPTION or ALTER > SUBSCIPTION REFRESH PUBLICATION command, but the copy_format option can > take > affect multiple times if the subscription is refreshed multiple times. > Even if > the subscription is created with copy_date=false, copy_format can take > affect > when executing ALTER SUBSCIPTION REFRESH PUBLICATION. So, I am not sure we > want > to reject this usage. > I believe the places copy_data and copy_format are needed are pretty much the same. I couldn't think of a case where copy_format is needed but copy_data isn't. Please let me know if I'm missing something. CREATE SUBSCRIPTION, ALTER SUBSCRIPTION SET/ADD/REFRESH PUBLICATION are all the places where initial sync can happen. For all these commands, copy_data needs to be given as a parameter or it will be set to the default value which is true. Even if copy_data=false when the sub was created, REFRESH PUBLICATION (without an explicit copy_data parameter) will copy some tables if needed regardless of what copy_data was in CREATE SUBSCRIPTION. This is because copy_data is not something stored in pg_subscription or another catalog. But this is not an issue for copy_fornat since its value will be stored in the catalog. This can allow users to set the format even if copy_data=false and no initial sync is needed at that moment. So that future initial syncs which can be triggered by ALTER SUBSCRIPTION will be performed in the correct format. So, I also think we should allow setting copy_format even if copy_data=false. Another way to deal with this issue could be expecting the user to specify format every time copy_format is needed, similar to the case for copy_data, and moving on with text (default) format if it's not specified for the current CREATE/ALTER SUBSCRIPTION execution. But I don't think this would make things easier. Best, -- Melih Mutlu Microsoft