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

Commit0bf6246

Browse files
author
Amit Kapila
committed
Fix issues in binary_upgrade_logical_slot_has_caught_up().
The commit29d0a77 labelled binary_upgrade_logical_slot_has_caught_up()as a non-strict function to allow providing a better error message to callersin case the passed slot_name is NULL. On further discussion, it seems thatit is not helpful to have a different error message for NULL input in thisfunction, so this patch marks the function as strict.This patch also removes the explicit permission check to use replicationslots as this function is invoked only by superusers and instead adds anAssert.Reported-by: Masahiko SawadaAuthor: Hayato KurodaReviewed-by: Vignesh CDiscussion:https://postgr.es/m/CAD21AoDSyiBKkMXBxN_gUayZZUCOgyHnG8Ge8rcPXNP3Tf6B4g@mail.gmail.com
1 parentc426f7c commit0bf6246

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

‎src/backend/utils/adt/pg_upgrade_support.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,11 @@ binary_upgrade_logical_slot_has_caught_up(PG_FUNCTION_ARGS)
281281

282282
CHECK_IS_BINARY_UPGRADE;
283283

284-
/* We must check before dereferencing the argument */
285-
if (PG_ARGISNULL(0))
286-
elog(ERROR,"null argument tobinary_upgrade_validate_wal_records is not allowed");
287-
288-
CheckSlotPermissions();
284+
/*
285+
* Binary upgrades only allowed super-user connections so we must have
286+
* permission touse replication slots.
287+
*/
288+
Assert(has_rolreplication(GetUserId()));
289289

290290
slot_name=PG_GETARG_NAME(0);
291291

‎src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@
5757
*/
5858

5959
/*yyyymmddN */
60-
#defineCATALOG_VERSION_NO202311271
60+
#defineCATALOG_VERSION_NO202312071
6161

6262
#endif

‎src/include/catalog/pg_proc.dat

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11392,9 +11392,8 @@
1139211392
proparallel => 'u', prorettype => 'void', proargtypes => 'oid',
1139311393
prosrc => 'binary_upgrade_set_next_pg_tablespace_oid' },
1139411394
{ oid => '8046', descr => 'for use by pg_upgrade',
11395-
proname => 'binary_upgrade_logical_slot_has_caught_up', proisstrict => 'f',
11396-
provolatile => 'v', proparallel => 'u', prorettype => 'bool',
11397-
proargtypes => 'name',
11395+
proname => 'binary_upgrade_logical_slot_has_caught_up', provolatile => 'v',
11396+
proparallel => 'u', prorettype => 'bool', proargtypes => 'name',
1139811397
prosrc => 'binary_upgrade_logical_slot_has_caught_up' },
1139911398

1140011399
# conversion functions

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp