<?xml version="1.0" encoding="gbk"?>
<rss version="2.0">
  <channel>
    <title>重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛 - Postgre SQL</title>
    <link>http://bbs.cqsztech.com/forum.php?mod=forumdisplay&amp;fid=63</link>
    <description>Latest 20 threads of Postgre SQL</description>
    <copyright>Copyright(C) 重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛</copyright>
    <generator>Discuz! Board by Comsenz Inc.</generator>
    <lastBuildDate>Sun, 07 Jun 2026 06:39:11 +0000</lastBuildDate>
    <ttl>60</ttl>
    <image>
      <url>http://bbs.cqsztech.com/static/image/common/logo_88_31.gif</url>
      <title>重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛</title>
      <link>http://bbs.cqsztech.com/</link>
    </image>
    <item>
      <title>PostgreSQL pg_stat_activity 状态（state）字段全解析</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33487</link>
      <description><![CDATA[一、概述
pg_stat_activity 是 PostgreSQL 核心系统视图，用于实时监控数据库会话状态，state 字段直接反映会话当前运行状态，是 DBA 排查锁阻塞、慢查询、连接泄漏等问题的核心依据。本文基于 PostgreSQL 12+ 官方文档，完整梳理 state 所有取值、含义、风险等级及运 ...]]></description>
      <category>Postgre SQL</category>
      <author>mahan</author>
      <pubDate>Sun, 31 May 2026 12:17:40 +0000</pubDate>
    </item>
    <item>
      <title>PostgreSQL缓冲区简介</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33471</link>
      <description><![CDATA[PostgreSQL缓冲区简介


缓冲区是那种容易被遗忘的话题。虽然它们是PostgreSQL性能架构的基础，但我们大多数人都把它们当作黑箱。本文将试图改变这种状况。

8KB页面
在深入探讨缓冲区之前，有一个概念我们需要先讲清楚。这就是8KB页面的概念。PostgreSQL 中的所 ...]]></description>
      <category>Postgre SQL</category>
      <author>mahan</author>
      <pubDate>Sun, 24 May 2026 13:35:25 +0000</pubDate>
    </item>
    <item>
      <title>PG数据库根目录爆满（100%）停机迁移表空间</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33461</link>
      <description><![CDATA[1. 事故背景



PG数据库日志不断报错：设备上没有空间，执行 df -h 检查系统盘，发现根目录 /dev/mapper/ao-root（70G）使用率已达100%



深入排查后发现，大头来自 PostgreSQL 14 的表空间 zldut，其物理位置默认建在根目录下，数据量已达 55 GB，导致系统空 ...]]></description>
      <category>Postgre SQL</category>
      <author>ZhangQi</author>
      <pubDate>Fri, 22 May 2026 09:46:04 +0000</pubDate>
    </item>
    <item>
      <title>PostgreSQL编译报错：library \'pam\' is required for PAM 解决方案</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33453</link>
      <description><![CDATA[编译 PostgreSQL 14.5 时报错，执行的 configure 命令如下所示：
$ ./configure --prefix=/home/postgres/soft --with-openssl --with-pgport=5432 --with-tcl --with-perl  --with-libxml --with-libxslt --with-uuid=e2fs --with-pam

执行后一堆检查，最后直接报 ...]]></description>
      <category>Postgre SQL</category>
      <author>ZhangQi</author>
      <pubDate>Fri, 22 May 2026 09:45:53 +0000</pubDate>
    </item>
    <item>
      <title>PostgreSQL DBA 巡检必备：68 个常用 SQL 脚本</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33448</link>
      <description><![CDATA[前言
作为 PostgreSQL DBA，日常巡检是保障数据库稳定运行的核心工作之一。本文参考开源巡检脚本 pg_health_check.sh v1.0，将其内嵌的 68 个 SQL 语句按功能模块系统化整理，每个 SQL 均附带详细注释说明、输出字段解读及告警阈值建议。

全文共 16 个巡检模块，覆 ...]]></description>
      <category>Postgre SQL</category>
      <author>mahan</author>
      <pubDate>Sun, 17 May 2026 13:18:25 +0000</pubDate>
    </item>
    <item>
      <title>PostgreSQL 运行状态检查方法</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33367</link>
      <description><![CDATA[在PostgreSQL中，检查数据库运行状态通常分为操作系统层面（检查进程、服务和端口）和数据库层面（检查内部连接、运行时间及活动状态）。

以下是常用的检查命令和语句：

一、 操作系统层面 (OS Level)
在服务器终端（通常是Linux）上执行以下命令，无需登录数据 ...]]></description>
      <category>Postgre SQL</category>
      <author>mahan</author>
      <pubDate>Sun, 26 Apr 2026 10:46:03 +0000</pubDate>
    </item>
    <item>
      <title>PG物理复制：主库归档失败，报错找不到路径</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33198</link>
      <description><![CDATA[1. 现象描述

在搭建 PostgreSQL 15 物理备库环境后，主备流复制虽然显示已连接，但主、备库日志中持续出现报错：

主库 (Primary) 日志：
LOG: archive command failed with exit code 1
DETAIL: The failed archive command was: cp pg_wal/000000010... /pg18/ ...]]></description>
      <category>Postgre SQL</category>
      <author>ZhangQi</author>
      <pubDate>Sun, 05 Apr 2026 03:18:41 +0000</pubDate>
    </item>
    <item>
      <title>pg数据库查询当前连接ip及相关连接数</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33281</link>
      <description><![CDATA[在 PostgreSQL 中，您可以通过查询系统内部的运行状态视图 pg_stat_activity 来查看当前所有连接的用户、IP 地址以及它们的运行状态。

这是最常用的标准查询语句：


SELECT
    datname AS database_name,
    usename AS user_name,
    client_addr AS clie ...]]></description>
      <category>Postgre SQL</category>
      <author>mahan</author>
      <pubDate>Sun, 29 Mar 2026 13:03:54 +0000</pubDate>
    </item>
    <item>
      <title>为什么 RPM 安装的 PostgreSQL 可能缺少 devel 包</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33194</link>
      <description><![CDATA[现象回顾

在尝试编译 oracle_fdw 插件时，即便设置了 PATH，执行 make 依然报错：

&gt; `Makefile:30: /usr/pgsql-14/lib/pgxs/src/makefiles/pgxs.mk: 没有那个文件或目录



原因：RPM 安装缺少了该包

这正是 RPM（以及 DEB）包管理器的“按需分配”设计导 ...]]></description>
      <category>Postgre SQL</category>
      <author>ZhangQi</author>
      <pubDate>Sun, 29 Mar 2026 03:06:13 +0000</pubDate>
    </item>
    <item>
      <title>解决 oracle_fdw 报错：OCIEnvCreate failed to create environment handle</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33195</link>
      <description><![CDATA[1. 问题描述

在 PostgreSQL 中配置好 oracle_fdw 后，执行查询（如 SELECT * FROM foreign_table）时弹出以下错误：

ERROR: error connecting to Oracle: OCIEnvCreate failed to create environment handle



（oracle客户端已经配置好，oracle_fdw也成功编 ...]]></description>
      <category>Postgre SQL</category>
      <author>ZhangQi</author>
      <pubDate>Sun, 29 Mar 2026 03:05:58 +0000</pubDate>
    </item>
    <item>
      <title>当 echo $PGHOME 为空时，精准定位 PostgreSQL 安装目录</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33193</link>
      <description><![CDATA[背景

在配置 PostgreSQL 环境变量或执行升级操作时，经常需要用到 $PGHOME（软件安装根目录）。但在很多通过 yum 或 apt 自动安装的环境中（非源码编译），系统并不会默认设置这个全局变量。

第一步：定位命令入口

首先，我们看看常用的 psql 命令在哪里：whic ...]]></description>
      <category>Postgre SQL</category>
      <author>ZhangQi</author>
      <pubDate>Sun, 29 Mar 2026 03:05:48 +0000</pubDate>
    </item>
    <item>
      <title>PG物理备库搭建实施方案</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33258</link>
      <description><![CDATA[1.环境介绍
本方案搭建pg数据库的物理备库方案
配置如下所示。


2.前期准备
前期准备工作主要包含两大核心环节：一是检查主库数据库配置文件，二是实现备库 PostgreSQL 数据库的安装部署及对应配置。

2.1主库参数检查
检查wal_level配置，如果不是replica就 ...]]></description>
      <category>Postgre SQL</category>
      <author>mahan</author>
      <pubDate>Sun, 22 Mar 2026 09:24:44 +0000</pubDate>
    </item>
    <item>
      <title>linux kill PG 后端进程 与 pg_ctl kill 对应关系</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33247</link>
      <description><![CDATA[在 PostgreSQL 里，pg_ctl kill 其实只是一个 信号发送工具，本质上就是帮你向 PostgreSQL 进程发送 Linux signal。
kill -15 对应的就是 SIGTERM。

而 pg_ctl kill 用的是 信号名称简写。

一、kill -15 对应的 pg_ctl 命令
Linux：

kill -15 
等价于：

 ...]]></description>
      <category>Postgre SQL</category>
      <author>mahan</author>
      <pubDate>Sun, 15 Mar 2026 12:34:23 +0000</pubDate>
    </item>
    <item>
      <title>PostgreSQL 数据库windows服务器搭建测试库实施文档</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33211</link>
      <description><![CDATA[1. 实施背景与目标
任务目标： 将生产环境下的 PostgreSQL 数据库（含全局角色、postgres 系统库及 zlregister 业务库）克隆并部署到全新的测试环境中。

源环境（正式库）： Windows Server 2016

目标环境（测试库）： Windows Server 2016

迁移方式： 逻辑备 ...]]></description>
      <category>Postgre SQL</category>
      <author>mahan</author>
      <pubDate>Sun, 08 Mar 2026 11:18:18 +0000</pubDate>
    </item>
    <item>
      <title>PG中 template0 与 template1区别</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33190</link>
      <description><![CDATA[1. 用途定位

2. 内容差异

3. 灵活性

4. 典型使用场景
使用 template0：

需要创建一个全新的、干净的数据库。
需要指定不同于默认的字符编码（如 SQL_ASCII）或区域设置（如 LC_COLLATE = \'C\'）。
不希望继承任何用户自定义的对象或配置。
使用 template ...]]></description>
      <category>Postgre SQL</category>
      <author>mahan</author>
      <pubDate>Sun, 01 Mar 2026 09:45:28 +0000</pubDate>
    </item>
    <item>
      <title>深入浅出 Shared Buffers</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33188</link>
      <description><![CDATA[因为 PostgreSQL 不是线程模型 (截止 PG18，关于多线程的讨论也一直在进行中)，所以高度依赖共享内存来共享状态和数据，每个连接、每个后台任务都是独立 OS 进程，进程间靠共享内存通信，要理解 Shared Buffers ，必须先理解 PostgreSQL 为什么需要一块\&quot;所有进程都能看 ...]]></description>
      <category>Postgre SQL</category>
      <author>mahan</author>
      <pubDate>Sun, 01 Mar 2026 09:39:37 +0000</pubDate>
    </item>
    <item>
      <title>postgresql通信连接的方方面面</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33172</link>
      <description><![CDATA[一、会话保持
1.0通信方式的概念
Unix、UDP、TCP

Unix 套接字、UDP 套接字和 TCP 套接字是三种不同的套接字类型，它们的主要区别在于通信方式、使用场景以及协议栈的不同。让我们逐一了解它们的区别：
### 1. Unix 套接字 (Unix Domain Socket)
 类型：用于同一 ...]]></description>
      <category>Postgre SQL</category>
      <author>mahan</author>
      <pubDate>Sun, 08 Feb 2026 12:00:21 +0000</pubDate>
    </item>
    <item>
      <title>pg数据库如何开启大页内存</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33154</link>
      <description><![CDATA[第一部分：开启大页内存 (Huge Pages)
Linux 默认内存页大小是 4KB。对于几十 GB 的内存，管理这些小页表会消耗大量 CPU。开启 2MB 的大页可以降低开销。

1. 确认当前的 shared_buffers 大小
首先你需要知道你的 PostgreSQL 配置了多少共享内存。在数据库中执行： ...]]></description>
      <category>Postgre SQL</category>
      <author>mahan</author>
      <pubDate>Sun, 01 Feb 2026 11:59:46 +0000</pubDate>
    </item>
    <item>
      <title>PostgreSQL SHARE UPDATE EXCLUSIVE 锁详解</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33153</link>
      <description><![CDATA[# PostgreSQL SHARE UPDATE EXCLUSIVE 锁详解

## 一、锁的基本概念与定位

在PostgreSQL的八级表锁体系中，`SHARE UPDATE EXCLUSIVE`（共享更新排他锁）处于中间偏上的强度层级，其锁模式数值通常被定义为4（按强度从低到高排序）。这种锁的设计初衷是为了平衡数据 ...]]></description>
      <category>Postgre SQL</category>
      <author>mahan</author>
      <pubDate>Sun, 01 Feb 2026 11:54:37 +0000</pubDate>
    </item>
    <item>
      <title>pg数据库哪些参数可以不需要重启数据库就修改</title>
      <link>http://bbs.cqsztech.com/forum.php?mod=viewthread&amp;tid=33152</link>
      <description><![CDATA[在 PostgreSQL (PG) 数据库中，参数能否在不重启的情况下修改，取决于该参数的 Context (上下文) 属性。

简单来说，除了 postmaster（需要重启）和 internal（编译时确定，不可改）这两种类型的参数外，绝大部分日常运维和调优参数都可以在不重启数据库的情况下修改 ...]]></description>
      <category>Postgre SQL</category>
      <author>mahan</author>
      <pubDate>Sun, 01 Feb 2026 11:52:24 +0000</pubDate>
    </item>
  </channel>
</rss>