Revert "pgsql: Eliminate output_to() usage." Reverted because the new write(Stdio.Buffer) does not work correctly. This reverts commit c3de6fbb7d0fc577e49bfcefbf00d33c0ba875b0.