diff options
author | Tom Lane | 2003-04-27 18:01:46 +0000 |
---|---|---|
committer | Tom Lane | 2003-04-27 18:01:46 +0000 |
commit | 351372e585746538ef080bfe1219de3f3074a025 (patch) | |
tree | 822ea0fe9077b59dc46e4328c4d6d10ce48d3d09 | |
parent | 5f15fa8d0693a333f37eb2b44c10d2f784202615 (diff) |
Department of second thoughts: probably still need an IsTransactionState
test in there...
-rw-r--r-- | src/backend/utils/mb/mbutils.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/backend/utils/mb/mbutils.c b/src/backend/utils/mb/mbutils.c index a39dad6c42d..fe9829a8cf2 100644 --- a/src/backend/utils/mb/mbutils.c +++ b/src/backend/utils/mb/mbutils.c @@ -4,7 +4,7 @@ * (currently mule internal code (mic) is used) * Tatsuo Ishii * - * $Header: /cvsroot/pgsql/src/backend/utils/mb/mbutils.c,v 1.40 2003/04/27 17:31:25 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/mbutils.c,v 1.41 2003/04/27 18:01:46 tgl Exp $ */ #include "postgres.h" @@ -107,6 +107,17 @@ SetClientEncoding(int encoding, bool doit) } /* + * If we're not inside a transaction then we can't do catalog lookups, + * so fail. After backend startup, this could only happen if we + * are re-reading postgresql.conf due to SIGHUP --- so basically this + * just constrains the ability to change client_encoding on the fly + * from postgresql.conf. Which would probably be a stupid thing to do + * anyway. + */ + if (!IsTransactionState()) + return -1; + + /* * Look up the conversion functions. */ to_server_proc = FindDefaultConversionProc(encoding, |