*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.92 2000/03/11 03:08:36 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.93 2000/03/14 23:59:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
if (conn)
{
+ /* copy connection data we might need for operations on PGresult */
result->noticeHook = conn->noticeHook;
result->noticeArg = conn->noticeArg;
+ result->client_encoding = conn->client_encoding;
+
/* consider copying conn's errorMessage */
switch (status)
{
}
else
{
+ /* defaults... */
result->noticeHook = NULL;
result->noticeArg = NULL;
+ result->client_encoding = 0; /* should be SQL_ASCII */
}
return result;
* didn't really belong there.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.35 2000/02/07 23:10:11 petere Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.36 2000/03/14 23:59:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
char ch = '0';
#ifdef MULTIBYTE
- for (p = pval; *p; p += PQmblen(p, PQclientEncoding(res->conn)))
+ for (p = pval; *p; p += PQmblen(p, res->client_encoding))
#else
for (p = pval; *p; p++)
#endif
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: libpq-int.h,v 1.20 2000/03/11 03:08:37 tgl Exp $
+ * $Id: libpq-int.h,v 1.21 2000/03/14 23:59:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*/
PGconn *xconn; /* connection we did the query on, if any */
- /* Callback procedure for notice/error message processing
- * (copied from originating PGconn).
+ /*
+ * These fields are copied from the originating PGconn, so that
+ * operations on the PGresult don't have to reference the PGconn.
*/
- PQnoticeProcessor noticeHook;
+ PQnoticeProcessor noticeHook; /* notice/error message processor */
void *noticeArg;
+ int client_encoding; /* encoding id */
+
char *errMsg; /* error message, or NULL if no error */