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.
- [GENERAL] Appending \o output instead of overwriting the outp... Brent Wood
- Re: [GENERAL] Appending \o output instead of overwriting... Tom Lane
- Re: [GENERAL] Appending \o output instead of overwriting... Abdul Rahman