Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite605fbc

Browse files
committed
Try to defend against the possibility that libpq is still in COPY_IN state
when we reach the post-COPY "pump it dry" error recovery code that was added2006-11-24. Per a report from Neil Best, there is at least one code pathin which this occurs, leading to an infinite loop in code that's supposedto be making it more robust not less so. A reasonable response seems to beto call PQputCopyEnd() again, so let's try that.Back-patch to all versions that contain the cleanup loop.
1 parent87740ca commite605fbc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/bin/psql/copy.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/copy.c,v 1.81 2009/07/25 17:04:19 tgl Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/copy.c,v 1.82 2009/08/07 20:16:11 tgl Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"copy.h"
@@ -571,6 +571,9 @@ do_copy(const char *args)
571571
success= false;
572572
psql_error("\\copy: unexpected response (%d)\n",
573573
PQresultStatus(result));
574+
/* if still in COPY IN state, try to get out of it */
575+
if (PQresultStatus(result)==PGRES_COPY_IN)
576+
PQputCopyEnd(pset.db,_("trying to exit copy mode"));
574577
PQclear(result);
575578
}
576579

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp