diff --git a/src/interfaces/odbc/info.c b/src/interfaces/odbc/info.c
index 78c3ace7237ca208acc192a9096f8e8e3d35e60a..52b64bef41c1413647d98243f1ddbd5094debe9c 100644
--- a/src/interfaces/odbc/info.c
+++ b/src/interfaces/odbc/info.c
@@ -350,7 +350,7 @@ RETCODE result;
     case SQL_MAX_STATEMENT_LEN: /* ODBC 2.0 */
         /* maybe this should be 0? */
 		len = 4;
-        value = MAX_QUERY_SIZE;
+        value = MAX_STATEMENT_LEN;
         break;
 
     case SQL_MAX_TABLE_NAME_LEN: /* ODBC 1.0 */
@@ -916,7 +916,7 @@ TupleNode *row;
 HSTMT htbl_stmt;
 RETCODE result;
 char *tableType;
-char tables_query[MAX_STATEMENT_LEN];
+char tables_query[STD_STATEMENT_LEN];
 char table_name[MAX_INFO_STRING], table_owner[MAX_INFO_STRING], relhasrules[MAX_INFO_STRING];
 ConnInfo *ci;
 char *prefix[32], prefixes[MEDIUM_REGISTRY_LEN];
@@ -1186,7 +1186,7 @@ StatementClass *stmt = (StatementClass *) hstmt;
 TupleNode *row;
 HSTMT hcol_stmt;
 StatementClass *col_stmt;
-char columns_query[MAX_STATEMENT_LEN];
+char columns_query[STD_STATEMENT_LEN];
 RETCODE result;
 char table_owner[MAX_INFO_STRING], table_name[MAX_INFO_STRING], field_name[MAX_INFO_STRING], field_type_name[MAX_INFO_STRING];
 Int2 field_number, result_cols, scale;
@@ -1583,7 +1583,7 @@ StatementClass *stmt = (StatementClass *) hstmt;
 ConnInfo *ci;
 HSTMT hcol_stmt;
 StatementClass *col_stmt;
-char columns_query[MAX_STATEMENT_LEN];
+char columns_query[STD_STATEMENT_LEN];
 RETCODE result;
 char relhasrules[MAX_INFO_STRING];
 
@@ -1719,7 +1719,7 @@ RETCODE SQL_API SQLStatistics(
 {
 static char *func="SQLStatistics";
 StatementClass *stmt = (StatementClass *) hstmt;
-char index_query[MAX_STATEMENT_LEN];
+char index_query[STD_STATEMENT_LEN];
 HSTMT hindx_stmt;
 RETCODE result;
 char *table_name;
@@ -2095,7 +2095,7 @@ RETCODE result;
 int seq = 0;
 HSTMT htbl_stmt;
 StatementClass *tbl_stmt;
-char tables_query[MAX_STATEMENT_LEN];
+char tables_query[STD_STATEMENT_LEN];
 char attname[MAX_INFO_STRING];
 SDWORD attname_len;
 char pktab[MAX_TABLE_LEN + 1];
@@ -2262,7 +2262,7 @@ TupleNode *row;
 HSTMT htbl_stmt, hpkey_stmt;
 StatementClass *tbl_stmt;
 RETCODE result, keyresult;
-char tables_query[MAX_STATEMENT_LEN];
+char tables_query[STD_STATEMENT_LEN];
 char trig_deferrable[2];
 char trig_initdeferred[2];
 char trig_args[1024];
diff --git a/src/interfaces/odbc/psqlodbc.h b/src/interfaces/odbc/psqlodbc.h
index 056e718d547e3bf4bd66f1cd1f1719ab31756e33..ee109aaf0761a1876c585b7dd4ae6f19b15121bb 100644
--- a/src/interfaces/odbc/psqlodbc.h
+++ b/src/interfaces/odbc/psqlodbc.h
@@ -54,9 +54,8 @@ typedef UInt4 Oid;
 #define BLCKSZ                      4096
 #endif
 
-#define MAX_ROW_SIZE				0 /* Unlimited rowsize with the Tuple Toaster */
-#define MAX_QUERY_SIZE				0 /* Unlimited query length from v7.0(?) */
-#define MAX_MESSAGE_LEN				(2*BLCKSZ)
+#define MAX_MESSAGE_LEN				65536   /* This puts a limit on query size but I don't */
+											/* see an easy way round this - DJP 24-1-2001 */
 #define MAX_CONNECT_STRING			4096
 #define ERROR_MSG_LENGTH			4096
 #define FETCH_MAX					100		/* default number of rows to cache for declare/fetch */
@@ -85,8 +84,12 @@ typedef UInt4 Oid;
 #define MAX_INFO_STRING		128
 #define MAX_KEYPARTS		20
 #define MAX_KEYLEN			512			/*	max key of the form "date+outlet+invoice" */
-#define MAX_STATEMENT_LEN	MAX_MESSAGE_LEN
+#define MAX_ROW_SIZE		0 /* Unlimited rowsize with the Tuple Toaster */
+#define MAX_STATEMENT_LEN	0 /* Unlimited statement size with 7.0
 
+/* Previously, numerous query strings were defined of length MAX_STATEMENT_LEN */
+/* Now that's 0, lets use this instead. DJP 24-1-2001 */
+#define STD_STATEMENT_LEN	MAX_MESSAGE_LEN
 
 #define PG62	"6.2"		/* "Protocol" key setting to force Postgres 6.2 */
 #define PG63	"6.3"		/* "Protocol" key setting to force postgres 6.3 */
diff --git a/src/interfaces/odbc/statement.h b/src/interfaces/odbc/statement.h
index bd551d3ba79fc910df36bd6760c215055007cc53..ae2df856b2572af682062af45efece8d0aa8d600 100644
--- a/src/interfaces/odbc/statement.h
+++ b/src/interfaces/odbc/statement.h
@@ -184,7 +184,7 @@ struct StatementClass_ {
 
 	char cursor_name[MAX_CURSOR_LEN+1];
 
-	char stmt_with_params[65536 /* MAX_STATEMENT_LEN */];		/* statement after parameter substitution */
+	char stmt_with_params[STD_STATEMENT_LEN];		/* statement after parameter substitution */
 
 };