]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix CREATE SUBSCRIPTION failure when the publisher runs on pre-PG19.
authorFujii Masao <fujii@postgresql.org>
Wed, 24 Dec 2025 14:43:30 +0000 (23:43 +0900)
committerFujii Masao <fujii@postgresql.org>
Wed, 24 Dec 2025 14:45:19 +0000 (23:45 +0900)
commitd1b35952da0fa94329b66f8a7768c61a416c6271
tree8f6135b5786a17fdd2c370293a7c852cbfa2bb84
parent5e813edb55ed16f3b5540f099319bcca7ca1b816
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
src/backend/commands/subscriptioncmds.c