Appending \o output instead of overwriting the output file
Hi,
Using \o to redirect output to a file from the psql command line, is there any way to have the output appended to the output file, rather than overwriting it?
Thanks,
Brent Woood
Brent Wood
DBA/GIS consultant
NIWA, Wellington
New Zealand
NIWA is the trading name of the National Institute of Water & Atmospheric Research Ltd.
"Brent Wood" <b.wood@niwa.co.nz> writes:
Using \o to redirect output to a file from the psql command line, is there any way to have the output appended to the output file, rather than overwriting it?
This is pretty grotty, but it works:
\o | cat >>target
Maybe we should provide another way in future...
regards, tom lane
Simply use '\o filename' as you are doing so. Write the queries as much as you want. It will automatically append the result in the specified file. Untill you use '\o' command again with new file name.
Import Notes
Resolved by subject fallback