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

Commit2128e5c

Browse files
author
Neil Conway
committed
In psql, when running a SELECT query using a cursor, flush the query
output after each FETCH. This ensures that incremental results areavailable to clients that are executing long-running SELECT queriesvia the FETCH_COUNT feature.
1 parentba82629 commit2128e5c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎src/bin/psql/common.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2007, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.134 2007/04/16 20:15:38 mha Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.135 2007/06/22 01:09:28 neilc Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"common.h"
@@ -1076,6 +1076,12 @@ ExecQueryUsingCursor(const char *query, double *elapsed_msec)
10761076

10771077
printQuery(results,&my_popt,pset.queryFout,pset.logfile);
10781078

1079+
/*
1080+
* Make sure to flush the output stream, so intermediate
1081+
* results are visible to the client immediately.
1082+
*/
1083+
fflush(pset.queryFout);
1084+
10791085
/* after the first result set, disallow header decoration */
10801086
my_popt.topt.start_table= false;
10811087
my_popt.topt.prior_records+=ntuples;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp