Re: Create publication syntax is not coming properly in pg_dump / pg_dumpall

From: Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Create publication syntax is not coming properly in pg_dump / pg_dumpall
Date: 2017-05-15 09:49:45
Message-ID: CAGz5QC+x8-Di=y6H-qp1pVzTbwFRYWEOnFJzUTpaJ+Uy41Uv7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 15, 2017 at 3:06 PM, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> On Mon, May 15, 2017 at 5:04 PM, tushar <tushar(dot)ahuja(at)enterprisedb(dot)com> wrote:
>> Hi,
>>
>> I observed that in pg_dump/pg_dumpall - 'create publication' syntax is not
>> coming properly if only specified value is mentioned in publish.
>>
>> Testcase to reproduce -
>>
>> \\create a publication
>>
>> postgres=# CREATE PUBLICATION abc for all tables with (publish='insert');
>> CREATE PUBLICATION
>>
>> \\take the plain dump
>>
>> [centos(at)centos-cpula bin]$ ./pg_dump -FP -p 5000 postgres > /tmp/a.a
>>
>> \\check the syntax
>>
>> [centos(at)centos-cpula bin]$ cat /tmp/a.a |grep 'create publication abc' -i
>> CREATE PUBLICATION abc FOR ALL TABLES WITH (publish = 'insert, , ');
>>
>> \\try to execute the same syntax against psql terminal
>>
>> postgres=# CREATE PUBLICATION abc FOR ALL TABLES WITH (publish = 'insert, ,
>> ');
>> ERROR: invalid publish list
>>
>> Same is valid for pg_dumpall as well..
>>
>
> Thank you for reporting.
>
> Hm, It's a bug of pg_dump. Attached patch should fix both pg_dump and
> pg_dumpall.
>
I've reproduced the bug and the patch fixes the issue for me. Also,
tested with different combinations of insert, delete and update.

--
Thanks & Regards,
Kuntal Ghosh
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2017-05-15 10:02:31 Re: Bug in ExecModifyTable function and trigger issues for foreign tables
Previous Message tushar 2017-05-15 09:41:02 Server Crashes if try to provide slot_name='none' at the time of creating subscription.