I’m using psql’s \dt to list all tables in a database and I need to save the results.
What is the syntax to export the results of a psql command to a file?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From psql’s help (
\?):The sequence of commands will look like this:
Then any db operation output will be written to out.txt.
Enter ‘\o’ to revert the output back to console.