psql - save results of command to a file

后端 未结 10 1197
日久生厌
日久生厌 2020-12-12 09:10

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

10条回答
  •  误落风尘
    2020-12-12 09:35

    I assume that there exist some internal psql command for this, but you could also run the script command from util-linux-ng package:

    DESCRIPTION Script makes a typescript of everything printed on your terminal.

提交回复
热议问题