小编m_b*_*_br的帖子

外部 HD 上的 Postgresql 数据库

我的笔记本电脑有一个小硬盘。我想加载一个大数据集。我已将整个移动/usr/local/var/postgres到外部高清,并将其符号链接回来。现在我收到这个错误,

    psql: could not connect to server: Socket operation on non-socket
    Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Run Code Online (Sandbox Code Playgroud)

我现在已经找到了问题所在。更改默认数据目录会导致 Postgres 拒绝连接到服务器。在线手册对“同一目录中的配置文件”有点 [原文如此!] 不具体……

我使用的解决方案(使用 psql)是:

    CREATE TABLESPACE tablespacename OWNER username LOCATION '/Path/to/Folder'
Run Code Online (Sandbox Code Playgroud)

然后,

    CREATE DATABASE databasename OWNER username TABLESPACE tablespacename
Run Code Online (Sandbox Code Playgroud)

最后

    psql databasename < /Path/to/databasedump.sql
Run Code Online (Sandbox Code Playgroud)

请注意此问题的未来访问者;请参阅下面 Craig Ringer 关于如何正确解决此问题的警告。

postgresql mac-os-x

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

mac-os-x ×1

postgresql ×1