PgPedia 周报, 2023-08-27
提醒大家,即将发布的 PostgreSQL 16 的发布日期 已经公布
- PostgreSQL 16 的
rc1
版本定于 2023-08-31 ( 待处理事项截止时间 为 2023-08-26 12:00 UTC) - 2023-09-14 为公开发布 (GA)(暂定)
rc1
版本已通过提交 (commit d94dadcc) 但在撰写本文时尚未打上标签。
PostgreSQL 16 文章
- Postgres v16:14 个很酷的新功能 (Laurenze Albe / CyberTec)
PostgreSQL 17 的新特性
带名称的 NOT NULL 约束
提交列表中一个有趣的新增内容是 b0e96f31 " Catalog not-null constraints
",经过漫长的开发过程和几次试错,现在增加了带名称的 NOT NULL
约束。实际上,这意味着在 PostgreSQL 16 及更早版本中,像这样定义的表
postgres=# CREATE TABLE foo (id INT NOT NULL); CREATE TABLE postgres=# \d+ foo Table "public.foo" Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description --------+---------+-----------+----------+---------+---------+-------------+--------------+------------- id | integer | | not null | | plain | | | Access method: heap
在 PostgreSQL 17 中将变为
postgres=# CREATE TABLE foo (id INT NOT NULL); CREATE TABLE postgres=# \d+ foo Table "public.foo" Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description --------+---------+-----------+----------+---------+---------+-------------+--------------+------------- id | integer | | not null | | plain | | | Not-null constraints: "foo_id_not_null" NOT NULL "id" Access method: heap
NOT NULL
约束也可以显式定义
postgres=# CREATE TABLE foo ( id INT, CONSTRAINT foo_id_is_not_null NOT NULL id ); CREATE TABLE postgres=# \d+ foo Table "public.foo" Column | Type | Collation | Nullable | Default | Storage | Compression | Stats target | Description --------+---------+-----------+----------+---------+---------+-------------+--------------+------------- id | integer | | not null | | plain | | | Not-null constraints: "foo_id_is_not_null" NOT NULL "id" Access method: heap
PostgreSQL 提交的值得关注的变更
- bb45156f (2023-08-27):在 pg_stat_statements 中显示 DEALLOCATE 的名称作为常量
- e48b19c5 (2023-08-26):在 log_connections 下为 "trust" 连接
生成新的 LOG
- b0e96f31 (2023-08-25):
Catalog not-null constraints
- 252dcb32 (2023-08-24):
在测试中使用 "template" 数据目录
- b575a26c (2023-08-24):
为多参数聚合函数添加 proargnames
- 260a1f18 (2023-08-23):
添加 to_bin() 和 to_oct()。
- f4b54e1e (2023-08-22):
引入协议字符宏。
- 6fde2d9a (2023-08-21):
修复共享关系 pg_stat_reset_single_table_counters()
请注意,提交按其在提交日志中的出现顺序显示,这可能不反映单个提交的创建日期。
请参阅 PostgreSQL GIT 提交日志 查看完整的提交列表。
新 PgPedia 条目
已添加以下新条目
add_missing_from
json_array_elements()
jsonb_array_elements()
json_array_elements_text()
jsonb_array_elements_text()
json_array_length()
jsonb_array_length()
json_build_array()
jsonb_build_array()
json_build_object()
jsonb_build_object()
json_object()
jsonb_object()
row_to_json()
to_bin()
to_json()
to_jsonb()
to_oct()
更新
以下文章已更新,增加了额外信息或更正
CREATE RULE
- 提到了在
PostgreSQL 8.0
中添加了ALSO
关键字
- 提到了在
PostgreSQL 8.2
- 提到了添加了
LDAP
支持
- 提到了添加了
外部链接
已添加了指向外部文章的链接
pg_backend_memory_contexts
- pg_backend_memory_contexts - 2023 年 2 月,Taraka Vuyyuru / OpenSource DB 的博客文章
最后...
如果有什么遗漏,或者您有什么(建设性的)想法,请留下一些 反馈 和/或 请我喝杯咖啡。
发表评论