diff options
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r-- | src/backend/utils/misc/guc.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index ec547a66706..3428d0a172f 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -10,7 +10,7 @@ * Written by Peter Eisentraut <peter_e@gmx.net>. * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.393 2007/06/03 17:07:34 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.394 2007/06/05 20:00:41 wieck Exp $ * *-------------------------------------------------------------------- */ @@ -6270,24 +6270,29 @@ assign_defaultxactisolevel(const char *newval, bool doit, GucSource source) static const char * assign_session_replication_role(const char *newval, bool doit, GucSource source) { - if (HaveCachedPlans()) - elog(ERROR, "session_replication_role cannot be changed " - "after prepared plans have been cached"); - if (pg_strcasecmp(newval, "origin") == 0) { if (doit) + { + ResetPlanCache(); SessionReplicationRole = SESSION_REPLICATION_ROLE_ORIGIN; + } } else if (pg_strcasecmp(newval, "replica") == 0) { if (doit) + { + ResetPlanCache(); SessionReplicationRole = SESSION_REPLICATION_ROLE_REPLICA; + } } else if (pg_strcasecmp(newval, "local") == 0) { if (doit) + { + ResetPlanCache(); SessionReplicationRole = SESSION_REPLICATION_ROLE_LOCAL; + } } else return NULL; |