Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitef32140

Browse files
committed
PBCKP-2705: Adjust signal handling and compatibility for PostgreSQL 18
This patch adds compatibility changes for PostgreSQL 18:- Updated signal handler initialization in pgut.c to use sigaction() instead of pqsignal(), as pqsignal() now returns void.- Updated process_block_change() in backup.c to handle the new RelPathStr structure returned by relpathperm() in v18.- Updated CreateReplicationSlot_compat() in stream.c to support the new CreateReplicationSlot() signature introduced in v18.These changes ensure successful build and runtime behavior withPostgreSQL 18 while preserving backward compatibility with earlierversions.
1 parent721d5d2 commitef32140

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

‎src/backup.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2518,11 +2518,16 @@ process_block_change(ForkNumber forknum, RelFileNode rnode, BlockNumber blkno)
25182518
intsegno;
25192519
pgFile**file_item;
25202520
pgFilef;
2521+
#ifPG_VERSION_NUM >=180000
2522+
RelPathStrrel_path_str=relpathperm(rnode,forknum);
2523+
rel_path=rel_path_str.str;
2524+
#else
2525+
rel_path=relpathperm(rnode,forknum);
2526+
#endif
25212527

25222528
segno=blkno /RELSEG_SIZE;
25232529
blkno_inseg=blkno %RELSEG_SIZE;
25242530

2525-
rel_path=relpathperm(rnode,forknum);
25262531
if (segno>0)
25272532
f.rel_path=psprintf("%s.%u",rel_path,segno);
25282533
else

‎src/stream.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ CreateReplicationSlot_compat(PGconn *conn, const char *slot_name, const char *pl
188188
boolis_temporary,boolis_physical,
189189
boolslot_exists_ok)
190190
{
191-
#ifPG_VERSION_NUM >=150000
191+
#ifPG_VERSION_NUM >=180000
192+
returnCreateReplicationSlot(conn,slot_name,plugin,is_temporary,is_physical,
193+
/* reserve_wal = */ true,slot_exists_ok,/* two_phase = */ false,/* failover = */ false);
194+
#elifPG_VERSION_NUM >=150000
192195
returnCreateReplicationSlot(conn,slot_name,plugin,is_temporary,is_physical,
193196
/* reserve_wal = */ true,slot_exists_ok,/* two_phase = */ false);
194197
#elifPG_VERSION_NUM >=110000

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp