Putting output from Postgres \i input to a file?

postgresql, sql

Solution

Based on the documentation, the `\o` is for directing output to a file.

Problem

Quick question (I hope!): if I use \i to feed an input file into psql, can I get the output from the queries to be saved into a file? If so, how? Thanks!!

Original source