Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 351372e

Browse files
committed
Department of second thoughts: probably still need an IsTransactionState
test in there...
1 parent 5f15fa8 commit 351372e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/backend/utils/mb/mbutils.c

+12-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* (currently mule internal code (mic) is used)
55
* Tatsuo Ishii
66
*
7-
* $Header: /cvsroot/pgsql/src/backend/utils/mb/mbutils.c,v 1.40 2003/04/27 17:31:25 tgl Exp $
7+
* $Header: /cvsroot/pgsql/src/backend/utils/mb/mbutils.c,v 1.41 2003/04/27 18:01:46 tgl Exp $
88
*/
99
#include "postgres.h"
1010

@@ -106,6 +106,17 @@ SetClientEncoding(int encoding, bool doit)
106106
return 0;
107107
}
108108

109+
/*
110+
* If we're not inside a transaction then we can't do catalog lookups,
111+
* so fail. After backend startup, this could only happen if we
112+
* are re-reading postgresql.conf due to SIGHUP --- so basically this
113+
* just constrains the ability to change client_encoding on the fly
114+
* from postgresql.conf. Which would probably be a stupid thing to do
115+
* anyway.
116+
*/
117+
if (!IsTransactionState())
118+
return -1;
119+
109120
/*
110121
* Look up the conversion functions.
111122
*/

0 commit comments

Comments
 (0)