RE: Allow logical replication to copy tables in binary format

Поиск
Список
Период
Сортировка
Искать
От
shiy.fnst@fujitsu.com
Тема
RE: Allow logical replication to copy tables in binary format
Дата
Msg-id
OSZPR01MB6310B58F069FF8E148B247FDFDA49@OSZPR01MB6310.jpnprd01.prod.outlook.com
Ответ на
Список
Дерево обсуждения
Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Andres Freund <andres@anarazel.de>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format "Euler Taveira" <euler@eulerto.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format "Euler Taveira" <euler@eulerto.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format "Euler Taveira" <euler@eulerto.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
RE: Allow logical replication to copy tables in binary format "osumi.takamichi@fujitsu.com" <osumi.takamichi@fujitsu.com>
RE: Allow logical replication to copy tables in binary format "osumi.takamichi@fujitsu.com" <osumi.takamichi@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
RE: Allow logical replication to copy tables in binary format "osumi.takamichi@fujitsu.com" <osumi.takamichi@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
RE: Allow logical replication to copy tables in binary format "shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format vignesh C <vignesh21@gmail.com>
RE: Allow logical replication to copy tables in binary format "Takamichi Osumi (Fujitsu)" <osumi.takamichi@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
RE: Allow logical replication to copy tables in binary format "shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Dilip Kumar <dilipbalaut@gmail.com>
Re: Allow logical replication to copy tables in binary format Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Peter Smith <smithpb2250@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Peter Smith <smithpb2250@gmail.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Peter Smith <smithpb2250@gmail.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Peter Smith <smithpb2250@gmail.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
RE: Allow logical replication to copy tables in binary format "Takamichi Osumi (Fujitsu)" <osumi.takamichi@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
RE: Allow logical replication to copy tables in binary format "Takamichi Osumi (Fujitsu)" <osumi.takamichi@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format vignesh C <vignesh21@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Peter Smith <smithpb2250@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Peter Smith <smithpb2250@gmail.com>
RE: Allow logical replication to copy tables in binary format "shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com>
RE: Allow logical replication to copy tables in binary format "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>
RE: Allow logical replication to copy tables in binary format "shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Peter Smith <smithpb2250@gmail.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Peter Smith <smithpb2250@gmail.com>
Re: Allow logical replication to copy tables in binary format "Euler Taveira" <euler@eulerto.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Peter Smith <smithpb2250@gmail.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Peter Smith <smithpb2250@gmail.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format vignesh C <vignesh21@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Peter Smith <smithpb2250@gmail.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Peter Smith <smithpb2250@gmail.com>
RE: Allow logical replication to copy tables in binary format "shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
RE: Allow logical replication to copy tables in binary format "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
RE: Allow logical replication to copy tables in binary format "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
RE: Allow logical replication to copy tables in binary format "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
RE: Allow logical replication to copy tables in binary format "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Peter Smith <smithpb2250@gmail.com>
Re: Allow logical replication to copy tables in binary format Amit Kapila <amit.kapila16@gmail.com>
Re: Allow logical replication to copy tables in binary format Kuntal Ghosh <kuntalghosh.2007@gmail.com>
Re: Allow logical replication to copy tables in binary format Peter Smith <smithpb2250@gmail.com>
RE: Allow logical replication to copy tables in binary format "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
RE: Allow logical replication to copy tables in binary format "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Peter Smith <smithpb2250@gmail.com>
Re: Allow logical replication to copy tables in binary format Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Allow logical replication to copy tables in binary format Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Allow logical replication to copy tables in binary format Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format vignesh C <vignesh21@gmail.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Allow logical replication to copy tables in binary format Jelte Fennema <postgres@jeltef.nl>
RE: Allow logical replication to copy tables in binary format "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Jelte Fennema <postgres@jeltef.nl>
RE: Allow logical replication to copy tables in binary format "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
RE: Allow logical replication to copy tables in binary format "shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
Re: Allow logical replication to copy tables in binary format Jelte Fennema <postgres@jeltef.nl>
RE: Allow logical replication to copy tables in binary format "Takamichi Osumi (Fujitsu)" <osumi.takamichi@fujitsu.com>
RE: Allow logical replication to copy tables in binary format "Takamichi Osumi (Fujitsu)" <osumi.takamichi@fujitsu.com>
Re: Allow logical replication to copy tables in binary format Melih Mutlu <m.melihmutlu@gmail.com>
RE: Allow logical replication to copy tables in binary format "Takamichi Osumi (Fujitsu)" <osumi.takamichi@fujitsu.com>
On Thu, Feb 16, 2023 8:48 PM Amit Kapila  wrote:
> 
> On Mon, Jan 30, 2023 at 4:19 PM Melih Mutlu 
> wrote:
> >
> > Logical replication between different types like int and smallint is already not
> working properly on HEAD too.
> > Yes, the scenario you shared looks like working. But you didn't create the
> subscription with binary=true. The patch did not change subscription with
> binary=false case. I believe what you should experiment is binary=true case
> which already fails in the apply phase on HEAD.
> >
> > Well, with this patch, it will begin to fail in the table copy phase. But I don't
> think this is a problem because logical replication in binary format is already
> broken for replications between different data types.
> >
> 
> So, doesn't this mean that there is no separate failure mode during
> the initial copy? I am clarifying this to see if the patch really
> needs a separate copy_format option for initial sync?
> 

In the case that the data type doesn't have binary output function, for apply
phase, the column will be sent in text format (see logicalrep_write_tuple()) and
it works fine. But with copy_format = binary, the walsender exits with an
error.

For example:
-- create table on publisher and subscriber
CREATE TYPE myvarchar;
CREATE FUNCTION myvarcharin(cstring, oid, integer) RETURNS myvarchar
LANGUAGE internal IMMUTABLE PARALLEL SAFE STRICT AS 'varcharin';
CREATE FUNCTION myvarcharout(myvarchar) RETURNS cstring
LANGUAGE internal IMMUTABLE PARALLEL SAFE STRICT AS 'varcharout';
CREATE TYPE myvarchar (
    input = myvarcharin,
    output = myvarcharout,
    alignment = integer,
    storage = main
);
CREATE TABLE tbl1 (a myvarchar);

-- create publication and insert some data on publisher
create publication pub for table tbl1;
INSERT INTO tbl1 values ('a');

-- create subscription on subscriber
create subscription sub connection 'dbname=postgres port=5432' publication pub with(binary, copy_format = binary);

Then I got the following error in the publisher log.

walsender ERROR:  no binary output function available for type public.myvarchar
walsender STATEMENT:  COPY public.tbl1 (a) TO STDOUT  WITH (FORMAT binary)

Regards,
Shi Yu
В списке pgsql-hackers по дате отправления
От: Richard Guo
Дата:
От: David Geier
Дата:
FAQ