Re: How is this possible "publication does not exist" - Mailing list pgsql-bugs

From Amit Kapila
Subject Re: How is this possible "publication does not exist"
Date
Msg-id CAA4eK1J+i3w3CMLqS1F9JoqREjcii0uoV0diPPn1FnC_ofQaVA@mail.gmail.com
Whole thread Raw
In response to How is this possible "publication does not exist"  (operations i <ioperations.c@gmail.com>)
List pgsql-bugs
On Thu, Jun 2, 2022 at 9:11 AM operations i <ioperations.c@gmail.com> wrote:
sorry, I still confused ,as we have already created the publication "pub_test" , but during database runtime, function GetPublicationByName() does not get system catalog cache, Is there any mechanism  that could make system catalog expand or shrink?

The system catalog doesn't expand or shrink in this case but rather it uses a snapshot to check the visibility of rows present. Here, we use historic snapshots to check the visibility of the publication row. Even though it is present in the catalog, it won't be visible, so you are getting an error. Here, the snapshot is built from WAL starting from the point where you created a slot. As the publication is created after Insert when you are trying to decode Insert, the required publication is not visible and hence you are getting the error. You might want to read src/backend/replication/logical/snapbuild.c to understand how the required snapshots are built from WAL.

--
With Regards,
Amit Kapila.

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #17504: psql --single-transaction -vON_ERROR_STOP=1 still commits after client-side error
Next
From: Shaheed Haque
Date:
Subject: Unable to make use of "deep" JSONB index