> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# postgresql_connection_* 会话设置

> postgresql_connection_* 自动生成组中的 ClickHouse 会话设置。

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>类型</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>默认值</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          无需重启即可更改
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

这些设置可在 [system.settings](/docs/zh/reference/system-tables/settings) 中找到，并由 [源代码](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp) 自动生成。

<div id="postgresql_connection_attempt_timeout">
  ## postgresql\_connection\_attempt\_timeout
</div>

<SettingsInfoBlock type="UInt64" default_value="2" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.7"},{"label": "2"},{"label": "用于控制 PostgreSQL 连接的 `connect_timeout` 参数。"}]}]} />

单次连接 PostgreSQL 端点的连接超时时间，单位为秒。
该值会作为连接 URL 的 `connect_timeout` 参数传递。

<div id="postgresql_connection_pool_auto_close_connection">
  ## postgresql\_connection\_pool\_auto\_close\_connection
</div>

<SettingsInfoBlock type="Bool" default_value="0" />

在将连接返回到连接池之前关闭该连接。

<div id="postgresql_connection_pool_retries">
  ## postgresql\_connection\_pool\_retries
</div>

<SettingsInfoBlock type="UInt64" default_value="2" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.7"},{"label": "2"},{"label": "允许控制 PostgreSQL 连接池中的重试次数。"}]}]} />

用于 PostgreSQL 表引擎和数据库引擎的连接池 push/pop 重试次数。

<div id="postgresql_connection_pool_size">
  ## postgresql\_connection\_pool\_size
</div>

<SettingsInfoBlock type="UInt64" default_value="16" />

PostgreSQL 表引擎和数据库引擎的连接池大小。

<div id="postgresql_connection_pool_wait_timeout">
  ## postgresql\_connection\_pool\_wait\_timeout
</div>

<SettingsInfoBlock type="UInt64" default_value="5000" />

PostgreSQL 表引擎和数据库引擎中，连接池为空时 push/pop 操作的超时时间。默认情况下，连接池为空时会阻塞等待。
