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

Lines changed: 12 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy