@@ -52,10 +52,10 @@ libpqConnect(const char *connstr)
5252
5353 conn = PQconnectdb (connstr );
5454 if (PQstatus (conn ) == CONNECTION_BAD )
55- pg_fatal ("could not connect to remote server: %s\n " ,
55+ pg_fatal ("could not connect to server: %s" ,
5656 PQerrorMessage (conn ));
5757
58- pg_log (PG_PROGRESS , "connected to remote server\n" );
58+ pg_log (PG_PROGRESS , "connected to server\n" );
5959
6060 /*
6161 * Check that the server is not in hot standby mode. There is no
@@ -91,12 +91,12 @@ run_simple_query(const char *sql)
9191 res = PQexec (conn , sql );
9292
9393 if (PQresultStatus (res ) != PGRES_TUPLES_OK )
94- pg_fatal ("error running query (%s) in source server: %s\n " ,
94+ pg_fatal ("error running query (%s) in source server: %s" ,
9595 sql , PQresultErrorMessage (res ));
9696
9797 /* sanity check the result set */
9898 if (PQnfields (res ) != 1 || PQntuples (res ) != 1 || PQgetisnull (res , 0 , 0 ))
99- pg_fatal ("unexpected result set while running query\n" );
99+ pg_fatal ("unexpected result set from query\n" );
100100
101101 result = pg_strdup (PQgetvalue (res , 0 , 0 ));
102102
@@ -119,7 +119,7 @@ libpqGetCurrentXlogInsertLocation(void)
119119 val = run_simple_query ("SELECT pg_current_xlog_insert_location()" );
120120
121121 if (sscanf (val , "%X/%X" , & hi , & lo ) != 2 )
122- pg_fatal ("unexpected result \"%s\" while fetching current XLOG insert location\n" , val );
122+ pg_fatal ("unrecognized result \"%s\" for current XLOG insert location\n" , val );
123123
124124 result = ((uint64 ) hi ) << 32 | lo ;
125125
@@ -167,7 +167,7 @@ libpqProcessFileList(void)
167167 res = PQexec (conn , sql );
168168
169169 if (PQresultStatus (res ) != PGRES_TUPLES_OK )
170- pg_fatal ("unexpected result while fetching file list: %s\n " ,
170+ pg_fatal ("could not fetch file list: %s" ,
171171 PQresultErrorMessage (res ));
172172
173173 /* sanity check the result set */
@@ -210,7 +210,7 @@ receiveFileChunks(const char *sql)
210210 PGresult * res ;
211211
212212 if (PQsendQueryParams (conn , sql , 0 , NULL , NULL , NULL , NULL , 1 ) != 1 )
213- pg_fatal ("could not send query: %s\n " , PQerrorMessage (conn ));
213+ pg_fatal ("could not send query: %s" , PQerrorMessage (conn ));
214214
215215 pg_log (PG_DEBUG , "getting file chunks" );
216216
@@ -262,7 +262,7 @@ receiveFileChunks(const char *sql)
262262 PQgetisnull (res , 0 , 1 ) ||
263263 PQgetisnull (res , 0 , 2 ))
264264 {
265- pg_fatal ("unexpected NULL result while fetching remote files\n" );
265+ pg_fatal ("unexpected null values in result while fetching remote files\n" );
266266 }
267267
268268 if (PQgetlength (res , 0 , 1 ) != sizeof (int32 ))
@@ -280,7 +280,7 @@ receiveFileChunks(const char *sql)
280280
281281 chunk = PQgetvalue (res , 0 , 2 );
282282
283- pg_log (PG_DEBUG , "received chunk for file \"%s\", off %d, len %d\n" ,
283+ pg_log (PG_DEBUG , "received chunk for file \"%s\", offset %d, size %d\n" ,
284284 filename , chunkoff , chunksize );
285285
286286 open_target_file (filename , false);
@@ -309,7 +309,7 @@ libpqGetFile(const char *filename, size_t *filesize)
309309 1 , NULL , paramValues , NULL , NULL , 1 );
310310
311311 if (PQresultStatus (res ) != PGRES_TUPLES_OK )
312- pg_fatal ("unexpected result while fetching remote file \"%s\": %s\n " ,
312+ pg_fatal ("could not fetch remote file \"%s\": %s" ,
313313 filename , PQresultErrorMessage (res ));
314314
315315 /* sanity check the result set */
@@ -355,7 +355,7 @@ fetch_file_range(const char *path, unsigned int begin, unsigned int end)
355355 snprintf (linebuf , sizeof (linebuf ), "%s\t%u\t%u\n" , path , begin , len );
356356
357357 if (PQputCopyData (conn , linebuf , strlen (linebuf )) != 1 )
358- pg_fatal ("error sending COPY data: %s\n " ,
358+ pg_fatal ("could not send COPY data: %s" ,
359359 PQerrorMessage (conn ));
360360
361361 begin += len ;
@@ -381,14 +381,14 @@ libpq_executeFileMap(filemap_t *map)
381381 res = PQexec (conn , sql );
382382
383383 if (PQresultStatus (res ) != PGRES_COMMAND_OK )
384- pg_fatal ("error creating temporary table: %s\n " ,
384+ pg_fatal ("could not create temporary table: %s" ,
385385 PQresultErrorMessage (res ));
386386
387387 sql = "COPY fetchchunks FROM STDIN" ;
388388 res = PQexec (conn , sql );
389389
390390 if (PQresultStatus (res ) != PGRES_COPY_IN )
391- pg_fatal ("unexpected result while sending file list: %s\n " ,
391+ pg_fatal ("could not send file list: %s" ,
392392 PQresultErrorMessage (res ));
393393
394394 for (i = 0 ; i < map -> narray ; i ++ )
@@ -429,13 +429,13 @@ libpq_executeFileMap(filemap_t *map)
429429 }
430430
431431 if (PQputCopyEnd (conn , NULL ) != 1 )
432- pg_fatal ("error sending end-of-COPY: %s\n " ,
432+ pg_fatal ("could not send end-of-COPY: %s" ,
433433 PQerrorMessage (conn ));
434434
435435 while ((res = PQgetResult (conn )) != NULL )
436436 {
437437 if (PQresultStatus (res ) != PGRES_COMMAND_OK )
438- pg_fatal ("unexpected result while sending file list: %s\n " ,
438+ pg_fatal ("unexpected result while sending file list: %s" ,
439439 PQresultErrorMessage (res ));
440440 }
441441
0 commit comments