Tip of the month
PostgreSQL -O option can be used to capture the output of an SQL statement execution, but it does not capture the error message, if any, during this SQL execution. In order to capture the output of this SQL execution along with the error message, you can use below command while executing the SQL statement.
psql -d postgres -U postgres -f test.sql &>output_with_errors.log
- Technical Tip by Sushant Pawar, Database Solution Consultant - Ashnik
|