Search Postgresql Archives

Single Row Mode in psql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux