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

Commit7dab4f7

Browse files
committed
Minor editorialization: don't flush plan cache without need.
1 parent31edbad commit7dab4f7

File tree

1 file changed

+17
-22
lines changed
  • src/backend/utils/misc

1 file changed

+17
-22
lines changed

‎src/backend/utils/misc/guc.c

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.394 2007/06/0520:00:41 wieck Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.395 2007/06/0521:50:19 tgl Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -6270,32 +6270,27 @@ assign_defaultxactisolevel(const char *newval, bool doit, GucSource source)
62706270
staticconstchar*
62716271
assign_session_replication_role(constchar*newval,booldoit,GucSourcesource)
62726272
{
6273+
intnewrole;
6274+
62736275
if (pg_strcasecmp(newval,"origin")==0)
6274-
{
6275-
if (doit)
6276-
{
6277-
ResetPlanCache();
6278-
SessionReplicationRole=SESSION_REPLICATION_ROLE_ORIGIN;
6279-
}
6280-
}
6276+
newrole=SESSION_REPLICATION_ROLE_ORIGIN;
62816277
elseif (pg_strcasecmp(newval,"replica")==0)
6282-
{
6283-
if (doit)
6284-
{
6285-
ResetPlanCache();
6286-
SessionReplicationRole=SESSION_REPLICATION_ROLE_REPLICA;
6287-
}
6288-
}
6278+
newrole=SESSION_REPLICATION_ROLE_REPLICA;
62896279
elseif (pg_strcasecmp(newval,"local")==0)
6290-
{
6291-
if (doit)
6292-
{
6293-
ResetPlanCache();
6294-
SessionReplicationRole=SESSION_REPLICATION_ROLE_LOCAL;
6295-
}
6296-
}
6280+
newrole=SESSION_REPLICATION_ROLE_LOCAL;
62976281
else
62986282
returnNULL;
6283+
6284+
/*
6285+
* Must flush the plan cache when changing replication role; but don't
6286+
* flush unnecessarily.
6287+
*/
6288+
if (doit&&SessionReplicationRole!=newrole)
6289+
{
6290+
ResetPlanCache();
6291+
SessionReplicationRole=newrole;
6292+
}
6293+
62996294
returnnewval;
63006295
}
63016296

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp