"Yuri Cherio" <yuri(at)aergo(dot)com> writes:
> psql -f "filename.sql" > "out_file_name"
> One would expect that standard output should not be accumulated until it
> blows up but instead would behave as a stream.
This is not the case, for various reasons that I don't feel like
debating right now. You might try using \copy instead of a SELECT,
though.
regards, tom lane