unix_socket_directories 是一个 配置参数,用于指定 PostgreSQL 服务器存储其 Unix 域 套接字的文件系统目录。
unix_socket_directories 在 PostgreSQL 9.3 中被添加,取代了 unix_socket_directory。
默认值
unix_socket_directories 的默认值为:/tmp。
按 PostgreSQL 版本详细信息
unix_socket_directories (PostgreSQL 19)
| 设置 |
/tmp |
| 单位 |
|
| 类别 |
连接和身份验证 / 连接设置 |
| 简短描述 |
设置创建 Unix 域套接字的位置目录。 |
| 扩展描述 |
|
| 上下文 |
postmaster |
| 变量类型 |
string |
| 来源 |
默认 |
| 最小值 |
|
| 最大值 |
|
| 枚举值 |
|
| 启动值 |
/tmp |
| 重置值 |
/tmp |
| 源文件 |
|
| 源行 |
|
| 需要重启 |
false |
文档:unix_socket_directories
unix_socket_directories (PostgreSQL 18)
| 设置 |
/tmp |
| 单位 |
|
| 类别 |
连接和身份验证 / 连接设置 |
| 简短描述 |
设置创建 Unix 域套接字的位置目录。 |
| 扩展描述 |
|
| 上下文 |
postmaster |
| 变量类型 |
string |
| 来源 |
默认 |
| 最小值 |
|
| 最大值 |
|
| 枚举值 |
|
| 启动值 |
/tmp |
| 重置值 |
/tmp |
| 源文件 |
|
| 源行 |
|
| 需要重启 |
false |
文档:unix_socket_directories
unix_socket_directories (PostgreSQL 17)
| 设置 |
/tmp |
| 单位 |
|
| 类别 |
连接和身份验证 / 连接设置 |
| 简短描述 |
设置创建 Unix 域套接字的位置目录。 |
| 扩展描述 |
|
| 上下文 |
postmaster |
| 变量类型 |
string |
| 来源 |
默认 |
| 最小值 |
|
| 最大值 |
|
| 枚举值 |
|
| 启动值 |
/tmp |
| 重置值 |
/tmp |
| 源文件 |
|
| 源行 |
|
| 需要重启 |
false |
文档:unix_socket_directories
unix_socket_directories (PostgreSQL 16)
| 设置 |
/tmp |
| 单位 |
|
| 类别 |
连接和身份验证 / 连接设置 |
| 简短描述 |
设置创建 Unix 域套接字的位置目录。 |
| 扩展描述 |
|
| 上下文 |
postmaster |
| 变量类型 |
string |
| 来源 |
默认 |
| 最小值 |
|
| 最大值 |
|
| 枚举值 |
|
| 启动值 |
/tmp |
| 重置值 |
/tmp |
| 源文件 |
|
| 源行 |
|
| 需要重启 |
false |
文档:unix_socket_directories
unix_socket_directories (PostgreSQL 15)
| 设置 |
/tmp |
| 单位 |
|
| 类别 |
连接和身份验证 / 连接设置 |
| 简短描述 |
设置创建 Unix 域套接字的位置目录。 |
| 扩展描述 |
|
| 上下文 |
postmaster |
| 变量类型 |
string |
| 来源 |
默认 |
| 最小值 |
|
| 最大值 |
|
| 枚举值 |
|
| 启动值 |
/tmp |
| 重置值 |
/tmp |
| 源文件 |
|
| 源行 |
|
| 需要重启 |
false |
文档:unix_socket_directories
unix_socket_directories (PostgreSQL 14)
| 设置 |
/tmp |
| 单位 |
|
| 类别 |
连接和身份验证 / 连接设置 |
| 简短描述 |
设置创建 Unix 域套接字的位置目录。 |
| 扩展描述 |
|
| 上下文 |
postmaster |
| 变量类型 |
string |
| 来源 |
默认 |
| 最小值 |
|
| 最大值 |
|
| 枚举值 |
|
| 启动值 |
/tmp |
| 重置值 |
/tmp |
| 源文件 |
|
| 源行 |
|
| 需要重启 |
false |
文档:unix_socket_directories
unix_socket_directories (PostgreSQL 13)
| 设置 |
/tmp |
| 单位 |
|
| 类别 |
连接和身份验证 / 连接设置 |
| 简短描述 |
设置创建 Unix 域套接字的位置目录。 |
| 扩展描述 |
|
| 上下文 |
postmaster |
| 变量类型 |
string |
| 来源 |
默认 |
| 最小值 |
|
| 最大值 |
|
| 枚举值 |
|
| 启动值 |
/tmp |
| 重置值 |
/tmp |
| 源文件 |
|
| 源行 |
|
| 需要重启 |
false |
文档:unix_socket_directories
unix_socket_directories (PostgreSQL 12)
| 设置 |
/tmp |
| 单位 |
|
| 类别 |
连接和身份验证 / 连接设置 |
| 简短描述 |
设置创建 Unix 域套接字的位置目录。 |
| 扩展描述 |
|
| 上下文 |
postmaster |
| 变量类型 |
string |
| 来源 |
默认 |
| 最小值 |
|
| 最大值 |
|
| 枚举值 |
|
| 启动值 |
/tmp |
| 重置值 |
/tmp |
| 源文件 |
|
| 源行 |
|
| 需要重启 |
false |
文档:unix_socket_directories
unix_socket_directories (PostgreSQL 11)
| 设置 |
/tmp |
| 单位 |
|
| 类别 |
连接和身份验证 / 连接设置 |
| 简短描述 |
设置创建 Unix 域套接字的位置目录。 |
| 扩展描述 |
|
| 上下文 |
postmaster |
| 变量类型 |
string |
| 来源 |
默认 |
| 最小值 |
|
| 最大值 |
|
| 枚举值 |
|
| 启动值 |
/tmp |
| 重置值 |
/tmp |
| 源文件 |
|
| 源行 |
|
| 需要重启 |
false |
文档:unix_socket_directories
unix_socket_directories (PostgreSQL 10)
| 设置 |
/tmp |
| 单位 |
|
| 类别 |
连接和身份验证 / 连接设置 |
| 简短描述 |
设置创建 Unix 域套接字的位置目录。 |
| 扩展描述 |
|
| 上下文 |
postmaster |
| 变量类型 |
string |
| 来源 |
默认 |
| 最小值 |
|
| 最大值 |
|
| 枚举值 |
|
| 启动值 |
/tmp |
| 重置值 |
/tmp |
| 源文件 |
|
| 源行 |
|
| 需要重启 |
false |
文档:unix_socket_directories
unix_socket_directories (PostgreSQL 9.6)
| 设置 |
/tmp |
| 单位 |
|
| 类别 |
连接和身份验证 / 连接设置 |
| 简短描述 |
设置创建 Unix 域套接字的位置目录。 |
| 扩展描述 |
|
| 上下文 |
postmaster |
| 变量类型 |
string |
| 来源 |
默认 |
| 最小值 |
|
| 最大值 |
|
| 枚举值 |
|
| 启动值 |
/tmp |
| 重置值 |
/tmp |
| 源文件 |
|
| 源行 |
|
| 需要重启 |
false |
文档:unix_socket_directories
unix_socket_directories (PostgreSQL 9.5)
| 设置 |
/tmp |
| 单位 |
|
| 类别 |
连接和身份验证 / 连接设置 |
| 简短描述 |
设置创建 Unix 域套接字的位置目录。 |
| 扩展描述 |
|
| 上下文 |
postmaster |
| 变量类型 |
string |
| 来源 |
默认 |
| 最小值 |
|
| 最大值 |
|
| 枚举值 |
|
| 启动值 |
/tmp |
| 重置值 |
/tmp |
| 源文件 |
|
| 源行 |
|
| 需要重启 |
false |
文档:unix_socket_directories
unix_socket_directories (PostgreSQL 9.4)
| 设置 |
/tmp |
| 单位 |
|
| 类别 |
连接和身份验证 / 连接设置 |
| 简短描述 |
设置创建 Unix 域套接字的位置目录。 |
| 扩展描述 |
|
| 上下文 |
postmaster |
| 变量类型 |
string |
| 来源 |
默认 |
| 最小值 |
|
| 最大值 |
|
| 枚举值 |
|
| 启动值 |
/tmp |
| 重置值 |
/tmp |
| 源文件 |
|
| 源行 |
|
文档:unix_socket_directories
unix_socket_directories (PostgreSQL 9.3)
| 设置 |
/tmp |
| 单位 |
|
| 类别 |
连接和身份验证 / 连接设置 |
| 简短描述 |
设置创建 Unix 域套接字的位置目录。 |
| 扩展描述 |
|
| 上下文 |
postmaster |
| 变量类型 |
string |
| 来源 |
默认 |
| 最小值 |
|
| 最大值 |
|
| 枚举值 |
|
| 启动值 |
/tmp |
| 重置值 |
/tmp |
| 源文件 |
|
| 源行 |
|
文档:unix_socket_directories
变更历史
示例
来自 Fedora 32 下运行的 rpm 安装
postgres=# SHOW unix_socket_directories;
unix_socket_directories
---------------------------
/var/run/postgresql, /tmp
(1 row)
目录内容
[postgres@fedora32 ~]$ ls -la /var/run/postgresql
total 4
drwxr-xr-x. 2 postgres postgres 80 Oct 23 04:51 .
drwxr-xr-x. 25 root root 660 Oct 21 14:08 ..
srwxrwxrwx. 1 postgres postgres 0 Oct 23 04:51 .s.PGSQL.5432
-rw-------. 1 postgres postgres 65 Oct 23 04:51 .s.PGSQL.5432.lock
[postgres@fedora32 ~]$ ls -la /tmp/.s.PGSQL.5432*
srwxrwxrwx. 1 postgres postgres 0 Oct 23 04:51 /tmp/.s.PGSQL.5432
-rw-------. 1 postgres postgres 50 Oct 23 04:51 /tmp/.s.PGSQL.5432.lock