【发布时间】:2015-07-01 14:27:27
【问题描述】:
我对我管理的 Postgres 数据库中的一些表进行了一系列删除和更新。建议在一系列删除之后安排重新索引,以解决 10 分钟的下一步更新无限冻结(因为它是随机冻结的)。DOS 指令提供了以下内容:
Usage:
reindexdb [OPTION]... [DBNAME]
Options:
-a, --all reindex all databases
-d, --dbname=DBNAME database to reindex
-e, --echo show the commands being sent to the server
-i, --index=INDEX recreate specific index only
-q, --quiet don't write any messages
-s, --system reindex system catalogs
-t, --table=TABLE reindex specific table only
--help show this help, then exit
--version output version information, then exit
Connection options:
-h, --host=HOSTNAME database server host or socket directory
-p, --port=PORT database server port
-U, --username=USERNAME user name to connect as
-w, --no-password never prompt for password
-W, --password force password prompt
我们必须使用 9.1.3 版本,因为这是公司标准。 我已经尝试了所有我能想到的选项,但它不需要命令来重新索引:
reindexdb.exe -U username=MyUserName -W MyPassword -t table=MyDatabase.MyTable
我也试过
reindexdb.exe -U MyUserName -W MyPassword -t MyDatabase.MyTable
和
reindexdb.exe -U MyUserName -W MyPassword -t MyTable -d MyDatabase
...但它们都以错误结束:
reindexdb: too many command-line arguments (first is "-t")
有没有人有一个工作示例可以阐明正确的语法是什么?
【问题讨论】:
-
使用密码文件,在 Windows 上:%APPDATA%\postgresql\pgpass.conf。详情:stackoverflow.com/a/15593100/939860
标签: postgresql postgresql-9.1 reindex