Re: 回复: [External]Re: BUG #18540: Does PG16 standby database support function pg_replication_origin_advance? - Mailing list pgsql-bugs

From Bertrand Drouvot
Subject Re: 回复: [External]Re: BUG #18540: Does PG16 standby database support function pg_replication_origin_advance?
Date
Msg-id ZqeeijrY91EfhYfu@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to 回复: [External]Re: BUG #18540: Does PG16 standby database support function pg_replication_origin_advance?  ("Jason ChenTJ (CN)" <Jason.ChenTJ@homecredit.cn>)
List pgsql-bugs
Hi,

On Mon, Jul 22, 2024 at 02:51:35AM +0000, Jason ChenTJ (CN) wrote:
> Hi Michael,
> 
> Thanks for your reply!
> 
> I just check the patch:  https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=5aa235042
> 
> The related source code located on src/backend/replication/logical/origin.c and it's marked as new file .
> 
> [cid:9554a9eb-7db8-400f-a815-21f3de8917e7]
> 
> 
> The error is from this function:  replorigin_check_prerequisites
> 
> [cid:57394eb2-b636-4c7f-8c99-c0ecdc3de3a5]
> 
> And you perform the WAL log offset reset function, must do a validation by  replorigin_check_prerequisites.
> 
> [cid:856de95d-cc1d-4f6e-91cc-27575f3fc243]
> 
> So am not sure it's a bug or not on standby database, or some dev can fix it on next version?
> (like add some logicals to identify the database role first...)

As one can not create a subscription on a standby nor execute pg_replication_origin_create()
on a standby then I think that the only way to get a replication origin on a
standby is when it comes from the primary (i.e if a subscription has been created
on the primary or one executed pg_replication_origin_create() on the primary).

Then it seems to me that pg_replication_origin_advance() should be executed on
the primary (if needed).

Could you please describe your use case?

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-bugs by date:

Previous
From: Андрей Рачицкий
Date:
Subject: Re: BUG #18545: \dt breaks transaction, calling error when executed in SET SESSION AUTHORIZATION
Next
From: Tom Lane
Date:
Subject: Re: BUG #18558: ALTER PUBLICATION fails with unhelpful error on attempt to use system column