diff -pruN 1.1.12-1/ChangeLog 1.1.13-1/ChangeLog
--- 1.1.12-1/ChangeLog	2025-07-25 19:07:21.000000000 +0000
+++ 1.1.13-1/ChangeLog	2025-11-05 09:35:20.000000000 +0000
@@ -6,7 +6,7 @@
 
 	* configure.in:
 	* README:	Advanced version number to 1.0.2.
-	* configure: 	TEA update; autoconf 2.68
+	* configure: \	TEA update; autoconf 2.68
 
 	* Makefile.in:	At some point docs we're written.  Put them in dist.
 
@@ -16,7 +16,7 @@
 
 	* configure.in:
 	* README:	Advanced version number to 1.0.1.
-	* configure: 	autoconf 2.68
+	* configure: \	autoconf 2.68
 
 2012-11-15  Kevin B. Kenny  <kennykb@acm.org>
 
@@ -30,7 +30,7 @@
 
 	* configure.in:
 	* README:	Advanced version number to 1.0.0.
-	* configure: 	autoconf 2.59
+	* configure: \	autoconf 2.59
 
 2012-07-26  Jan Nijtmans  <jan.nijtmans@gmail.com>
 
@@ -71,7 +71,7 @@
 	* Makefile.in:
 	* README:	Advanced version number to 1.0b17.
 
-	* configure: 	autoconf 2.59
+	* configure:	autoconf 2.59
 
 2011-07-18  Don Porter  <dgp@users.sourceforge.net>
 
@@ -155,7 +155,7 @@
 			at configure time, rather than from the Makefile.)
 			Advanced version number to 1.0b16.
 
-	* configure: 	autoconf 2.59
+	* configure:	autoconf 2.59
 
 2010-06-19  Kevin B. Kenny  <kennykb@acm.org>
 
@@ -230,7 +230,7 @@
 
 	* tests/tdbcpostgres.test: Changed all TEST_* environment variables
 				   to TDBCPOSTGRES_* for easier scripting
-			 	   of combined builds and tests.
+				   of combined builds and tests.
 
 2009-09-23  Kevin B. Kenny  <kennykb@acm.org>
 
diff -pruN 1.1.12-1/Makefile.in 1.1.13-1/Makefile.in
--- 1.1.12-1/Makefile.in	2025-07-25 19:07:21.000000000 +0000
+++ 1.1.13-1/Makefile.in	2025-11-05 09:35:20.000000000 +0000
@@ -306,7 +306,7 @@ $(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS
 # you will have to modify the paths to reflect this:
 #
 # sample.$(OBJEXT): $(srcdir)/generic/sample.c
-# 	$(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@
+#	$(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@
 #
 # Setting the VPATH variable to a list of paths will cause the makefile
 # to look into these paths when resolving .c to .obj dependencies.
diff -pruN 1.1.12-1/README 1.1.13-1/README
--- 1.1.12-1/README	2025-07-25 19:19:17.000000000 +0000
+++ 1.1.13-1/README	2025-11-05 09:35:20.000000000 +0000
@@ -1,6 +1,6 @@
 README: tdbcpostgres
 
-    This is the 1.1.12 source distribution of the driver for Tcl
+    This is the 1.1.13 source distribution of the driver for Tcl
     Database Connectivity (TDBC) to access Postgres databases. TDBC and
     its drivers are available from a Fossil version control repository
     at http://tdbc.tcl.tk/
diff -pruN 1.1.12-1/configure 1.1.13-1/configure
--- 1.1.12-1/configure	2025-07-25 19:19:36.000000000 +0000
+++ 1.1.13-1/configure	2025-11-05 09:35:20.000000000 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.72 for tdbcpostgres 1.1.12.
+# Generated by GNU Autoconf 2.72 for tdbcpostgres 1.1.13.
 #
 #
 # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation,
@@ -601,8 +601,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='tdbcpostgres'
 PACKAGE_TARNAME='tdbcpostgres'
-PACKAGE_VERSION='1.1.12'
-PACKAGE_STRING='tdbcpostgres 1.1.12'
+PACKAGE_VERSION='1.1.13'
+PACKAGE_STRING='tdbcpostgres 1.1.13'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1335,7 +1335,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-'configure' configures tdbcpostgres 1.1.12 to adapt to many kinds of systems.
+'configure' configures tdbcpostgres 1.1.13 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1397,7 +1397,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of tdbcpostgres 1.1.12:";;
+     short | recursive ) echo "Configuration of tdbcpostgres 1.1.13:";;
    esac
   cat <<\_ACEOF
 
@@ -1500,7 +1500,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-tdbcpostgres configure 1.1.12
+tdbcpostgres configure 1.1.13
 generated by GNU Autoconf 2.72
 
 Copyright (C) 2023 Free Software Foundation, Inc.
@@ -2061,7 +2061,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by tdbcpostgres $as_me 1.1.12, which was
+It was created by tdbcpostgres $as_me 1.1.13, which was
 generated by GNU Autoconf 2.72.  Invocation command line was
 
   $ $0$ac_configure_args_raw
@@ -7254,6 +7254,7 @@ fi
 			MACHINE="IA64"
 			;;
 		esac
+		do64bit_ok=yes
 	    fi
 
 	    if test "$GCC" != "yes" ; then
@@ -10643,7 +10644,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by tdbcpostgres $as_me 1.1.12, which was
+This file was extended by tdbcpostgres $as_me 1.1.13, which was
 generated by GNU Autoconf 2.72.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -10698,7 +10699,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config='$ac_cs_config_escaped'
 ac_cs_version="\\
-tdbcpostgres config.status 1.1.12
+tdbcpostgres config.status 1.1.13
 configured by $0, generated by GNU Autoconf 2.72,
   with options \\"\$ac_cs_config\\"
 
diff -pruN 1.1.12-1/configure.ac 1.1.13-1/configure.ac
--- 1.1.12-1/configure.ac	2025-07-25 19:19:27.000000000 +0000
+++ 1.1.13-1/configure.ac	2025-11-05 09:35:20.000000000 +0000
@@ -19,7 +19,7 @@ dnl	to configure the system for the loca
 # so that we create the export library with the dll.
 #-----------------------------------------------------------------------
 
-AC_INIT([tdbcpostgres],[1.1.12])
+AC_INIT([tdbcpostgres],[1.1.13])
 
 #--------------------------------------------------------------------
 # Call TEA_INIT as the first TEA_ macro to set up initial vars.
diff -pruN 1.1.12-1/debian/changelog 1.1.13-1/debian/changelog
--- 1.1.12-1/debian/changelog	2025-08-21 05:24:55.000000000 +0000
+++ 1.1.13-1/debian/changelog	2025-11-16 23:40:07.000000000 +0000
@@ -1,3 +1,9 @@
+tdbcpostgres (1.1.13-1) unstable; urgency=medium
+
+  * New upstream release 
+
+ -- Massimo Manghi <mxmanghi@apache.org>  Mon, 17 Nov 2025 00:40:07 +0100
+
 tdbcpostgres (1.1.12-1) unstable; urgency=medium
 
   * New upstream release
diff -pruN 1.1.12-1/generic/tdbcpostgres.c 1.1.13-1/generic/tdbcpostgres.c
--- 1.1.12-1/generic/tdbcpostgres.c	2025-07-25 19:07:21.000000000 +0000
+++ 1.1.13-1/generic/tdbcpostgres.c	2025-11-05 09:35:20.000000000 +0000
@@ -66,6 +66,16 @@ typedef short int16_t;
 #  define JOIN1(a,b) a##b
 #endif
 
+#if TCL_MAJOR_VERSION < 9
+  typedef Tcl_ObjCmdProc Tcl_ObjCmdProc2;
+  typedef Tcl_MethodType Tcl_MethodType2;
+# define Tcl_NewMethod2 Tcl_NewMethod
+# define Tcl_CreateObjCommand2 Tcl_CreateObjCommand
+# define TCL_OO_METHOD_VERSION_2 TCL_OO_METHOD_VERSION_CURRENT
+# undef Tcl_Size
+  typedef int Tcl_Size;
+#endif
+
 #ifndef TCL_UNUSED
 #   if defined(__cplusplus)
 #	define TCL_UNUSED(T) T
@@ -217,7 +227,7 @@ static char* _PQtty(const PGconn* conn)
 static const struct {
     const char * name;		    /* Option name */
     enum OptType type;		    /* Option data type */
-    int info;		    	    /* Option index or flag value */
+    int info;			    /* Option index or flag value */
     int flags;			    /* Flags - modifiable; SSL related;
 				     * is an alias */
     char *(*queryF)(const PGconn*); /* Function used to determine the
@@ -271,7 +281,7 @@ typedef struct PerInterpData {
 /*
  * Structure that carries the data for a Postgres connection
  *
- * 	This structure is reference counted, to enable deferring its
+ *	This structure is reference counted, to enable deferring its
  *	destruction until the last statement or result set that refers
  *	to it is destroyed.
  */
@@ -291,7 +301,7 @@ typedef struct ConnectionData {
  * Flags for the state of an POSTGRES connection
  */
 
-#define CONN_FLAG_IN_XCN	0x1 	/* Transaction is in progress */
+#define CONN_FLAG_IN_XCN	0x1	/* Transaction is in progress */
 
 #define IncrConnectionRefCount(x) \
     do {			  \
@@ -310,7 +320,7 @@ typedef struct ConnectionData {
  *
  *	Just as with connections, statements need to defer taking down
  *	their client data until other objects (i.e., result sets) that
- * 	refer to them have had a chance to clean up. Hence, this
+ *	refer to them have had a chance to clean up. Hence, this
  *	structure is reference counted as well.
  */
 
@@ -361,8 +371,8 @@ typedef struct ParamData {
 } ParamData;
 
 #define PARAM_KNOWN	1<<0	/* Something is known about the parameter */
-#define PARAM_IN 	1<<1	/* Parameter is an input parameter */
-#define PARAM_OUT 	1<<2	/* Parameter is an output parameter */
+#define PARAM_IN	1<<1	/* Parameter is an input parameter */
+#define PARAM_OUT	1<<2	/* Parameter is an output parameter */
 				/* (Both bits are set if parameter is
 				 * an INOUT parameter) */
 
@@ -432,31 +442,31 @@ static int TransferResultError(Tcl_Inter
 
 static Tcl_Obj* QueryConnectionOption(ConnectionData* cdata,
 				      Tcl_Interp* interp,
-				      int optionNum);
+				      Tcl_Size optionNum);
 static int ConfigureConnection(ConnectionData* cdata, Tcl_Interp* interp,
-			       Tcl_Size objc, Tcl_Obj *const objv[], Tcl_Size skip);
+			       Tcl_Size objc, Tcl_Obj *const *, Tcl_Size skip);
 static int ConnectionConstructor(void *clientData, Tcl_Interp* interp,
 				 Tcl_ObjectContext context,
-				 int objc, Tcl_Obj *const objv[]);
+				 Tcl_Size objc, Tcl_Obj *const *);
 static int ConnectionBegintransactionMethod(void *clientData,
 					    Tcl_Interp* interp,
 					    Tcl_ObjectContext context,
-					    int objc, Tcl_Obj *const objv[]);
+					    Tcl_Size objc, Tcl_Obj *const *);
 static int ConnectionColumnsMethod(void *clientData, Tcl_Interp* interp,
 				  Tcl_ObjectContext context,
-				  int objc, Tcl_Obj *const objv[]);
+				  Tcl_Size objc, Tcl_Obj *const *);
 static int ConnectionCommitMethod(void *clientData, Tcl_Interp* interp,
 				  Tcl_ObjectContext context,
-				  int objc, Tcl_Obj *const objv[]);
+				  Tcl_Size objc, Tcl_Obj *const *);
 static int ConnectionConfigureMethod(void *clientData, Tcl_Interp* interp,
 				     Tcl_ObjectContext context,
-				     int objc, Tcl_Obj *const objv[]);
+				     Tcl_Size objc, Tcl_Obj *const *);
 static int ConnectionRollbackMethod(void *clientData, Tcl_Interp* interp,
 				    Tcl_ObjectContext context,
-				    int objc, Tcl_Obj *const objv[]);
+				    Tcl_Size objc, Tcl_Obj *const *);
 static int ConnectionTablesMethod(void *clientData, Tcl_Interp* interp,
 				  Tcl_ObjectContext context,
-				  int objc, Tcl_Obj *const objv[]);
+				  Tcl_Size objc, Tcl_Obj *const *);
 static void DeleteConnectionMetadata(void *clientData);
 static void DeleteConnection(ConnectionData* cdata);
 static int CloneConnection(Tcl_Interp* interp, void *oldClientData,
@@ -470,13 +480,13 @@ static PGresult* PrepareStatement(Tcl_In
 static Tcl_Obj* ResultDescToTcl(PGresult* resultDesc);
 static int StatementConstructor(void *clientData, Tcl_Interp* interp,
 				Tcl_ObjectContext context,
-				int objc, Tcl_Obj *const objv[]);
+				Tcl_Size objc, Tcl_Obj *const *);
 static int StatementParamtypeMethod(void *clientData, Tcl_Interp* interp,
 				    Tcl_ObjectContext context,
-				    int objc, Tcl_Obj *const objv[]);
+				    Tcl_Size objc, Tcl_Obj *const *);
 static int StatementParamsMethod(void *clientData, Tcl_Interp* interp,
 				 Tcl_ObjectContext context,
-				 int objc, Tcl_Obj *const objv[]);
+				 Tcl_Size objc, Tcl_Obj *const *);
 static void DeleteStatementMetadata(void *clientData);
 static void DeleteStatement(StatementData* sdata);
 static int CloneStatement(Tcl_Interp* interp, void *oldClientData,
@@ -484,16 +494,16 @@ static int CloneStatement(Tcl_Interp* in
 
 static int ResultSetConstructor(void *clientData, Tcl_Interp* interp,
 				Tcl_ObjectContext context,
-				int objc, Tcl_Obj *const objv[]);
+				Tcl_Size objc, Tcl_Obj *const *);
 static int ResultSetColumnsMethod(void *clientData, Tcl_Interp* interp,
 				  Tcl_ObjectContext context,
-				  int objc, Tcl_Obj *const objv[]);
+				  Tcl_Size objc, Tcl_Obj *const *);
 static int ResultSetNextrowMethod(void *clientData, Tcl_Interp* interp,
 				  Tcl_ObjectContext context,
-				  int objc, Tcl_Obj *const objv[]);
+				  Tcl_Size objc, Tcl_Obj *const *);
 static int ResultSetRowcountMethod(void *clientData, Tcl_Interp* interp,
 				   Tcl_ObjectContext context,
-				   int objc, Tcl_Obj *const objv[]);
+				   Tcl_Size objc, Tcl_Obj *const *);
 static void DeleteResultSetMetadata(void *clientData);
 static void DeleteResultSet(ResultSetData* rdata);
 static int CloneResultSet(Tcl_Interp* interp, void *oldClientData,
@@ -540,8 +550,8 @@ const static Tcl_ObjectMetadataType resu
 
 /* Method types of the result set methods that are implemented in C */
 
-const static Tcl_MethodType ResultSetConstructorType = {
-    TCL_OO_METHOD_VERSION_CURRENT,
+const static Tcl_MethodType2 ResultSetConstructorType = {
+    TCL_OO_METHOD_VERSION_2,
 				/* version */
     "CONSTRUCTOR",		/* name */
     ResultSetConstructor,	/* callProc */
@@ -549,16 +559,16 @@ const static Tcl_MethodType ResultSetCon
     NULL			/* cloneProc */
 };
 
-const static Tcl_MethodType ResultSetColumnsMethodType = {
-    TCL_OO_METHOD_VERSION_CURRENT,
+const static Tcl_MethodType2 ResultSetColumnsMethodType = {
+    TCL_OO_METHOD_VERSION_2,
 				/* version */    "columns",			/* name */
     ResultSetColumnsMethod,	/* callProc */
     NULL,			/* deleteProc */
     NULL			/* cloneProc */
 };
 
-const static Tcl_MethodType ResultSetNextrowMethodType = {
-    TCL_OO_METHOD_VERSION_CURRENT,
+const static Tcl_MethodType2 ResultSetNextrowMethodType = {
+    TCL_OO_METHOD_VERSION_2,
 				/* version */
     "nextrow",			/* name */
     ResultSetNextrowMethod,	/* callProc */
@@ -566,8 +576,8 @@ const static Tcl_MethodType ResultSetNex
     NULL			/* cloneProc */
 };
 
-const static Tcl_MethodType ResultSetRowcountMethodType = {
-    TCL_OO_METHOD_VERSION_CURRENT,
+const static Tcl_MethodType2 ResultSetRowcountMethodType = {
+    TCL_OO_METHOD_VERSION_2,
 				/* version */
     "rowcount",			/* name */
     ResultSetRowcountMethod,	/* callProc */
@@ -577,7 +587,7 @@ const static Tcl_MethodType ResultSetRow
 
 /* Methods to create on the result set class */
 
-const static Tcl_MethodType* ResultSetMethods[] = {
+const static Tcl_MethodType2* ResultSetMethods[] = {
     &ResultSetColumnsMethodType,
     &ResultSetRowcountMethodType,
     NULL
@@ -585,8 +595,8 @@ const static Tcl_MethodType* ResultSetMe
 
 /* Method types of the connection methods that are implemented in C */
 
-const static Tcl_MethodType ConnectionConstructorType = {
-    TCL_OO_METHOD_VERSION_CURRENT,
+const static Tcl_MethodType2 ConnectionConstructorType = {
+    TCL_OO_METHOD_VERSION_2,
 				/* version */
     "CONSTRUCTOR",		/* name */
     ConnectionConstructor,	/* callProc */
@@ -594,8 +604,8 @@ const static Tcl_MethodType ConnectionCo
     CloneCmd			/* cloneProc */
 };
 
-const static Tcl_MethodType ConnectionBegintransactionMethodType = {
-    TCL_OO_METHOD_VERSION_CURRENT,
+const static Tcl_MethodType2 ConnectionBegintransactionMethodType = {
+    TCL_OO_METHOD_VERSION_2,
 				/* version */
     "begintransaction",		/* name */
     ConnectionBegintransactionMethod,	/* callProc */
@@ -603,8 +613,8 @@ const static Tcl_MethodType ConnectionBe
     NULL			/* cloneProc */
 };
 
-const static Tcl_MethodType ConnectionColumnsMethodType = {
-    TCL_OO_METHOD_VERSION_CURRENT,
+const static Tcl_MethodType2 ConnectionColumnsMethodType = {
+    TCL_OO_METHOD_VERSION_2,
 				/* version */
     "columns",			/* name */
     ConnectionColumnsMethod,	/* callProc */
@@ -612,8 +622,8 @@ const static Tcl_MethodType ConnectionCo
     NULL			/* cloneProc */
 };
 
-const static Tcl_MethodType ConnectionCommitMethodType = {
-    TCL_OO_METHOD_VERSION_CURRENT,
+const static Tcl_MethodType2 ConnectionCommitMethodType = {
+    TCL_OO_METHOD_VERSION_2,
 				/* version */
     "commit",			/* name */
     ConnectionCommitMethod,	/* callProc */
@@ -621,8 +631,8 @@ const static Tcl_MethodType ConnectionCo
     NULL			/* cloneProc */
 };
 
-const static Tcl_MethodType ConnectionConfigureMethodType = {
-    TCL_OO_METHOD_VERSION_CURRENT,
+const static Tcl_MethodType2 ConnectionConfigureMethodType = {
+    TCL_OO_METHOD_VERSION_2,
 				/* version */
     "configure",		/* name */
     ConnectionConfigureMethod,	/* callProc */
@@ -630,8 +640,8 @@ const static Tcl_MethodType ConnectionCo
     NULL			/* cloneProc */
 };
 
-const static Tcl_MethodType ConnectionRollbackMethodType = {
-    TCL_OO_METHOD_VERSION_CURRENT,
+const static Tcl_MethodType2 ConnectionRollbackMethodType = {
+    TCL_OO_METHOD_VERSION_2,
 				/* version */
     "rollback",			/* name */
     ConnectionRollbackMethod,	/* callProc */
@@ -639,8 +649,8 @@ const static Tcl_MethodType ConnectionRo
     NULL			/* cloneProc */
 };
 
-const static Tcl_MethodType ConnectionTablesMethodType = {
-    TCL_OO_METHOD_VERSION_CURRENT,
+const static Tcl_MethodType2 ConnectionTablesMethodType = {
+    TCL_OO_METHOD_VERSION_2,
 				/* version */
     "tables",			/* name */
     ConnectionTablesMethod,	/* callProc */
@@ -648,7 +658,7 @@ const static Tcl_MethodType ConnectionTa
     NULL			/* cloneProc */
 };
 
-const static Tcl_MethodType* ConnectionMethods[] = {
+const static Tcl_MethodType2* ConnectionMethods[] = {
     &ConnectionBegintransactionMethodType,
     &ConnectionColumnsMethodType,
     &ConnectionCommitMethodType,
@@ -660,8 +670,8 @@ const static Tcl_MethodType* ConnectionM
 
 /* Method types of the statement methods that are implemented in C */
 
-const static Tcl_MethodType StatementConstructorType = {
-    TCL_OO_METHOD_VERSION_CURRENT,
+const static Tcl_MethodType2 StatementConstructorType = {
+    TCL_OO_METHOD_VERSION_2,
 				/* version */
     "CONSTRUCTOR",		/* name */
     StatementConstructor,	/* callProc */
@@ -669,8 +679,8 @@ const static Tcl_MethodType StatementCon
     NULL			/* cloneProc */
 };
 
-const static Tcl_MethodType StatementParamsMethodType = {
-    TCL_OO_METHOD_VERSION_CURRENT,
+const static Tcl_MethodType2 StatementParamsMethodType = {
+    TCL_OO_METHOD_VERSION_2,
 				/* version */
     "params",			/* name */
     StatementParamsMethod,	/* callProc */
@@ -678,8 +688,8 @@ const static Tcl_MethodType StatementPar
     NULL			/* cloneProc */
 };
 
-const static Tcl_MethodType StatementParamtypeMethodType = {
-    TCL_OO_METHOD_VERSION_CURRENT,
+const static Tcl_MethodType2 StatementParamtypeMethodType = {
+    TCL_OO_METHOD_VERSION_2,
 				/* version */
     "paramtype",		/* name */
     StatementParamtypeMethod,	/* callProc */
@@ -691,7 +701,7 @@ const static Tcl_MethodType StatementPar
  * Methods to create on the statement class.
  */
 
-const static Tcl_MethodType* StatementMethods[] = {
+const static Tcl_MethodType2* StatementMethods[] = {
     &StatementParamsMethodType,
     &StatementParamtypeMethodType,
     NULL
@@ -748,7 +758,7 @@ static int ExecSimpleQuery(
     const char * query,		/* Query to execute */
     PGresult** resOut		/* Optional handle to result struct */
 ) {
-    PGresult * res; 		/* Query result */
+    PGresult * res;		/* Query result */
 
     /* Execute the query */
 
@@ -944,7 +954,7 @@ static Tcl_Obj*
 QueryConnectionOption (
     ConnectionData* cdata,	/* Connection data */
     Tcl_Interp* interp,		/* Tcl interpreter */
-    int optionNum		/* Position of the option in the table */
+    Tcl_Size optionNum		/* Position of the option in the table */
 ) {
     PerInterpData* pidata = cdata->pidata; /* Per-interpreter data */
     Tcl_Obj** literals = pidata->literals;
@@ -1054,13 +1064,13 @@ ConfigureConnection(
     ConnectionData* cdata,	/* Connection data */
     Tcl_Interp* interp,		/* Tcl interpreter */
     Tcl_Size objc,			/* Parameter count */
-    Tcl_Obj* const objv[],	/* Parameter data */
+    Tcl_Obj* const *objv,	/* Parameter data */
     Tcl_Size skip			/* Number of parameters to skip */
 ) {
     int optionIndex;		/* Index of the current option in
 				 * ConnOptions */
     int optionValue;		/* Integer value of the current option */
-    int i;
+    Tcl_Size i;
     size_t j;
     char portval[10];		/* String representation of port number */
     char * encoding = NULL;	/* Selected encoding name */
@@ -1302,8 +1312,8 @@ ConnectionConstructor(
     void *clientData,	/* Environment handle */
     Tcl_Interp* interp,		/* Tcl interpreter */
     Tcl_ObjectContext context, /* Object context */
-    int objc,			/* Parameter count */
-    Tcl_Obj *const objv[]	/* Parameter vector */
+    Tcl_Size objc,			/* Parameter count */
+    Tcl_Obj *const *objv	/* Parameter vector */
 ) {
     PerInterpData* pidata = (PerInterpData*) clientData;
 				/* Per-interp data for the POSTGRES package */
@@ -1362,8 +1372,8 @@ ConnectionBegintransactionMethod(
     TCL_UNUSED(void *),
     Tcl_Interp* interp,		/* Tcl interpreter */
     Tcl_ObjectContext objectContext, /* Object context */
-    int objc,			/* Parameter count */
-    Tcl_Obj *const objv[]	/* Parameter vector */
+    Tcl_Size objc,			/* Parameter count */
+    Tcl_Obj *const *objv	/* Parameter vector */
 ) {
     Tcl_Object thisObject = Tcl_ObjectContextObject(objectContext);
 				/* The current connection object */
@@ -1399,7 +1409,7 @@ ConnectionBegintransactionMethod(
  * ConnectionCommitMethod --
  *
  *	Method that requests that a pending transaction against a database
- * 	be committed.
+ *	be committed.
  *
  * Usage:
  *	$connection commit
@@ -1419,8 +1429,8 @@ ConnectionCommitMethod(
     TCL_UNUSED(void *),
     Tcl_Interp* interp,		/* Tcl interpreter */
     Tcl_ObjectContext objectContext, /* Object context */
-    int objc,			/* Parameter count */
-    Tcl_Obj *const objv[]	/* Parameter vector */
+    Tcl_Size objc,			/* Parameter count */
+    Tcl_Obj *const *objv	/* Parameter vector */
 ) {
     Tcl_Object thisObject = Tcl_ObjectContextObject(objectContext);
 				/* The current connection object */
@@ -1460,7 +1470,7 @@ ConnectionCommitMethod(
  *	in the database (optionally matching a given pattern)
  *
  * Usage:
- * 	$connection columns table ?pattern?
+ *	$connection columns table ?pattern?
  *
  * Parameters:
  *	None.
@@ -1476,8 +1486,8 @@ ConnectionColumnsMethod(
     TCL_UNUSED(void *),
     Tcl_Interp* interp,		/* Tcl interpreter */
     Tcl_ObjectContext objectContext, /* Object context */
-    int objc,			/* Parameter count */
-    Tcl_Obj *const objv[]	/* Parameter vector */
+    Tcl_Size objc,			/* Parameter count */
+    Tcl_Obj *const *objv	/* Parameter vector */
 ) {
     Tcl_Object thisObject = Tcl_ObjectContextObject(objectContext);
 				/* The current connection object */
@@ -1653,8 +1663,8 @@ static int ConnectionConfigureMethod(
      TCL_UNUSED(void *),
      Tcl_Interp* interp,
      Tcl_ObjectContext objectContext,
-     int objc,
-     Tcl_Obj *const objv[]
+     Tcl_Size objc,
+     Tcl_Obj *const *objv
 ) {
     Tcl_Object thisObject = Tcl_ObjectContextObject(objectContext);
 				/* The current connection object */
@@ -1673,10 +1683,10 @@ static int ConnectionConfigureMethod(
  * ConnectionRollbackMethod --
  *
  *	Method that requests that a pending transaction against a database
- * 	be rolled back.
+ *	be rolled back.
  *
  * Usage:
- * 	$connection rollback
+ *	$connection rollback
  *
  * Parameters:
  *	None.
@@ -1693,8 +1703,8 @@ ConnectionRollbackMethod(
     TCL_UNUSED(void *),
     Tcl_Interp* interp,		/* Tcl interpreter */
     Tcl_ObjectContext objectContext, /* Object context */
-    int objc,			/* Parameter count */
-    Tcl_Obj *const objv[]	/* Parameter vector */
+    Tcl_Size objc,			/* Parameter count */
+    Tcl_Obj *const *objv	/* Parameter vector */
 ) {
    Tcl_Object thisObject = Tcl_ObjectContextObject(objectContext);
 				/* The current connection object */
@@ -1734,7 +1744,7 @@ ConnectionRollbackMethod(
  *	matching a given pattern
  *
  * Usage:
- * 	$connection tables ?pattern?
+ *	$connection tables ?pattern?
  *
  * Parameters:
  *	None.
@@ -1750,8 +1760,8 @@ ConnectionTablesMethod(
     TCL_UNUSED(void *),
     Tcl_Interp* interp,		/* Tcl interpreter */
     Tcl_ObjectContext objectContext, /* Object context */
-    int objc,			/* Parameter count */
-    Tcl_Obj *const objv[]	/* Parameter vector */
+    Tcl_Size objc,			/* Parameter count */
+    Tcl_Obj *const *objv	/* Parameter vector */
 ) {
     Tcl_Object thisObject = Tcl_ObjectContextObject(objectContext);
 				/* The current connection object */
@@ -2112,13 +2122,13 @@ ResultDescToTcl(
     char * fieldName;
     Tcl_InitHashTable(&names, TCL_STRING_KEYS);
     if (result != NULL) {
-	unsigned int fieldCount = PQnfields(result);
-	unsigned int i;
+	int fieldCount = PQnfields(result);
+	int i;
 	char numbuf[16];
 
 	for (i = 0; i < fieldCount; ++i) {
 	    int isNew;
-	    int count = 1;
+	    Tcl_Size count = 1;
 	    Tcl_Obj* nameObj;
 	    Tcl_HashEntry* entry;
 	    fieldName = PQfname(result, i);
@@ -2130,7 +2140,7 @@ ResultDescToTcl(
 		count = PTR2INT(Tcl_GetHashValue(entry));
 		++count;
 		Tcl_SetHashValue(entry, INT2PTR(count));
-		snprintf(numbuf, sizeof(numbuf), "#%d", count);
+		snprintf(numbuf, sizeof(numbuf), "#%" TCL_SIZE_MODIFIER "d", count);
 		Tcl_AppendToObj(nameObj, numbuf, -1);
 		entry = Tcl_CreateHashEntry(&names, Tcl_GetString(nameObj),
 					    &isNew);
@@ -2175,8 +2185,8 @@ StatementConstructor(
     TCL_UNUSED(void *),
     Tcl_Interp* interp,		/* Tcl interpreter */
     Tcl_ObjectContext context,	/* Object context  */
-    int objc, 			/* Parameter count */
-    Tcl_Obj *const objv[]	/* Parameter vector */
+    Tcl_Size objc,			/* Parameter count */
+    Tcl_Obj *const *objv	/* Parameter vector */
 ) {
     Tcl_Object thisObject = Tcl_ObjectContextObject(context);
 				/* The current statement object */
@@ -2283,10 +2293,10 @@ StatementConstructor(
     Tcl_DecrRefCount(tokens);
 
     Tcl_ListObjLength(NULL, sdata->subVars, &sdata->nParams);
-    sdata->params = (ParamData*) ckalloc(sdata->nParams * sizeof(ParamData));
-    memset(sdata->params, 0, sdata->nParams * sizeof(ParamData));
-    sdata->paramDataTypes = (Oid*) ckalloc(sdata->nParams * sizeof(Oid));
-    memset(sdata->paramDataTypes, 0, sdata->nParams * sizeof(Oid));
+    sdata->params = (ParamData*) ckalloc((size_t)sdata->nParams * sizeof(ParamData));
+    memset(sdata->params, 0, (size_t)sdata->nParams * sizeof(ParamData));
+    sdata->paramDataTypes = (Oid*) ckalloc((size_t)sdata->nParams * sizeof(Oid));
+    memset(sdata->paramDataTypes, 0, (size_t)sdata->nParams * sizeof(Oid));
     for (i = 0; i < sdata->nParams; ++i) {
 	sdata->params[i].flags = PARAM_IN;
 	sdata->paramDataTypes[i] = UNTYPEDOID ;
@@ -2349,8 +2359,8 @@ StatementParamsMethod(
     TCL_UNUSED(void *),
     Tcl_Interp* interp,		/* Tcl interpreter */
     Tcl_ObjectContext context,	/* Object context  */
-    int objc, 			/* Parameter count */
-    Tcl_Obj *const objv[]	/* Parameter vector */
+    Tcl_Size objc,			/* Parameter count */
+    Tcl_Obj *const *objv	/* Parameter vector */
 ) {
     Tcl_Object thisObject = Tcl_ObjectContextObject(context);
 				/* The current statement object */
@@ -2435,8 +2445,8 @@ StatementParamtypeMethod(
     TCL_UNUSED(void *),
     Tcl_Interp* interp,		/* Tcl interpreter */
     Tcl_ObjectContext context,	/* Object context  */
-    int objc, 			/* Parameter count */
-    Tcl_Obj *const objv[]	/* Parameter vector */
+    Tcl_Size objc,			/* Parameter count */
+    Tcl_Obj *const *objv	/* Parameter vector */
 ) {
     Tcl_Object thisObject = Tcl_ObjectContextObject(context);
 				/* The current statement object */
@@ -2447,7 +2457,7 @@ StatementParamtypeMethod(
 	const char* name;
 	int flags;
     } directions[] = {
-	{ "in", 	PARAM_IN },
+	{ "in",	PARAM_IN },
 	{ "out",	PARAM_OUT },
 	{ "inout",	PARAM_IN | PARAM_OUT },
 	{ NULL,		0 }
@@ -2652,9 +2662,9 @@ ResultSetConstructor(
     TCL_UNUSED(void *),
     Tcl_Interp* interp,		/* Tcl interpreter */
     Tcl_ObjectContext context,	/* Object context  */
-    int objc, 			/* Parameter count */
-    Tcl_Obj *const objv[]	/* Parameter vector */
-) {
+    Tcl_Size objc,			/* Parameter count */
+    Tcl_Obj *const *objv)	/* Parameter vector */
+{
     Tcl_Object thisObject = Tcl_ObjectContextObject(context);
 				/* The current result set object */
     Tcl_Size skip = Tcl_ObjectContextSkippedArgs(context);
@@ -2762,13 +2772,13 @@ ResultSetConstructor(
 	}
     }
 
-    paramValues = (const char**) ckalloc(sdata->nParams * sizeof(char* ));
-    paramLengths = (int *) ckalloc(sdata->nParams * sizeof(int *));
-    paramFormats = (int*) ckalloc(sdata->nParams * sizeof(int*));
-    paramNeedsFreeing = (char *)ckalloc(sdata->nParams);
-    paramTempObjs = (Tcl_Obj**) ckalloc(sdata->nParams * sizeof(Tcl_Obj*));
+    paramValues = (const char**) ckalloc((size_t)sdata->nParams * sizeof(char* ));
+    paramLengths = (int *) ckalloc((size_t)sdata->nParams * sizeof(int *));
+    paramFormats = (int*) ckalloc((size_t)sdata->nParams * sizeof(int*));
+    paramNeedsFreeing = (char *)ckalloc((size_t)sdata->nParams);
+    paramTempObjs = (Tcl_Obj**) ckalloc((size_t)sdata->nParams * sizeof(Tcl_Obj*));
 
-    memset(paramNeedsFreeing, 0, sdata->nParams);
+    memset(paramNeedsFreeing, 0, (size_t)sdata->nParams);
     for (i = 0; i < sdata->nParams; i++) {
 	paramTempObjs[i] = NULL;
     }
@@ -2805,9 +2815,9 @@ ResultSetConstructor(
 		}
 		paramValues[i] = (char *)ckalloc(sizeof(int16_t));
 		paramNeedsFreeing[i] = 1;
-		tmp16 = *(int*) bufPtr;
+		tmp16 = (int16_t)*(int*) bufPtr;
 		ckfree(bufPtr);
-		*(int16_t*)(paramValues[i])=htons(tmp16);
+		*(int16_t*)(paramValues[i])=(int16_t)htons(tmp16);
 		paramFormats[i] = 1;
 		paramLengths[i] = sizeof(int16_t);
 		break;
@@ -2820,9 +2830,9 @@ ResultSetConstructor(
 		}
 		paramValues[i] = (char *)ckalloc(sizeof(int32_t));
 		paramNeedsFreeing[i] = 1;
-		tmp32 = *(long*) bufPtr;
+		tmp32 = (int32_t)*(long*) bufPtr;
 		ckfree(bufPtr);
-		*((int32_t*)(paramValues[i]))=htonl(tmp32);
+		*((int32_t*)(paramValues[i]))=(int32_t)htonl(tmp32);
 		paramFormats[i] = 1;
 		paramLengths[i] = sizeof(int32_t);
 		break;
@@ -2849,7 +2859,7 @@ ResultSetConstructor(
 			paramValues[i] =
 			    Tcl_GetStringFromObj(paramTempObjs[i],
 						 &len);
-			paramLengths[i] = len;
+			paramLengths[i] = (int)len;
 		    } else {
 			goto convertString;
 				/* If Tcl can't parse it, let SQL try */
@@ -2869,7 +2879,7 @@ ResultSetConstructor(
 			paramValues[i] =
 			    Tcl_GetStringFromObj(paramTempObjs[i],
 						 &len);
-			paramLengths[i] = len;
+			paramLengths[i] = (int)len;
 		    } else {
 			goto convertString;
 				/* If Tcl can't parse it, let SQL try */
@@ -2882,7 +2892,7 @@ ResultSetConstructor(
 		paramValues[i] =
 		    (char*)Tcl_GetByteArrayFromObj(paramValObj,
 						   &len);
-		paramLengths[i] = len;
+		paramLengths[i] = (int)len;
 		break;
 
 	    default:
@@ -2890,7 +2900,7 @@ ResultSetConstructor(
 		paramFormats[i] = 0;
 		paramValues[i] = Tcl_GetStringFromObj(paramValObj,
 						      &len);
-		paramLengths[i] = len;
+		paramLengths[i] = (int)len;
 		break;
 	    }
 	} else {
@@ -2901,7 +2911,7 @@ ResultSetConstructor(
 
     /* Execute the statement */
     rdata->execResult = PQexecPrepared(cdata->pgPtr, rdata->stmtName,
-				       sdata->nParams, paramValues,
+				       (int)sdata->nParams, paramValues,
 				       paramLengths, paramFormats, 0);
     if (TransferResultError(interp, rdata->execResult) != TCL_OK) {
 	goto freeParamTables;
@@ -2954,8 +2964,8 @@ ResultSetColumnsMethod(
     TCL_UNUSED(void *),
     Tcl_Interp* interp,		/* Tcl interpreter */
     Tcl_ObjectContext context,	/* Object context  */
-    int objc, 			/* Parameter count */
-    Tcl_Obj *const objv[]	/* Parameter vector */
+    Tcl_Size objc,			/* Parameter count */
+    Tcl_Obj *const *objv	/* Parameter vector */
 ) {
     Tcl_Object thisObject = Tcl_ObjectContextObject(context);
 				/* The current result set object */
@@ -3005,8 +3015,8 @@ ResultSetNextrowMethod(
     void *clientData,	/* Not used */
     Tcl_Interp* interp,		/* Tcl interpreter */
     Tcl_ObjectContext context,	/* Object context  */
-    int objc, 			/* Parameter count */
-    Tcl_Obj *const objv[]	/* Parameter vector */
+    Tcl_Size objc,			/* Parameter count */
+    Tcl_Obj *const *objv	/* Parameter vector */
 ) {
     int lists = PTR2INT(clientData);
 
@@ -3059,10 +3069,10 @@ ResultSetNextrowMethod(
     /* Retrieve one column at a time. */
     for (i = 0; i < nColumns; ++i) {
 	colObj = NULL;
-	if (PQgetisnull(rdata->execResult, rdata->rowCount, i) == 0) {
-	    buffSize = PQgetlength(rdata->execResult, rdata->rowCount, i);
-	    buffer = PQgetvalue(rdata->execResult, rdata->rowCount, i);
-	    if (PQftype(rdata->execResult, i) == BYTEAOID) {
+	if (PQgetisnull(rdata->execResult, rdata->rowCount, (int)i) == 0) {
+	    buffSize = PQgetlength(rdata->execResult, rdata->rowCount, (int)i);
+	    buffer = PQgetvalue(rdata->execResult, rdata->rowCount, (int)i);
+	    if (PQftype(rdata->execResult, (int)i) == BYTEAOID) {
 		/*
 		 * Postgres returns backslash-escape sequences for
 		 * binary data. Substitute them away.
@@ -3198,8 +3208,8 @@ ResultSetRowcountMethod(
     TCL_UNUSED(void *),
     Tcl_Interp* interp,		/* Tcl interpreter */
     Tcl_ObjectContext context,	/* Object context  */
-    int objc, 			/* Parameter count */
-    Tcl_Obj *const objv[]	/* Parameter vector */
+    Tcl_Size objc,			/* Parameter count */
+    Tcl_Obj *const *objv	/* Parameter vector */
 ) {
     char * nTuples;
     Tcl_Object thisObject = Tcl_ObjectContextObject(context);
@@ -3247,86 +3257,93 @@ ResultSetRowcountMethod(
 #  define STRINGIFY1(x) #x
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif  /* __cplusplus */
-DLLEXPORT int
-Tdbcpostgres_Init(
-    Tcl_Interp* interp		/* Tcl interpreter */
-) {
-
-    PerInterpData* pidata;	/* Per-interpreter data for this package */
-    Tcl_Obj* nameObj;		/* Name of a class or method being looked up */
-    Tcl_Object curClassObject;  /* Tcl_Object representing the current class */
-    Tcl_Class curClass;		/* Tcl_Class representing the current class */
-    int i;
-    Tcl_CmdInfo info;
-
-    if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
-	return TCL_ERROR;
-    }
-    if (TclOOInitializeStubs(interp, "1.0") == NULL) {
-	return TCL_ERROR;
-    }
-    if (Tdbc_InitStubs(interp) == NULL) {
-	return TCL_ERROR;
-    }
-
-    if (Tcl_GetCommandInfo(interp, "::tcl::build-info", &info)) {
-	Tcl_CreateObjCommand(interp, "::tdbc::postgres::build-info",
-		info.objProc, (void *)(
-		    PACKAGE_VERSION "+" STRINGIFY(TDBC_POSTGRES_VERSION_UUID)
+static const char version[] = PACKAGE_VERSION "+" STRINGIFY(TDBC_POSTGRES_VERSION_UUID)
 #if defined(__clang__) && defined(__clang_major__)
-			    ".clang-" STRINGIFY(__clang_major__)
+    ".clang-" STRINGIFY(__clang_major__)
 #if __clang_minor__ < 10
-			    "0"
+    "0"
 #endif
-			    STRINGIFY(__clang_minor__)
+    STRINGIFY(__clang_minor__)
 #endif
 #if defined(__cplusplus) && !defined(__OBJC__)
-			    ".cplusplus"
+    ".cplusplus"
 #endif
 #ifndef NDEBUG
-			    ".debug"
+    ".debug"
 #endif
 #if !defined(__clang__) && !defined(__INTEL_COMPILER) && defined(__GNUC__)
-			    ".gcc-" STRINGIFY(__GNUC__)
+    ".gcc-" STRINGIFY(__GNUC__)
 #if __GNUC_MINOR__ < 10
-			    "0"
+    "0"
 #endif
-			    STRINGIFY(__GNUC_MINOR__)
+    STRINGIFY(__GNUC_MINOR__)
 #endif
 #ifdef __INTEL_COMPILER
-			    ".icc-" STRINGIFY(__INTEL_COMPILER)
+    ".icc-" STRINGIFY(__INTEL_COMPILER)
 #endif
 #ifdef TCL_MEM_DEBUG
-			    ".memdebug"
+    ".memdebug"
 #endif
 #if defined(_MSC_VER)
-			    ".msvc-" STRINGIFY(_MSC_VER)
+    ".msvc-" STRINGIFY(_MSC_VER)
 #endif
 #ifdef USE_NMAKE
-			    ".nmake"
+    ".nmake"
 #endif
 #ifndef TCL_CFG_OPTIMIZED
-			    ".no-optimize"
+    ".no-optimize"
 #endif
 #ifdef __OBJC__
-			    ".objective-c"
+    ".objective-c"
 #if defined(__cplusplus)
-			    "plusplus"
+    "plusplus"
 #endif
 #endif
 #ifdef TCL_CFG_PROFILED
-			    ".profile"
+    ".profile"
 #endif
 #ifdef PURIFY
-			    ".purify"
+    ".purify"
 #endif
 #ifdef STATIC_BUILD
-			    ".static"
+    ".static"
 #endif
-		), NULL);
+;
+
+#ifdef __cplusplus
+extern "C" {
+#endif  /* __cplusplus */
+DLLEXPORT int
+Tdbcpostgres_Init(
+    Tcl_Interp* interp		/* Tcl interpreter */
+) {
+
+    PerInterpData* pidata;	/* Per-interpreter data for this package */
+    Tcl_Obj* nameObj;		/* Name of a class or method being looked up */
+    Tcl_Object curClassObject;  /* Tcl_Object representing the current class */
+    Tcl_Class curClass;		/* Tcl_Class representing the current class */
+    int i;
+    Tcl_CmdInfo info;
+
+    if (Tcl_InitStubs(interp, "8.5-", 0) == NULL) {
+	return TCL_ERROR;
+    }
+    if (TclOOInitializeStubs(interp, "1.0") == NULL) {
+	return TCL_ERROR;
+    }
+    if (Tdbc_InitStubs(interp) == NULL) {
+	return TCL_ERROR;
+    }
+
+    if (Tcl_GetCommandInfo(interp, "::tcl::build-info", &info)) {
+#if TCL_MAJOR_VERSION > 8
+	if (info.isNativeObjectProc == 2) {
+	    Tcl_CreateObjCommand2(interp, "::tdbc::postgres::build-info",
+		    info.objProc2, (void *)version, NULL);
+	} else
+#endif
+	Tcl_CreateObjCommand(interp, "::tdbc::postgres::build-info",
+		info.objProc, (void *)version, NULL);
     }
 
     /* Provide the current package */
@@ -3352,7 +3369,7 @@ Tdbcpostgres_Init(
 	    Tcl_CreateHashEntry(&(pidata->typeNumHash),
 				INT2PTR(dataTypes[i].oid),
 				&isNew);
-	Tcl_Obj* nameObj = Tcl_NewStringObj(dataTypes[i].name, -1);
+	nameObj = Tcl_NewStringObj(dataTypes[i].name, -1);
 	Tcl_IncrRefCount(nameObj);
 	Tcl_SetHashValue(entry, (void *) nameObj);
     }
@@ -3371,7 +3388,7 @@ Tdbcpostgres_Init(
     Tcl_DecrRefCount(nameObj);
     curClass = Tcl_GetObjectAsClass(curClassObject);
     Tcl_ClassSetConstructor(interp, curClass,
-	    Tcl_NewMethod(interp, curClass, NULL, 1,
+	    Tcl_NewMethod2(interp, curClass, NULL, 1,
 		&ConnectionConstructorType,
 		(void *) pidata));
 
@@ -3380,7 +3397,7 @@ Tdbcpostgres_Init(
     for (i = 0; ConnectionMethods[i] != NULL; ++i) {
 	nameObj = Tcl_NewStringObj(ConnectionMethods[i]->name, -1);
 	Tcl_IncrRefCount(nameObj);
-	Tcl_NewMethod(interp, curClass, nameObj, 1, ConnectionMethods[i],
+	Tcl_NewMethod2(interp, curClass, nameObj, 1, ConnectionMethods[i],
 			   NULL);
 	Tcl_DecrRefCount(nameObj);
     }
@@ -3399,7 +3416,7 @@ Tdbcpostgres_Init(
     /* Attach the constructor to the 'statement' class */
 
     Tcl_ClassSetConstructor(interp, curClass,
-			    Tcl_NewMethod(interp, curClass, NULL, 1,
+			    Tcl_NewMethod2(interp, curClass, NULL, 1,
 					  &StatementConstructorType,
 					  NULL));
 
@@ -3408,7 +3425,7 @@ Tdbcpostgres_Init(
     for (i = 0; StatementMethods[i] != NULL; ++i) {
 	nameObj = Tcl_NewStringObj(StatementMethods[i]->name, -1);
 	Tcl_IncrRefCount(nameObj);
-	Tcl_NewMethod(interp, curClass, nameObj, 1, StatementMethods[i],
+	Tcl_NewMethod2(interp, curClass, nameObj, 1, StatementMethods[i],
 			   NULL);
 	Tcl_DecrRefCount(nameObj);
     }
@@ -3427,7 +3444,7 @@ Tdbcpostgres_Init(
     /* Attach the constructor to the 'resultSet' class */
 
     Tcl_ClassSetConstructor(interp, curClass,
-			    Tcl_NewMethod(interp, curClass, NULL, 1,
+			    Tcl_NewMethod2(interp, curClass, NULL, 1,
 					  &ResultSetConstructorType,
 					  NULL));
 
@@ -3436,18 +3453,18 @@ Tdbcpostgres_Init(
     for (i = 0; ResultSetMethods[i] != NULL; ++i) {
 	nameObj = Tcl_NewStringObj(ResultSetMethods[i]->name, -1);
 	Tcl_IncrRefCount(nameObj);
-	Tcl_NewMethod(interp, curClass, nameObj, 1, ResultSetMethods[i],
+	Tcl_NewMethod2(interp, curClass, nameObj, 1, ResultSetMethods[i],
 			   NULL);
 	Tcl_DecrRefCount(nameObj);
     }
     nameObj = Tcl_NewStringObj("nextlist", -1);
     Tcl_IncrRefCount(nameObj);
-    Tcl_NewMethod(interp, curClass, nameObj, 1, &ResultSetNextrowMethodType,
+    Tcl_NewMethod2(interp, curClass, nameObj, 1, &ResultSetNextrowMethodType,
 		  INT2PTR(1));
     Tcl_DecrRefCount(nameObj);
     nameObj = Tcl_NewStringObj("nextdict", -1);
     Tcl_IncrRefCount(nameObj);
-    Tcl_NewMethod(interp, curClass, nameObj, 1, &ResultSetNextrowMethodType,
+    Tcl_NewMethod2(interp, curClass, nameObj, 1, &ResultSetNextrowMethodType,
 		  INT2PTR(0));
     Tcl_DecrRefCount(nameObj);
 
diff -pruN 1.1.12-1/manifest.uuid 1.1.13-1/manifest.uuid
--- 1.1.12-1/manifest.uuid	2025-07-25 19:19:59.000000000 +0000
+++ 1.1.13-1/manifest.uuid	2025-11-05 09:35:20.000000000 +0000
@@ -1 +1 @@
-9553928a28534e87369e0637c2ad17c9a58b57548a0766f8b704820f6d84d44a
+48bec53fd05b53fe70f98f5c972a088d5adf868b73a4654de400c0e400633e6b
diff -pruN 1.1.12-1/tclconfig/tcl.m4 1.1.13-1/tclconfig/tcl.m4
--- 1.1.12-1/tclconfig/tcl.m4	2025-07-25 19:08:51.000000000 +0000
+++ 1.1.13-1/tclconfig/tcl.m4	2025-11-05 09:35:32.000000000 +0000
@@ -1193,6 +1193,7 @@ AC_DEFUN([TEA_CONFIG_CFLAGS], [
 			MACHINE="IA64"
 			;;
 		esac
+		do64bit_ok=yes
 	    fi
 
 	    if test "$GCC" != "yes" ; then
diff -pruN 1.1.12-1/win/makefile.vc 1.1.13-1/win/makefile.vc
--- 1.1.12-1/win/makefile.vc	2025-07-25 19:07:21.000000000 +0000
+++ 1.1.13-1/win/makefile.vc	2025-11-05 09:35:20.000000000 +0000
@@ -73,7 +73,7 @@ TDBC_LIB_FILE	 = tdbc$(TDBC_VERSION)$(SU
 TDBCSTUBLIBNAME	 = tdbcstub.lib
 TDBC_LIB_FILE	 = tcl9tdbc$(TDBC_VERSION).dll
 !endif
-TDBCSTUBLIB 	 = $(TDBC_DIR)\win\$(BUILDDIRTOP)\$(TDBCSTUBLIBNAME)
+TDBCSTUBLIB	 = $(TDBC_DIR)\win\$(BUILDDIRTOP)\$(TDBCSTUBLIBNAME)
 TDBC_BIN_DIR     = $(TDBC_DIR)/win/$(BUILDDIRTOP)
 
 PRJ_INCLUDES	= -I"$(TDBC_GENERIC_DIR)"
@@ -110,15 +110,15 @@ $(TMP_DIR)\tdbcPostgresUuid.h:	$(ROOT)\m
 	copy $(WIN_DIR)\tdbcPostgresUuid.h.in+$(ROOT)\manifest.uuid $(TMP_DIR)\tdbcPostgresUuid.h
 
 test: setup $(PROJECT)
-        @set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
-        @set TCLLIBPATH=$(OUT_DIR:\=/)
+	@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
+	@set TCLLIBPATH=$(OUT_DIR:\=/)
 	@set TDBC_LIBRARY=$(LIBDIR:\=/)
 	@$(CPY) $(LIBDIR)\*.tcl $(OUT_DIR)
 !if $(TCLINSTALL)
-        @set PATH=$(_TCLDIR)\bin;$(PATH)
+	@set PATH=$(_TCLDIR)\bin;$(PATH)
 	$(DEBUGGER) $(TCLSH) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS)
 !else
-        @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
+	@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
 	$(DEBUGGER) $(TCLSH) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) \
 		-load "package ifneeded tdbc::postgres $(DOTVERSION) \
 			{source {$(LIBDIR:\=/)/tdbcpostgres.tcl};load {$(PRJLIB:\=/)} [string totitle $(PROJECT)]};\
diff -pruN 1.1.12-1/win/nmakehlp.c 1.1.13-1/win/nmakehlp.c
--- 1.1.12-1/win/nmakehlp.c	2025-07-25 19:07:21.000000000 +0000
+++ 1.1.13-1/win/nmakehlp.c	2025-11-05 09:35:20.000000000 +0000
@@ -19,7 +19,6 @@
 #pragma comment (lib, "kernel32.lib")
 #endif
 #include <stdio.h>
-#include <math.h>
 
 /*
  * This library is required for x64 builds with _some_ versions of MSVC
@@ -91,7 +90,7 @@ main(
 	case 'c':
 	    if (argc != 3) {
 		chars = snprintf(msg, sizeof(msg) - 1,
-		        "usage: %s -c <compiler option>\n"
+			"usage: %s -c <compiler option>\n"
 			"Tests for whether cl.exe supports an option\n"
 			"exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
 		WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars,
@@ -102,7 +101,7 @@ main(
 	case 'l':
 	    if (argc < 3) {
 		chars = snprintf(msg, sizeof(msg) - 1,
-	       		"usage: %s -l <linker option> ?<mandatory option> ...?\n"
+			"usage: %s -l <linker option> ?<mandatory option> ...?\n"
 			"Tests for whether link.exe supports an option\n"
 			"exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
 		WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars,
@@ -319,11 +318,11 @@ CheckForCompilerFeature(
      */
 
     return !(strstr(Out.buffer, "D4002") != NULL
-             || strstr(Err.buffer, "D4002") != NULL
-             || strstr(Out.buffer, "D9002") != NULL
-             || strstr(Err.buffer, "D9002") != NULL
-             || strstr(Out.buffer, "D2021") != NULL
-             || strstr(Err.buffer, "D2021") != NULL);
+	    || strstr(Err.buffer, "D4002") != NULL
+	    || strstr(Out.buffer, "D9002") != NULL
+	    || strstr(Err.buffer, "D9002") != NULL
+	    || strstr(Out.buffer, "D2021") != NULL
+	    || strstr(Err.buffer, "D2021") != NULL);
 }
 
 static int
@@ -494,9 +493,9 @@ IsIn(
 
 /*
  * GetVersionFromFile --
- * 	Looks for a match string in a file and then returns the version
- * 	following the match where a version is anything acceptable to
- * 	package provide or package ifneeded.
+ *	Looks for a match string in a file and then returns the version
+ *	following the match where a version is anything acceptable to
+ *	package provide or package ifneeded.
  */
 
 static const char *
@@ -601,9 +600,9 @@ list_free(list_item_t **listPtrPtr)
  *
  *	Usage is something like:
  *	  nmakehlp -S << $** > $@
- *        @PACKAGE_NAME@ $(PACKAGE_NAME)
- *        @PACKAGE_VERSION@ $(PACKAGE_VERSION)
- *        <<
+ *	    @PACKAGE_NAME@ $(PACKAGE_NAME)
+ *	    @PACKAGE_VERSION@ $(PACKAGE_VERSION)
+ *	    <<
  */
 
 static int
@@ -748,8 +747,9 @@ static int LocateDependencyHelper(const
 #else
     hSearch = FindFirstFile(path, &finfo);
 #endif
-    if (hSearch == INVALID_HANDLE_VALUE)
+    if (hSearch == INVALID_HANDLE_VALUE) {
 	return 1; /* Not found */
+    }
 
     /* Loop through all subdirs checking if the keypath is under there */
     ret = 1; /* Assume not found */
@@ -759,11 +759,13 @@ static int LocateDependencyHelper(const
 	 * We need to check it is a directory despite the
 	 * FindExSearchLimitToDirectories in the above call. See SDK docs
 	 */
-	if ((finfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
+	if ((finfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
 	    continue;
+	}
 	sublen = strlen(finfo.cFileName);
-	if ((dirlen+1+sublen+1+keylen+1) > sizeof(path))
+	if ((dirlen+1+sublen+1+keylen+1) > sizeof(path)) {
 	    continue;		/* Path does not fit, assume not matched */
+	}
 	strncpy(path+dirlen+1, finfo.cFileName, sublen);
 	path[dirlen+1+sublen] = '\\';
 	strncpy(path+dirlen+1+sublen+1, keypath, keylen+1);
@@ -783,13 +785,13 @@ static int LocateDependencyHelper(const
  * LocateDependency --
  *
  *	Locates a dependency for a package.
- *        keypath - a relative path within the package directory
- *          that is used to confirm it is the correct directory.
+ *	    keypath - a relative path within the package directory
+ *	      that is used to confirm it is the correct directory.
  *	The search path for the package directory is currently only
- *      the parent and grandparent of the current working directory.
- *      If found, the command prints
- *         name_DIRPATH=<full path of located directory>
- *      and returns 0. If not found, does not print anything and returns 1.
+ *	    the parent and grandparent of the current working directory.
+ *	    If found, the command prints
+ *	      name_DIRPATH=<full path of located directory>
+ *	    and returns 0. If not found, does not print anything and returns 1.
  */
 static int LocateDependency(const char *keypath)
 {
