没有合适的资源?快使用搜索试试~ 我知道了~
首页PostgreSQL 12.8 官方文档详解
PostgreSQL 12.8 官方文档详解
需积分: 0 1 下载量 165 浏览量
更新于2024-07-09
收藏 12.47MB PDF 举报
"PostgreSQL 12.8官方文档提供了关于这个强大开源数据库系统的详细信息。这份文档由PostgreSQL全球开发团队编纂,涵盖了从基础知识到高级特性的全面内容,适用于开发者、管理员以及对PostgreSQL感兴趣的所有人。文档中包含了版权信息以及使用许可条款,允许用户自由使用、复制、修改和分发软件及其文档,但需保留版权声明。"
在PostgreSQL 12.8的文档中,你可以深入学习以下几个关键知识点:
1. **SQL语言**: PostgreSQL支持标准的SQL语言,包括数据定义(DDL)、数据操作(DML)、数据查询(DQL)和数据控制(DCL)等。这使得它能与其他SQL兼容的数据库系统进行互操作。
2. **数据类型**: PostgreSQL提供了丰富的数据类型,包括数值类型(如整数、浮点数)、字符串类型(如VARCHAR、TEXT)、日期/时间类型、二进制类型(BYTEA)以及自定义复合类型等。
3. **索引与查询优化**: 文档会详细介绍如何创建和使用索引来提高查询性能,包括B树、哈希、GiST、SP-GiST、GIN和BRIN等多种类型的索引。此外,还涵盖了查询计划器的工作原理和优化查询的方法。
4. **事务处理**: PostgreSQL支持ACID(原子性、一致性、隔离性和持久性)特性,确保了数据库操作的可靠性。文档中会详细讲解事务的概念、提交和回滚操作,以及不同的隔离级别。
5. **复制与高可用性**: PostgreSQL支持多种复制模式,如物理复制、逻辑复制,以及流复制和并行复制,这些功能可以帮助构建高可用性和灾难恢复策略。
6. **安全性与权限管理**: 文档将指导你设置用户权限、角色、访问控制列表(ACL)以及加密选项,以确保数据库的安全性。
7. **存储过程和函数**: PostgreSQL支持编写自定义的存储过程和函数,可以使用PL/pgSQL或其他语言(如C)来实现,增强了数据库的功能和灵活性。
8. **触发器和规则**: 通过触发器和规则,可以实现对数据修改的自动响应和复杂的业务逻辑。
9. **扩展性**: PostgreSQL允许安装和使用各种社区开发的扩展,如地理空间支持、全文搜索、JSON处理等,极大地扩展了其功能范围。
10. **备份与恢复**: 文档会详细介绍如何进行数据库的完整备份、增量备份、归档备份,以及如何执行恢复操作。
11. **监控与性能调优**: 学习如何使用内置的性能分析工具,如pg_stat_activity和pg_stat Statements,以及如何调整参数以优化数据库性能。
12. **并行计算**: PostgreSQL 12引入了并行查询功能,可以在多核CPU上同时执行查询的多个部分,显著提高了大型查询的执行速度。
PostgreSQL 12.8的官方文档是一份全面且深入的学习资源,无论你是初学者还是经验丰富的数据库专家,都能从中受益。通过仔细阅读和实践,你将能够更好地掌握这个强大的开源数据库管理系统。
PostgreSQL 12.8 Documentation
51.8. pg_authid ................................................................................... 2076
51.9. pg_auth_members ....................................................................... 2077
51.10. pg_cast ...................................................................................... 2077
51.11. pg_class .................................................................................... 2078
51.12. pg_collation ............................................................................ 2082
51.13. pg_constraint .......................................................................... 2083
51.14. pg_conversion .......................................................................... 2086
51.15. pg_database .............................................................................. 2086
51.16. pg_db_role_setting ................................................................ 2088
51.17. pg_default_acl ........................................................................ 2089
51.18. pg_depend .................................................................................. 2089
51.19. pg_description ........................................................................ 2091
51.20. pg_enum ...................................................................................... 2092
51.21. pg_event_trigger .................................................................... 2092
51.22. pg_extension ............................................................................ 2093
51.23. pg_foreign_data_wrapper ...................................................... 2094
51.24. pg_foreign_server .................................................................. 2094
51.25. pg_foreign_table .................................................................... 2095
51.26. pg_index .................................................................................... 2095
51.27. pg_inherits .............................................................................. 2098
51.28. pg_init_privs .......................................................................... 2099
51.29. pg_language .............................................................................. 2099
51.30. pg_largeobject ........................................................................ 2101
51.31. pg_largeobject_metadata ...................................................... 2101
51.32. pg_namespace ............................................................................ 2102
51.33. pg_opclass ................................................................................ 2102
51.34. pg_operator .............................................................................. 2103
51.35. pg_opfamily .............................................................................. 2103
51.36. pg_partitioned_table ............................................................ 2104
51.37. pg_pltemplate .......................................................................... 2105
51.38. pg_policy .................................................................................. 2106
51.39. pg_proc ...................................................................................... 2107
51.40. pg_publication ........................................................................ 2111
51.41. pg_publication_rel ................................................................ 2111
51.42. pg_range .................................................................................... 2112
51.43. pg_replication_origin .......................................................... 2112
51.44. pg_rewrite ................................................................................ 2113
51.45. pg_seclabel .............................................................................. 2113
51.46. pg_sequence .............................................................................. 2114
51.47. pg_shdepend .............................................................................. 2115
51.48. pg_shdescription .................................................................... 2116
51.49. pg_shseclabel .......................................................................... 2116
51.50. pg_statistic ............................................................................ 2117
51.51. pg_statistic_ext .................................................................... 2119
51.52. pg_statistic_ext_data .......................................................... 2120
51.53. pg_subscription ...................................................................... 2120
51.54. pg_subscription_rel .............................................................. 2121
51.55. pg_tablespace .......................................................................... 2122
51.56. pg_transform ............................................................................ 2122
51.57. pg_trigger ................................................................................ 2123
51.58. pg_ts_config ............................................................................ 2124
51.59. pg_ts_config_map .................................................................... 2125
51.60. pg_ts_dict ................................................................................ 2125
51.61. pg_ts_parser ............................................................................ 2126
51.62. pg_ts_template ........................................................................ 2126
51.63. pg_type ...................................................................................... 2127
51.64. pg_user_mapping ...................................................................... 2133
51.65. System Views ................................................................................ 2134
xvi
PostgreSQL 12.8 Documentation
51.66. pg_available_extensions ...................................................... 2135
51.67. pg_available_extension_versions ...................................... 2135
51.68. pg_config .................................................................................. 2136
51.69. pg_cursors ................................................................................ 2136
51.70. pg_file_settings .................................................................... 2137
51.71. pg_group .................................................................................... 2137
51.72. pg_hba_file_rules .................................................................. 2138
51.73. pg_indexes ................................................................................ 2138
51.74. pg_locks .................................................................................... 2139
51.75. pg_matviews .............................................................................. 2142
51.76. pg_policies .............................................................................. 2142
51.77. pg_prepared_statements ........................................................ 2143
51.78. pg_prepared_xacts .................................................................. 2144
51.79. pg_publication_tables .......................................................... 2144
51.80. pg_replication_origin_status ............................................ 2145
51.81. pg_replication_slots ............................................................ 2145
51.82. pg_roles .................................................................................... 2147
51.83. pg_rules .................................................................................... 2148
51.84. pg_seclabels ............................................................................ 2148
51.85. pg_sequences ............................................................................ 2149
51.86. pg_settings .............................................................................. 2150
51.87. pg_shadow .................................................................................. 2152
51.88. pg_stats .................................................................................... 2152
51.89. pg_stats_ext ............................................................................ 2155
51.90. pg_tables .................................................................................. 2157
51.91. pg_timezone_abbrevs .............................................................. 2157
51.92. pg_timezone_names .................................................................. 2158
51.93. pg_user ...................................................................................... 2158
51.94. pg_user_mappings .................................................................... 2159
51.95. pg_views .................................................................................... 2159
52. Frontend/Backend Protocol ........................................................................... 2160
52.1. Overview ........................................................................................ 2160
52.2. Message Flow .................................................................................. 2162
52.3. SASL Authentication ........................................................................ 2174
52.4. Streaming Replication Protocol ........................................................... 2176
52.5. Logical Streaming Replication Protocol ................................................ 2183
52.6. Message Data Types ......................................................................... 2183
52.7. Message Formats .............................................................................. 2184
52.8. Error and Notice Message Fields ......................................................... 2201
52.9. Logical Replication Message Formats .................................................. 2203
52.10. Summary of Changes since Protocol 2.0 ............................................. 2207
53. PostgreSQL Coding Conventions ................................................................... 2209
53.1. Formatting ....................................................................................... 2209
53.2. Reporting Errors Within the Server ...................................................... 2209
53.3. Error Message Style Guide ................................................................. 2213
53.4. Miscellaneous Coding Conventions ...................................................... 2217
54. Native Language Support ............................................................................. 2219
54.1. For the Translator ............................................................................. 2219
54.2. For the Programmer .......................................................................... 2221
55. Writing a Procedural Language Handler .......................................................... 2225
56. Writing a Foreign Data Wrapper .................................................................... 2228
56.1. Foreign Data Wrapper Functions ......................................................... 2228
56.2. Foreign Data Wrapper Callback Routines .............................................. 2228
56.3. Foreign Data Wrapper Helper Functions ............................................... 2242
56.4. Foreign Data Wrapper Query Planning ................................................. 2243
56.5. Row Locking in Foreign Data Wrappers ............................................... 2245
57. Writing a Table Sampling Method ................................................................. 2247
57.1. Sampling Method Support Functions .................................................... 2247
xvii
PostgreSQL 12.8 Documentation
58. Writing a Custom Scan Provider .................................................................... 2250
58.1. Creating Custom Scan Paths ............................................................... 2250
58.2. Creating Custom Scan Plans ............................................................... 2251
58.3. Executing Custom Scans .................................................................... 2252
59. Genetic Query Optimizer .............................................................................. 2255
59.1. Query Handling as a Complex Optimization Problem .............................. 2255
59.2. Genetic Algorithms ........................................................................... 2255
59.3. Genetic Query Optimization (GEQO) in PostgreSQL .............................. 2256
59.4. Further Reading ............................................................................... 2257
60. Table Access Method Interface Definition ....................................................... 2259
61. Index Access Method Interface Definition ....................................................... 2260
61.1. Basic API Structure for Indexes .......................................................... 2260
61.2. Index Access Method Functions .......................................................... 2262
61.3. Index Scanning ................................................................................ 2268
61.4. Index Locking Considerations ............................................................. 2269
61.5. Index Uniqueness Checks .................................................................. 2270
61.6. Index Cost Estimation Functions ......................................................... 2271
62. Generic WAL Records ................................................................................. 2275
63. B-Tree Indexes ........................................................................................... 2277
63.1. Introduction ..................................................................................... 2277
63.2. Behavior of B-Tree Operator Classes ................................................... 2277
63.3. B-Tree Support Functions .................................................................. 2278
63.4. Implementation ................................................................................ 2279
64. GiST Indexes ............................................................................................. 2280
64.1. Introduction ..................................................................................... 2280
64.2. Built-in Operator Classes ................................................................... 2280
64.3. Extensibility .................................................................................... 2281
64.4. Implementation ................................................................................ 2290
64.5. Examples ........................................................................................ 2290
65. SP-GiST Indexes ........................................................................................ 2292
65.1. Introduction ..................................................................................... 2292
65.2. Built-in Operator Classes ................................................................... 2292
65.3. Extensibility .................................................................................... 2293
65.4. Implementation ................................................................................ 2301
65.5. Examples ........................................................................................ 2302
66. GIN Indexes .............................................................................................. 2303
66.1. Introduction ..................................................................................... 2303
66.2. Built-in Operator Classes ................................................................... 2303
66.3. Extensibility .................................................................................... 2303
66.4. Implementation ................................................................................ 2306
66.5. GIN Tips and Tricks ......................................................................... 2308
66.6. Limitations ...................................................................................... 2308
66.7. Examples ........................................................................................ 2309
67. BRIN Indexes ............................................................................................ 2310
67.1. Introduction ..................................................................................... 2310
67.2. Built-in Operator Classes ................................................................... 2311
67.3. Extensibility .................................................................................... 2312
68. Hash Indexes .............................................................................................. 2315
68.1. Overview ........................................................................................ 2315
68.2. Implementation ................................................................................ 2316
69. Database Physical Storage ............................................................................ 2317
69.1. Database File Layout ........................................................................ 2317
69.2. TOAST ........................................................................................... 2319
69.3. Free Space Map ............................................................................... 2322
69.4. Visibility Map .................................................................................. 2322
69.5. The Initialization Fork ....................................................................... 2322
69.6. Database Page Layout ....................................................................... 2323
70. System Catalog Declarations and Initial Contents ............................................. 2327
xviii
PostgreSQL 12.8 Documentation
70.1. System Catalog Declaration Rules ....................................................... 2327
70.2. System Catalog Initial Data ................................................................ 2328
70.3. BKI File Format ............................................................................... 2333
70.4. BKI Commands ............................................................................... 2333
70.5. Structure of the Bootstrap BKI File ..................................................... 2334
70.6. BKI Example ................................................................................... 2335
71. How the Planner Uses Statistics .................................................................... 2336
71.1. Row Estimation Examples ................................................................. 2336
71.2. Multivariate Statistics Examples .......................................................... 2341
71.3. Planner Statistics and Security ............................................................ 2345
VIII. Appendixes ...................................................................................................... 2346
A. PostgreSQL Error Codes ............................................................................... 2352
B. Date/Time Support ....................................................................................... 2360
B.1. Date/Time Input Interpretation ............................................................. 2360
B.2. Handling of Invalid or Ambiguous Timestamps ....................................... 2361
B.3. Date/Time Key Words ........................................................................ 2362
B.4. Date/Time Configuration Files ............................................................. 2363
B.5. POSIX Time Zone Specifications ......................................................... 2364
B.6. History of Units ................................................................................ 2366
B.7. Julian Dates ...................................................................................... 2367
C. SQL Key Words .......................................................................................... 2369
D. SQL Conformance ....................................................................................... 2393
D.1. Supported Features ............................................................................ 2394
D.2. Unsupported Features ......................................................................... 2410
D.3. XML Limits and Conformance to SQL/XML ......................................... 2424
E. Release Notes .............................................................................................. 2428
E.1. Release 12.8 ..................................................................................... 2428
E.2. Release 12.7 ..................................................................................... 2433
E.3. Release 12.6 ..................................................................................... 2437
E.4. Release 12.5 ..................................................................................... 2443
E.5. Release 12.4 ..................................................................................... 2448
E.6. Release 12.3 ..................................................................................... 2453
E.7. Release 12.2 ..................................................................................... 2458
E.8. Release 12.1 ..................................................................................... 2464
E.9. Release 12 ........................................................................................ 2468
E.10. Prior Releases .................................................................................. 2490
F. Additional Supplied Modules .......................................................................... 2491
F.1. adminpack ........................................................................................ 2492
F.2. amcheck ........................................................................................... 2493
F.3. auth_delay ........................................................................................ 2496
F.4. auto_explain ...................................................................................... 2496
F.5. bloom .............................................................................................. 2499
F.6. btree_gin .......................................................................................... 2502
F.7. btree_gist .......................................................................................... 2503
F.8. citext ............................................................................................... 2504
F.9. cube ................................................................................................. 2506
F.10. dblink ............................................................................................. 2512
F.11. dict_int ........................................................................................... 2543
F.12. dict_xsyn ........................................................................................ 2544
F.13. earthdistance .................................................................................... 2545
F.14. file_fdw .......................................................................................... 2547
F.15. fuzzystrmatch .................................................................................. 2549
F.16. hstore ............................................................................................. 2552
F.17. intagg ............................................................................................. 2559
F.18. intarray ........................................................................................... 2560
F.19. isn ................................................................................................. 2562
F.20. lo ................................................................................................... 2566
F.21. ltree ............................................................................................... 2567
xix
PostgreSQL 12.8 Documentation
F.22. pageinspect ...................................................................................... 2574
F.23. passwordcheck ................................................................................. 2581
F.24. pg_buffercache ................................................................................. 2581
F.25. pgcrypto ......................................................................................... 2583
F.26. pg_freespacemap .............................................................................. 2594
F.27. pg_prewarm .................................................................................... 2595
F.28. pgrowlocks ...................................................................................... 2596
F.29. pg_stat_statements ............................................................................ 2598
F.30. pgstattuple ....................................................................................... 2604
F.31. pg_trgm .......................................................................................... 2608
F.32. pg_visibility .................................................................................... 2614
F.33. postgres_fdw ................................................................................... 2615
F.34. seg ................................................................................................. 2621
F.35. sepgsql ........................................................................................... 2624
F.36. spi ................................................................................................. 2632
F.37. sslinfo ............................................................................................ 2633
F.38. tablefunc ......................................................................................... 2635
F.39. tcn ................................................................................................. 2644
F.40. test_decoding ................................................................................... 2646
F.41. tsm_system_rows ............................................................................. 2646
F.42. tsm_system_time .............................................................................. 2647
F.43. unaccent ......................................................................................... 2647
F.44. uuid-ossp ........................................................................................ 2649
F.45. xml2 .............................................................................................. 2651
G. Additional Supplied Programs ........................................................................ 2656
G.1. Client Applications ............................................................................ 2656
G.2. Server Applications ............................................................................ 2663
H. External Projects .......................................................................................... 2668
H.1. Client Interfaces ................................................................................ 2668
H.2. Administration Tools .......................................................................... 2668
H.3. Procedural Languages ........................................................................ 2668
H.4. Extensions ........................................................................................ 2669
I. The Source Code Repository ........................................................................... 2670
I.1. Getting the Source via Git .................................................................... 2670
J. Documentation ............................................................................................. 2671
J.1. DocBook ........................................................................................... 2671
J.2. Tool Sets .......................................................................................... 2671
J.3. Building the Documentation ................................................................. 2673
J.4. Documentation Authoring .................................................................... 2675
J.5. Style Guide ....................................................................................... 2675
K. PostgreSQL Limits ....................................................................................... 2677
L. Acronyms ................................................................................................... 2678
M. Obsolete or Renamed Features ....................................................................... 2684
M.1. recovery.conf file merged into postgresql.conf ....................... 2684
M.2. pg_xlogdump renamed to pg_waldump ........................................... 2684
M.3. pg_resetxlog renamed to pg_resetwal ....................................... 2684
M.4. pg_receivexlog renamed to pg_receivewal ............................... 2684
Bibliography ............................................................................................................ 2685
Index ...................................................................................................................... 2687
xx
剩余2749页未读,继续阅读
138 浏览量
149 浏览量
110 浏览量
2013-03-16 上传
245 浏览量
121 浏览量
vike11
- 粉丝: 3
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 数据结构(c++版)
- Keil C51使用详解
- 3D论文-A Generic Framework for Efficient 2-D and 3-D Facial Expression Analogy
- 楼房销售论文.doc
- WebLogic Web Development
- The C Programming Language
- 一个RMI的分布式应用的实例
- 很好看的一个js的小日历
- Turbo C 屏幕函数
- ArcGIS9.3新特性
- CHD372中文资料
- C语言100例(精髓)
- 附录B Phase1-Phase2-Phase2+之间的差异
- ext中文手册(ext教程)
- 常用功能的测试方法-告诉你如何测试界面、功能、安装测试等
- 跟我一起写Makefile
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功