PostgreSQL 10.0 preview 变化 - pg_xlog,pg_clog,pg_log目录更名为pg_wal,pg_xact,log

简介:

标签

PostgreSQL , 10.0 , pg_xact , pg_wal , log , pg_clog , pg_xlog , pg_log


背景

10.0 把几个有一定“歧义”的目录更名了。它们分别为

pg_xlog, pg_clog, pg_log

更名为

pg_wal, pg_xact, log

分别对应WAL(write ahead log)日志,事务状态日志,日志。

省得有人误删其中的LOG目录中的文件。(还真有发生过)。

坏处是,如果有对应的程序用到了这几个目录名的,需要修改一下。

对应patch

Rename "pg_xlog" directory to "pg_wal".  
  
author	Robert Haas <rhaas@postgresql.org>	  
Thu, 20 Oct 2016 23:24:37 +0800 (11:24 -0400)  
committer	Robert Haas <rhaas@postgresql.org>	  
Thu, 20 Oct 2016 23:32:18 +0800 (11:32 -0400)  
"xlog" is not a particularly clear abbreviation for "write-ahead log",  
and it sometimes confuses users into believe that the contents of the  
"pg_xlog" directory are not critical data, leading to unpleasant  
consequences.  So, rename the directory to "pg_wal".  
  
This patch modifies pg_upgrade and pg_basebackup to understand both  
the old and new directory layouts; the former is necessary given the  
purpose of the tool, while the latter merely avoids an unnecessary  
backward-compatibility break.  
  
We may wish to consider renaming other programs, switches, and  
functions which still use the old "xlog" naming to also refer to  
"wal".  However, that's still under discussion, so let's do just this  
much for now.  
  
Discussion: CAB7nPqTeC-8+zux8_-4ZD46V7YPwooeFxgndfsq5Rg8ibLVm1A@mail.gmail.com  
  
Michael Paquier  
Rename "pg_clog" directory to "pg_xact".  
  
author	Robert Haas <rhaas@postgresql.org>	  
Fri, 17 Mar 2017 21:46:58 +0800 (09:46 -0400)  
committer	Robert Haas <rhaas@postgresql.org>	  
Fri, 17 Mar 2017 21:48:38 +0800 (09:48 -0400)  
Names containing the letters "log" sometimes confuse users into  
believing that only non-critical data is present.  It is hoped  
this renaming will discourage ill-considered removals of transaction  
status data.  
  
Michael Paquier  
  
Discussion: http://postgr.es/m/CA+Tgmoa9xFQyjRZupbdEFuwUerFTvC6HjZq1ud6GYragGDFFgA@mail.gmail.com  
Change default of log_directory to 'log'  
  
author	Peter Eisentraut <peter_e@gmx.net>	  
Mon, 27 Mar 2017 22:34:33 +0800 (10:34 -0400)  
committer	Peter Eisentraut <peter_e@gmx.net>	  
Mon, 27 Mar 2017 22:34:33 +0800 (10:34 -0400)  
The previous default 'pg_log' might have indicated by its "pg_" prefix  
that it is an internal system directory.  The new default is more in  
line with the typical naming of directories with user-facing log files.  
Together with the renaming of pg_clog and pg_xlog, this should clear up  
that difference.  
  
Author: Andreas Karlsson <andreas@proxel.se>  

这个patch的讨论,详见邮件组,本文末尾URL。

PostgreSQL社区的作风非常严谨,一个patch可能在邮件组中讨论几个月甚至几年,根据大家的意见反复的修正,patch合并到master已经非常成熟,所以PostgreSQL的稳定性也是远近闻名的。

参考

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=f82ec32ac30ae7e3ec7c84067192535b2ff8ec0e

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=88e66d193fbaf756b3cc9bf94cad116aacbb355b

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=3371e4d9b12455fe1f8d1516d0bd915aab86be17

相关实践学习
使用PolarDB和ECS搭建门户网站
本场景主要介绍如何基于PolarDB和ECS实现搭建门户网站。
阿里云数据库产品家族及特性
阿里云智能数据库产品团队一直致力于不断健全产品体系,提升产品性能,打磨产品功能,从而帮助客户实现更加极致的弹性能力、具备更强的扩展能力、并利用云设施进一步降低企业成本。以云原生+分布式为核心技术抓手,打造以自研的在线事务型(OLTP)数据库Polar DB和在线分析型(OLAP)数据库Analytic DB为代表的新一代企业级云原生数据库产品体系, 结合NoSQL数据库、数据库生态工具、云原生智能化数据库管控平台,为阿里巴巴经济体以及各个行业的企业客户和开发者提供从公共云到混合云再到私有云的完整解决方案,提供基于云基础设施进行数据从处理、到存储、再到计算与分析的一体化解决方案。本节课带你了解阿里云数据库产品家族及特性。
目录
相关文章
|
存储 关系型数据库 数据库
【赵渝强老师】PostgreSQL的服务器日志文件
本文介绍了PostgreSQL数据库的物理存储结构,重点讨论了服务器日志文件。通过`pg_ctl`命令启动PostgreSQL实例时,使用`-l`参数指定日志文件位置,记录数据库启动、运行及关闭过程中的关键信息。附有相关视频讲解和日志文件示例。
321 0
|
存储 Oracle 关系型数据库
postgresql数据库|wal日志的开启以及如何管理
postgresql数据库|wal日志的开启以及如何管理
2231 0
|
Dubbo Java 应用服务中间件
Dubbo日志文件输出到指定目录 如何定义?
Dubbo日志文件输出到指定目录 如何定义?
|
存储 关系型数据库 数据库
【赵渝强老师】PostgreSQL的WAL预写日志文件
PostgreSQL数据库的物理存储结构包含多种文件,其中WAL(预写日志)用于确保数据完整性和高效恢复。WAL机制允许在不频繁刷新数据至磁盘的情况下,通过先写日志再改数据的方式,减少I/O操作,提高性能。每个WAL文件默认大小为16MB,位于pg_wal目录下,支持手动和自动切换。WAL不仅有助于数据恢复,还能显著降低I/O成本。
362 4
|
存储 SQL 关系型数据库
【赵渝强老师】PostgreSQL的运行日志文件
PostgreSQL的物理存储结构包括数据文件、日志文件等。运行日志默认未开启,需配置`postgresql.conf`文件中的相关参数如`log_destination`、`log_directory`等,以记录数据库状态、错误信息等。示例配置中启用了CSV格式日志,便于管理和分析。通过创建表操作,可查看生成的日志文件,了解具体日志内容。
370 3
|
Dubbo Java 应用服务中间件
Dubbo日志文件输出到指定目录 如何定义?
Dubbo日志文件输出到指定目录 如何定义?
|
Dubbo Java 应用服务中间件
Dubbo日志文件输出到指定目录 如何定义?
Dubbo日志文件输出到指定目录 如何定义?
|
消息中间件 存储 监控
Kafka的logs目录下的文件都是什么日志?
Kafka的logs目录下的文件都是什么日志?
971 11
|
存储 安全 Linux
在Linux中,日志文件通常存储在哪些目录?
在Linux中,日志文件通常存储在哪些目录?
|
Ubuntu Linux 测试技术
在Linux中,已知 apache 服务的访问日志按天记录在服务器本地目录/app/logs 下,由于磁盘空间紧张现在要求只能保留最近7天的访问日志,请问如何解决?
在Linux中,已知 apache 服务的访问日志按天记录在服务器本地目录/app/logs 下,由于磁盘空间紧张现在要求只能保留最近7天的访问日志,请问如何解决?

相关产品

  • 云原生数据库 PolarDB
  • 云数据库 RDS PostgreSQL 版
  • 推荐镜像

    更多