且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从psql内备份Postgresql数据库?

更新时间:2023-01-09 11:57:38

您始终可以直接从 psql 会话使用 \! [命令] 语法,例如:

You can always run shell command directly from psql session using \! [ command ] syntax, for example:

\! pg_dump -Fc -f D:\postgres.dump -U postgres postgres

当然不是这样执行 pg_dump 常见 pg_restore ,但有可能。

Of course it's not so common to execute pg_dump or pg_restore in such way, but it's possible.

VI。参考包含所有SQL命令和应用程序(客户端和服务器)的列表。

Chapter VI. Reference contains list of all SQL commands and applications (both client and server).