Single Row Mode in psql

Поиск
Список
Период
Сортировка
От Christopher Manning
Тема Single Row Mode in psql
Дата
Msg-id CAEYkp90OoiMGnDqsWf=w2rWFz07so6hrbzr3U1aFH4EkiL=AEg@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
I'm using psql to extract data from a redshift (based on postgres) instance, but psql/libpq collects the result in memory before writing it to a file and causes out of memory problems for large results. Using COPY TO STDOUT or FETCH_COUNT isn't an option since redshift doesn't support those.

[Single Row Mode is available in postgres 9.2](http://www.postgresql.org/docs/9.2/static/libpq-single-row-mode.html) but [it doesn't look like](http://www.postgresql.org/docs/9.2/static/app-psql.html) you can tell psql to use it when writing to a file (using --output).

Is it currently possible to have psql --output to a file using single row mode?

Thank you,
Christopher

P.S. The ruby-pg gem supports single row mode: https://bitbucket.org/ged/ruby-pg/src/de1cdb0f7ba625ad7cec02bb871ae8fdf7de68c8/ext/pg_connection.c?at=default#cl-1514 but it has the overhead of being a ruby script instead of psql supporting it.

В списке pgsql-general по дате отправления:

Предыдущее
От: François Beausoleil
Дата:
Сообщение: Re: Most efficient way to insert without duplicates
Следующее
От: Mike Roest
Дата:
Сообщение: Re: Fetching Server configured port from C Module