File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ GetConnection(void)
75
75
const char * * keywords ;
76
76
const char * * values ;
77
77
char * password = NULL ;
78
+ const char * tmpparam ;
78
79
79
80
if (dbhost )
80
81
argcount ++ ;
@@ -157,6 +158,29 @@ GetConnection(void)
157
158
free (values );
158
159
free (keywords );
159
160
161
+ /*
162
+ * Ensure we have the same value of integer timestamps as the
163
+ * server we are connecting to.
164
+ */
165
+ tmpparam = PQparameterStatus (tmpconn , "integer_datetimes" );
166
+ if (!tmpparam )
167
+ {
168
+ fprintf (stderr , _ ("%s: could not determine server setting for integer_datetimes\n" ),
169
+ progname );
170
+ exit (1 );
171
+ }
172
+
173
+ #ifdef HAVE_INT64_TIMESTAMP
174
+ if (strcmp (tmpparam , "on" ) != 0 )
175
+ #else
176
+ if (strcmp (tmpparam , "off" ) != 0 )
177
+ #endif
178
+ {
179
+ fprintf (stderr , _ ("%s: integer_datetimes compile flag does not match server\n" ),
180
+ progname );
181
+ exit (1 );
182
+ }
183
+
160
184
/* Store the password for next run */
161
185
if (password )
162
186
dbpassword = password ;
You can’t perform that action at this time.
0 commit comments