mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-09 08:10:09 +08:00
Fix performance regression in dblink connection speed.
Previous commit e5de601267
modified dblink
to ensure client encoding matched the server. However the added
PQsetClientEncoding() call added significant overhead. Restore original
performance in the common case where client encoding already matches
server encoding by doing nothing in that case. Applies to all active
branches.
Issue reported and work sponsored by Zonar Systems.
This commit is contained in:
parent
2dcc48c35a
commit
0ec530625f
@ -209,6 +209,7 @@ typedef struct remoteConnHashEnt
|
||||
errdetail_internal("%s", msg))); \
|
||||
} \
|
||||
dblink_security_check(conn, rconn); \
|
||||
if (PQclientEncoding(conn) != GetDatabaseEncoding()) \
|
||||
PQsetClientEncoding(conn, GetDatabaseEncodingName()); \
|
||||
freeconn = true; \
|
||||
} \
|
||||
@ -288,7 +289,8 @@ dblink_connect(PG_FUNCTION_ARGS)
|
||||
/* check password actually used if not superuser */
|
||||
dblink_security_check(conn, rconn);
|
||||
|
||||
/* attempt to set client encoding to match server encoding */
|
||||
/* attempt to set client encoding to match server encoding, if needed */
|
||||
if (PQclientEncoding(conn) != GetDatabaseEncoding())
|
||||
PQsetClientEncoding(conn, GetDatabaseEncodingName());
|
||||
|
||||
if (connname)
|
||||
|
Loading…
Reference in New Issue
Block a user