diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-08-29 22:25:08 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-08-29 22:25:08 +0000 |
commit | c2f60711d25b256dbe2c1ddce833c5c69ca051cc (patch) | |
tree | 37f805b925c2d8827d27e9930351cf778fdc9afb /doc/src | |
parent | 7c5ac5ce2234688a1048d4c26d9fa7cabeaa004f (diff) | |
download | postgresql-c2f60711d25b256dbe2c1ddce833c5c69ca051cc.tar.gz postgresql-c2f60711d25b256dbe2c1ddce833c5c69ca051cc.zip |
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 and
therefore not risking exhausting memory. A disadvantage of the scheme
is that 'aligned' output mode will align each group of rows independently
leading to odd-looking output, but all the other output formats work
reasonably well. Chris Mair, with some additional hacking by moi.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/psql-ref.sgml | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 97809bb7b19..d6528d0bc10 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.166 2006/07/27 19:52:04 tgl Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.167 2006/08/29 22:25:04 tgl Exp $ PostgreSQL documentation --> @@ -2008,6 +2008,33 @@ bar </varlistentry> <varlistentry> + <term><varname>FETCH_COUNT</varname></term> + <listitem> + <para> + If this variable is set to an integer value > 0, + the results of <command>SELECT</command> queries are fetched + and displayed in groups of that many rows, rather than the + default behavior of collecting the entire result set before + display. Therefore only a + limited amount of memory is used, regardless of the size of + the result set. Settings of 100 to 1000 are commonly used + when enabling this feature. + Keep in mind that when using this feature, a query may + fail after having already displayed some rows. + </para> + <tip> + <para> + Although you can use any output format with this feature, + the default <literal>aligned</> format tends to look bad + because each group of <varname>FETCH_COUNT</varname> rows + will be formatted separately, leading to varying column + widths across the row groups. The other output formats work better. + </para> + </tip> + </listitem> + </varlistentry> + + <varlistentry> <term><varname>HISTCONTROL</varname></term> <listitem> <para> |