[英]How do I use the pg_restore --list to inspect the contents of a non-restored directory?
I am trying to inspect the contents of an archive that I just unzipped using the following code我正在尝试使用以下代码检查刚刚解压缩的档案的内容
pg_restore --list filename
I've aslo tried我也试过
pg_restore --list D:/above_file/filename
I'm using PostgreSQL 12我正在使用 PostgreSQL 12
Came across the same issue.遇到了同样的问题。 The answer is that you need to direct the list-file output to a file by specifying the file option as follows:
答案是您需要通过指定文件选项将列表文件 output 指向一个文件,如下所示:
pg_restore --list --file=".\list-file.txt" backupfilepath
By default the archive list is sent to StdOut as it is designed to be passed into another pg_restore use-list option.默认情况下,存档列表被发送到 StdOut,因为它被设计为传递到另一个 pg_restore use-list 选项。 See the documentation on the file option copied here for ease of reference:
请参阅此处复制的有关文件选项的文档,以便于参考:
Specify output file for generated script, or for the listing when used with -l.
为生成的脚本指定 output 文件,或者在与 -l 一起使用时为列表指定。 Use - for stdout.
使用 - 用于标准输出。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.