Re: [Bug] Logical Replication failing if the DateStyle is different in Publisher & Subscriber

Поиск
Список
Период
Сортировка
От Japin Li
Тема Re: [Bug] Logical Replication failing if the DateStyle is different in Publisher & Subscriber
Дата
Msg-id MEYP282MB1669A938C4B006627070C129B6BB9@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
обсуждение исходный текст
Ответ на Re: [Bug] Logical Replication failing if the DateStyle is different in Publisher & Subscriber  (Japin Li <japinli@hotmail.com>)
Ответы Re: [Bug] Logical Replication failing if the DateStyle is different in Publisher & Subscriber  (Sadhuprasad Patro <b.sadhu@gmail.com>)
Список pgsql-hackers
On Sat, 16 Oct 2021 at 22:42, Japin Li <japinli@hotmail.com> wrote:
> On Thu, 14 Oct 2021 at 19:49, Dilip Kumar <dilipbalaut@gmail.com> wrote:
>> On Thu, Oct 14, 2021 at 3:48 PM Sadhuprasad Patro <b.sadhu@gmail.com> wrote:
>>>
>>> Hi All,
>>>
>>> Publisher 'DateStyle' is set as "SQL, MDY", whereas in Subscriber as
>>> "SQL, DMY", the logical replication is not working...
>>>
>>> From Publisher:
>>> postgres=# INSERT INTO calendar VALUES ('07-18-1036', '1'), ('05-15-1135', '1');
>>> INSERT 0 2
>>>
>>> Getting below error in the subscriber log file,
>>> 2021-10-14 00:59:23.067 PDT [38262] ERROR:  date/time field value out
>>> of range: "07/18/1036"
>>> 2021-10-14 00:59:23.067 PDT [38262] HINT:  Perhaps you need a
>>> different "datestyle" setting.
>>>
>>> Is this an expected behavior?
>>
>> Looks like a problem to me, I think for fixing this, on logical
>> replication connection always set subscriber's DateStlyle, with that
>> the walsender will always send the data in the same DateStyle that
>> worker understands and then we are good.
>
> Right! Attached fix it.

Add a test case in subscription/t/100_bugs.pl.  Please consider the v2 patch
for review.

--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Reset snapshot export state on the transaction abort
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: GIN pending list cleanup during autoanalyze blocks cleanup by VACUUM