mirror of
https://github.com/zebrajr/postgres.git
synced 2026-01-15 12:15:21 +00:00
Fix CREATE SUBSCRIPTION failure when the publisher runs on pre-PG19.
CREATE SUBSCRIPTION with copy_data=true and origin='none' previously failed when the publisher was running a version earlier than PostgreSQL 19, even though this combination should be supported. The failure occurred because the command issued a query calling pg_get_publication_sequences function on the publisher. That function does not exist before PG19 and the query is only needed for logical replication sequence synchronization, which is supported starting in PG19. This commit fixes this issue by skipping that query when the publisher runs a version earlier than PG19. Author: Fujii Masao <masao.fujii@gmail.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com> Reviewed-by: Shlok Kyal <shlok.kyal.oss@gmail.com> Discussion: https://postgr.es/m/CAHGQGwEx4twHtJdiPWTyAXJhcBPLaH467SH2ajGSe-41m65giA@mail.gmail.com
This commit is contained in:
@@ -2649,9 +2649,11 @@ check_publications_origin_sequences(WalReceiverConn *wrconn, List *publications,
|
||||
/*
|
||||
* Enable sequence synchronization checks only when origin is 'none' , to
|
||||
* ensure that sequence data from other origins is not inadvertently
|
||||
* copied.
|
||||
* copied. This check is necessary if the publisher is running PG19 or
|
||||
* later, where logical replication sequence synchronization is supported.
|
||||
*/
|
||||
if (!copydata || pg_strcasecmp(origin, LOGICALREP_ORIGIN_NONE) != 0)
|
||||
if (!copydata || pg_strcasecmp(origin, LOGICALREP_ORIGIN_NONE) != 0 ||
|
||||
walrcv_server_version(wrconn) < 190000)
|
||||
return;
|
||||
|
||||
initStringInfo(&cmd);
|
||||
|
||||
Reference in New Issue
Block a user