diff --git a/src/interfaces/ecpg/pgtypeslib/common.c b/src/interfaces/ecpg/pgtypeslib/common.c
index d1202eb59a112d9f105fc204c884acbeb04804e6..f9762c8ae34e066293a66839282702262f6c5f0b 100644
--- a/src/interfaces/ecpg/pgtypeslib/common.c
+++ b/src/interfaces/ecpg/pgtypeslib/common.c
@@ -80,10 +80,10 @@ pgtypes_fmt_replace(union un_fmt_comb replace_val, int replace_type, char** outp
 						i = snprintf(t, PGTYPES_FMT_NUM_MAX_DIGITS,
 								"%0.0g", replace_val.double_val);
 						break;
-#ifdef HAVE_INT6
+#ifdef HAVE_INT64
 					case PGTYPES_TYPE_INT64:
 						i = snprintf(t, PGTYPES_FMT_NUM_MAX_DIGITS,
-								INT64_FORMAT, replace_val.replace_int64);
+								INT64_FORMAT, replace_val.int64_val);
 						break;
 #endif
 					case PGTYPES_TYPE_UINT:
diff --git a/src/interfaces/ecpg/pgtypeslib/timestamp.c b/src/interfaces/ecpg/pgtypeslib/timestamp.c
index a0b4626bf065df1ad0af69b0da40f92066dfc6b9..4d1a13d9e5b138407bca8935c2e079ac78286f32 100644
--- a/src/interfaces/ecpg/pgtypeslib/timestamp.c
+++ b/src/interfaces/ecpg/pgtypeslib/timestamp.c
@@ -546,7 +546,7 @@ dttofmtasc_replace (Timestamp *ts, Date dDate, int dow, struct tm* tm,
 					break;
 				case 's':
 #ifdef HAVE_INT64_TIMESTAMP
-					replace_val.replace_int64 = ((*ts - SetEpochTimestamp()) / 1000000e0);
+					replace_val.int64_val = ((*ts - SetEpochTimestamp()) / 1000000e0);
 					replace_type = PGTYPES_TYPE_INT64;
 #else
 					replace_val.double_val = *ts - SetEpochTimestamp();