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

Commitc2f6071

Browse files
committed
Create a FETCH_COUNT parameter that causes psql to execute SELECT-like
queries via a cursor, fetching a limited number of rows at a time andtherefore not risking exhausting memory. A disadvantage of the schemeis that 'aligned' output mode will align each group of rows independentlyleading to odd-looking output, but all the other output formats workreasonably well. Chris Mair, with some additional hacking by moi.
1 parent7c5ac5c commitc2f6071

File tree

6 files changed

+859
-484
lines changed

6 files changed

+859
-484
lines changed

‎doc/src/sgml/ref/psql-ref.sgml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.166 2006/07/27 19:52:04 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.167 2006/08/29 22:25:04 tgl Exp $
33
PostgreSQL documentation
44
-->
55

@@ -2007,6 +2007,33 @@ bar
20072007
</listitem>
20082008
</varlistentry>
20092009

2010+
<varlistentry>
2011+
<term><varname>FETCH_COUNT</varname></term>
2012+
<listitem>
2013+
<para>
2014+
If this variable is set to an integer value &gt; 0,
2015+
the results of <command>SELECT</command> queries are fetched
2016+
and displayed in groups of that many rows, rather than the
2017+
default behavior of collecting the entire result set before
2018+
display. Therefore only a
2019+
limited amount of memory is used, regardless of the size of
2020+
the result set. Settings of 100 to 1000 are commonly used
2021+
when enabling this feature.
2022+
Keep in mind that when using this feature, a query may
2023+
fail after having already displayed some rows.
2024+
</para>
2025+
<tip>
2026+
<para>
2027+
Although you can use any output format with this feature,
2028+
the default <literal>aligned</> format tends to look bad
2029+
because each group of <varname>FETCH_COUNT</varname> rows
2030+
will be formatted separately, leading to varying column
2031+
widths across the row groups. The other output formats work better.
2032+
</para>
2033+
</tip>
2034+
</listitem>
2035+
</varlistentry>
2036+
20102037
<varlistentry>
20112038
<term><varname>HISTCONTROL</varname></term>
20122039
<listitem>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp