postgresql/src/include
Amit Kapila f0b3573c3a Introduce "REFRESH SEQUENCES" for subscriptions.
This patch adds support for a new SQL command:
ALTER SUBSCRIPTION ... REFRESH SEQUENCES
This command updates the sequence entries present in the
pg_subscription_rel catalog table with the INIT state to trigger
resynchronization.

In addition to the new command, the following subscription commands have
been enhanced to automatically refresh sequence mappings:
ALTER SUBSCRIPTION ... REFRESH PUBLICATION
ALTER SUBSCRIPTION ... ADD PUBLICATION
ALTER SUBSCRIPTION ... DROP PUBLICATION
ALTER SUBSCRIPTION ... SET PUBLICATION

These commands will perform the following actions:
Add newly published sequences that are not yet part of the subscription.
Remove sequences that are no longer included in the publication.

This ensures that sequence replication remains aligned with the current
state of the publication on the publisher side.

Note that the actual synchronization of sequence data/values will be
handled in a subsequent patch that introduces a dedicated sequence sync
worker.

Author: Vignesh C <vignesh21@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Reviewed-by: shveta malik <shveta.malik@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
Reviewed-by: Peter Smith <smithpb2250@gmail.com>
Reviewed-by: Nisha Moond <nisha.moond412@gmail.com>
Reviewed-by: Shlok Kyal <shlok.kyal.oss@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Hou Zhijie <houzj.fnst@fujitsu.com>
Discussion: https://postgr.es/m/CAA4eK1LC+KJiAkSrpE_NwvNdidw9F2os7GERUeSxSKv71gXysQ@mail.gmail.com
2025-10-23 08:30:27 +00:00
..
access Fix type of infomask parameter in htup_details.h functions. 2025-10-22 16:47:38 -05:00
archive Update copyright for 2025 2025-01-01 11:21:55 -05:00
backup Add backup_type column to pg_stat_progress_basebackup. 2025-08-05 10:50:45 -07:00
bootstrap Allow redeclaration of typedef yyscan_t 2025-09-12 08:16:00 +02:00
catalog Introduce "REFRESH SEQUENCES" for subscriptions. 2025-10-23 08:30:27 +00:00
commands Add log_autoanalyze_min_duration 2025-10-15 14:31:12 +02:00
common Update various forward declarations to use typedef 2025-09-15 11:04:10 +02:00
datatype Avoid using timezone Asia/Manila in regression tests. 2025-01-20 15:47:53 -05:00
executor Introduce "REFRESH SEQUENCES" for subscriptions. 2025-10-23 08:30:27 +00:00
fe_utils Introduce frontend API able to retrieve the contents of PG_VERSION 2025-10-14 16:20:42 +09:00
foreign Improve ExplainState type handling in header files 2025-09-15 11:04:10 +02:00
jit jit: Fix type used for Datum values in LLVM IR. 2025-09-17 13:38:35 +12:00
lib Fix reset of incorrect hash iterator in GROUPING SETS queries 2025-10-18 16:07:04 +13:00
libpq Remove hbaPort type 2025-09-15 11:04:10 +02:00
mb With GB18030, prevent SIGSEGV from reading past end of allocation. 2025-05-05 04:52:04 -07:00
nodes Introduce "REFRESH SEQUENCES" for subscriptions. 2025-10-23 08:30:27 +00:00
optimizer Remove partColsUpdated. 2025-10-16 11:31:38 -05:00
parser Add IGNORE NULLS/RESPECT NULLS option to Window functions. 2025-10-03 09:47:36 +09:00
partitioning Update various forward declarations to use typedef 2025-09-15 11:04:10 +02:00
pch meson: Increase minimum version to 0.57.2 2025-07-02 11:14:53 +02:00
port Optimize hex_encode() and hex_decode() using SIMD. 2025-10-06 12:28:50 -05:00
portability Update copyright for 2025 2025-01-01 11:21:55 -05:00
postmaster Add log_autoanalyze_min_duration 2025-10-15 14:31:12 +02:00
regex pg_regc_locale.c: rename some static functions. 2025-10-14 11:04:04 -07:00
replication Make invalid primary_slot_name follow standard GUC error reporting. 2025-10-22 20:09:43 +09:00
rewrite Update various forward declarations to use typedef 2025-09-15 11:04:10 +02:00
snowball Update to latest Snowball sources. 2025-02-18 21:13:54 -05:00
statistics Fix lookups in pg_{clear,restore}_{attribute,relation}_stats(). 2025-10-15 12:47:33 -05:00
storage Make smgr access for a BufferManagerRelation safer in relcache inval 2025-10-21 10:51:55 +03:00
tcop Add ExplainState argument to pg_plan_query() and planner(). 2025-10-08 08:33:29 -04:00
tsearch Update copyright for 2025 2025-01-01 11:21:55 -05:00
utils Make char2wchar() static. 2025-10-21 09:32:12 -07:00
.gitignore Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
c.h Rename pg_builtin_integer_constant_p to pg_integer_constant_p 2025-09-30 21:15:46 +02:00
fmgr.h Change fmgr.h typedefs to use original names 2025-09-15 11:04:10 +02:00
funcapi.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
getopt_long.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
Makefile Clean up newly added guc_tables.inc.c 2025-09-04 17:25:43 +02:00
meson.build meson: add and use stamp files for generated headers 2025-08-11 15:18:23 -04:00
miscadmin.h Revert function to get memory context stats for processes 2025-05-23 15:44:54 +02:00
pg_config.h.in aio: Combine io_uring memory mappings, if supported 2025-07-07 22:57:07 -04:00
pg_config_manual.h Make type Datum be 8 bytes wide everywhere. 2025-08-13 17:18:22 -04:00
pg_getopt.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pg_trace.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pgstat.h Add mem_exceeded_count column to pg_stat_replication_slots. 2025-10-08 10:05:04 -07:00
pgtar.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgtime.h Seek zone abbreviations in the IANA data before timezone_abbreviations. 2025-01-16 14:11:19 -05:00
port.h Add timingsafe_bcmp(), for constant-time memory comparison 2025-04-02 15:32:40 +03:00
postgres.h Grab the low-hanging fruit from forcing USE_FLOAT8_BYVAL to true. 2025-08-13 17:18:22 -04:00
postgres_ext.h Move pg_int64 back to postgres_ext.h 2025-09-16 10:48:56 +02:00
postgres_fe.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
varatt.h Convert varatt.h access macros to static inline functions. 2025-08-05 17:01:25 +02:00
windowapi.h Add IGNORE NULLS/RESPECT NULLS option to Window functions. 2025-10-03 09:47:36 +09:00