Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos Mac OS X上安装了Postgresql,但没有/usr/local/psql_Macos_Postgresql_Installation - Fatal编程技术网

Macos Mac OS X上安装了Postgresql,但没有/usr/local/psql

Macos Mac OS X上安装了Postgresql,但没有/usr/local/psql,macos,postgresql,installation,Macos,Postgresql,Installation,我已经在Mac OS X上安装了postgresql,并且可以清楚地看到它的安装,因为我在端口5432上运行它。然而,它并没有像预期的那样使用/usr/local/postgres作为根 我怎么知道它安装在哪里?另外,没有安装在该位置是否存在任何问题 这里有一个查询,向您显示postgresql内部“知道”的文件的位置: SELECT current_setting('data_directory') data_directory, current_setting('config_file')

我已经在Mac OS X上安装了postgresql,并且可以清楚地看到它的安装,因为我在端口5432上运行它。然而,它并没有像预期的那样使用/usr/local/postgres作为根


我怎么知道它安装在哪里?另外,没有安装在该位置是否存在任何问题

这里有一个查询,向您显示postgresql内部“知道”的文件的位置:

SELECT current_setting('data_directory') data_directory, current_setting('config_file') config_file, current_setting('hba_file') hba_file, current_setting('ident_file') ident_file, current_setting('external_pid_file') external_pid_file;
您可以通过以下命令行检查postmaster进程的位置:

ps aux | grep bin/postgres | head -n 1 | sed -e 's/.*[[:digit:]] //'

pg_config通常位于同一个目录中,因此您可以从那里找到其他任何内容的位置。

谢谢,这非常有效,但是我的配置没有安装/位于/usr/local/postgres中有什么缺点吗?没有。你可能想把它放在你的路径上,但它在任何地方都能正常工作。