How to redirect psql output to a text file

Below is the process to redirect the psql output to a text file. 

\o 'D:/temp/Customers_List.txt'
SELECT * FROM Tst_ScripFile_Execu_PSQL;
\o







Please note that once after the query executed, we have to use again "\o" to stop the output redirecting.

Comments

Popular posts from this blog

How to connect postgresql database through ODBC driver in excel

Postgresql System files and their uses