diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog
index 0e76101b7dd6ff45c2b175583290a252fb984cd1..71ac693da3828c9d908051ab59f23199b0730728 100644
--- a/src/interfaces/ecpg/ChangeLog
+++ b/src/interfaces/ecpg/ChangeLog
@@ -297,3 +297,17 @@ Thu Aug 20 15:31:29 CEST 1998
 	- Cleaned up memory allocation in ecpglib.c
 	- Set library version to 2.6
 
+Wed Aug 26 16:17:39 CEST 1998
+
+	- Sync preproc.y with gram.y
+
+Thu Aug 27 15:32:23 CEST 1998
+
+	- Fix some minor glitches that the AIX compiler complains about
+	- Added patchlevel to library
+
+Fri Aug 28 15:36:58 CEST 1998
+
+	- Removed one line of code that AIX complains about since it was not
+	  needed anyway
+	- Set library version to 2.6.1
diff --git a/src/interfaces/ecpg/lib/Makefile.in b/src/interfaces/ecpg/lib/Makefile.in
index 53f3d5ac44abf91be8b3dfc81b971583a469384a..411519273562ea253ced4056b52583ec49c83ef3 100644
--- a/src/interfaces/ecpg/lib/Makefile.in
+++ b/src/interfaces/ecpg/lib/Makefile.in
@@ -5,6 +5,7 @@ PQ_INCLUDE=-I$(SRCDIR)/interfaces/libpq
 
 SO_MAJOR_VERSION=2
 SO_MINOR_VERSION=6
+SO_PATCHLEVEL=1
 
 PORTNAME=@PORTNAME@
 
@@ -19,21 +20,21 @@ ifeq ($(PORTNAME), linux)
   LINUX_ELF=@LINUX_ELF@
   ifdef LINUX_ELF
     install-shlib-dep := install-shlib
-    shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+    shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_PATCHLEVEL)
     LDFLAGS_SL = -shared -soname libecpg.so.$(SO_MAJOR_VERSION)
   endif
 endif
 ifeq ($(PORTNAME), bsd)
   ifdef BSD_SHLIB
     install-shlib-dep := install-shlib
-    shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+    shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_PATCHLEVEL)
     LDFLAGS_SL = -x -Bshareable -Bforcearchive
     CFLAGS += $(CFLAGS_SL)
   endif
 endif
 #ifeq ($(PORTNAME), solaris)
 #  install-shlib-dep := install-shlib
-#  shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
+#  shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_PATCHLEVEL)
 #  LDFLAGS_SL = -G -z text
 #  CFLAGS += $(CFLAGS_SL)
 #endif
diff --git a/src/interfaces/ecpg/lib/ecpglib.c b/src/interfaces/ecpg/lib/ecpglib.c
index e2b8e2ce5993ac5130ae7a05c93313e949256bd1..23abd32a73dc4f7aa8196eca7c36c3660854746a 100644
--- a/src/interfaces/ecpg/lib/ecpglib.c
+++ b/src/interfaces/ecpg/lib/ecpglib.c
@@ -701,7 +701,7 @@ ECPGexecute(struct statement *stmt)
                                                                  }
                                                                  else
                                                                  {
-                                                                         strncpy((char *) (var->value + var->offset * act_tuple), pval, var->varcharsize);
+                                                                         strncpy((char *) ((long)var->value + var->offset * act_tuple), pval, var->varcharsize);
                                                                          if (var->varcharsize < strlen(pval))
                                                                          {
                                                                                  /* truncation */
@@ -731,7 +731,7 @@ ECPGexecute(struct statement *stmt)
                                                  case ECPGt_varchar:
                                                          {
                                                                  struct ECPGgeneric_varchar *variable =
-								 (struct ECPGgeneric_varchar *) (var->value + var->offset * act_tuple);
+								 (struct ECPGgeneric_varchar *) ((long)var->value + var->offset * act_tuple);
     
 								 if (var->varcharsize == 0)
 								   strncpy(variable->arr, pval, strlen(pval));
@@ -828,7 +828,6 @@ ECPGexecute(struct statement *stmt)
 		free(notify);
 	}
 
-	va_end(ap);
 	return status;
 }
 
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y
index fec7232375ec5088723386a88fcab308219bc32b..929ab01ed215b0892686d3083d49e32067d75025 100644
--- a/src/interfaces/ecpg/preproc/preproc.y
+++ b/src/interfaces/ecpg/preproc/preproc.y
@@ -566,7 +566,7 @@ output_statement(char * stmt, int mode)
                 LANCOMPILER, LISTEN, UNLISTEN, LOAD, LOCK_P, LOCATION, MAXVALUE, MINVALUE, MOVE,
                 NEW, NONE, NOTHING, NOTNULL, OIDS, OPERATOR, PROCEDURAL,
                 RECIPE, RENAME, RESET, RETURNS, ROW, RULE,
-                SEQUENCE, SETOF, SHOW, START, STATEMENT, STDIN, STDOUT, TRUSTED,
+                SERIAL, SEQUENCE, SETOF, SHOW, START, STATEMENT, STDIN, STDOUT, TRUSTED,
                 VACUUM, VERBOSE, VERSION, ENCODING
 
 /* Keywords (obsolete; retain through next version for parser - thomas 1997-12-0 4) */
@@ -1083,6 +1083,10 @@ columnDef:  ColId Typename ColQualifier
 				{
 					$$ = cat3_str($1, $2, $3);
 				}
+	| ColId SERIAL
+		{
+			$$ = make2_str($1, make1_str(" serial"));
+		}
 		;
 
 ColQualifier:  ColQualList	{ $$ = $1; }
@@ -3795,6 +3799,7 @@ ColId:  ident							{ $$ = $1; }
 		| PRIVILEGES					{ $$ = make1_str("privileges"); }
 		| RECIPE						{ $$ = make1_str("recipe"); }
 		| ROW							{ $$ = make1_str("row"); }
+		| SERIAL						{ $$ = make1_str("serial"); }
 		| START							{ $$ = make1_str("start"); }
 		| STATEMENT						{ $$ = make1_str("statement"); }
 		| TIME							{ $$ = make1_str("time"); }