没有合适的资源?快使用搜索试试~ 我知道了~
首页PostgreSQL 9.2.1 官方文档详解
PostgreSQL 9.2.1 官方文档详解
5星 · 超过95%的资源 需积分: 10 54 下载量 135 浏览量
更新于2024-07-27
收藏 6.05MB PDF 举报
"postgresql-9.2-官方手册"
PostgreSQL 9.2.1 官方手册是针对该版本数据库系统的一份详尽文档,旨在提供API查询和全面的技术指导。这份手册由 PostgreSQL 全球开发团队编写并发布,涵盖了从基础概念到高级特性的所有内容,是开发者、管理员和技术爱好者了解和使用 PostgreSQL 9.2 的宝贵资源。
手册中包含的重要知识点:
1. **SQL语言**:PostgreSQL支持标准SQL,包括数据定义(DDL)、数据操作(DML)、数据查询(DQL)和数据控制(DCL)等语句。用户可以学习如何创建表、索引、视图,执行插入、更新、删除操作,以及编写复杂的查询和事务控制语句。
2. **数据类型**:PostgreSQL提供了丰富的数据类型,如数值类型(整数、浮点数、复数)、字符串类型、日期/时间类型、布尔类型、二进制类型以及自定义类型。理解这些类型及其用法对于正确存储和处理数据至关重要。
3. **函数与操作符**:手册详细介绍了内置函数和操作符,包括数学函数、字符串函数、日期/时间函数、聚合函数、窗口函数等,以及如何自定义函数和操作符。
4. **安全性与权限**:PostgreSQL 提供了精细的权限控制系统,包括角色、用户、权限、表级别的访问控制等,手册会解释如何设置和管理这些安全策略。
5. **并发与事务**:PostgreSQL 支持多版本并发控制(MVCC),确保在高并发环境下的数据一致性。手册会讲解事务的概念、隔离级别以及死锁处理。
6. **复制与高可用性**:9.2 版本中,PostgreSQL 提供了流复制功能,允许数据库实例之间的实时数据同步,有助于实现高可用性和灾难恢复。这部分内容会涵盖配置和管理复制的方法。
7. **性能优化**:手册将介绍索引的创建和管理、查询计划的分析、性能监控工具以及如何调整服务器参数以提高性能。
8. **备份与恢复**:详细说明如何进行数据库的完整备份、增量备份,以及如何在出现问题时恢复数据。
9. **扩展与模块**:PostgreSQL 允许安装和使用第三方扩展,如全文搜索、地理空间数据处理等,手册会讲解如何安装和使用这些扩展。
10. **服务器配置**:包括启动、停止和监控 PostgreSQL 服务器,以及配置文件的解读和修改。
11. **错误处理与诊断**:提供了错误代码和消息的参考,帮助用户识别和解决遇到的问题。
PostgreSQL 9.2.1 官方手册是一份全面的参考资料,不仅适合初学者入门,也适用于有经验的数据库管理员和开发者深入研究和解决问题。通过阅读这份手册,读者能够掌握 PostgreSQL 9.2 的核心特性和最佳实践,提升数据库管理和开发技能。
31.15. The Password File ..............................................................................................660
31.16. The Connection Service File ..............................................................................661
31.17. LDAP Lookup of Connection Parameters..........................................................661
31.18. SSL Support........................................................................................................662
31.18.1. Client Verification of Server Certificates ............................................... 663
31.18.2. Client Certificates...................................................................................663
31.18.3. Protection Provided in Different Modes ................................................664
31.18.4. SSL Client File Usage............................................................................665
31.18.5. SSL Library Initialization ......................................................................666
31.19. Behavior in Threaded Programs......................................................................... 666
31.20. Building libpq Programs.....................................................................................667
31.21. Example Programs.............................................................................................. 668
32. Large Objects ....................................................................................................................677
32.1. Introduction ..........................................................................................................677
32.2. Implementation Features ......................................................................................677
32.3. Client Interfaces.................................................................................................... 677
32.3.1. Creating a Large Object...........................................................................677
32.3.2. Importing a Large Object......................................................................... 678
32.3.3. Exporting a Large Object......................................................................... 678
32.3.4. Opening an Existing Large Object...........................................................679
32.3.5. Writing Data to a Large Object................................................................679
32.3.6. Reading Data from a Large Object ..........................................................679
32.3.7. Seeking in a Large Object........................................................................ 680
32.3.8. Obtaining the Seek Position of a Large Object........................................680
32.3.9. Truncating a Large Object ....................................................................... 680
32.3.10. Closing a Large Object Descriptor ........................................................680
32.3.11. Removing a Large Object ......................................................................680
32.4. Server-side Functions ...........................................................................................681
32.5. Example Program ................................................................................................. 681
33. ECPG - Embedded SQL in C............................................................................................687
33.1. The Concept.......................................................................................................... 687
33.2. Managing Database Connections .........................................................................687
33.2.1. Connecting to the Database Server..........................................................687
33.2.2. Choosing a Connection............................................................................688
33.2.3. Closing a Connection...............................................................................690
33.3. Running SQL Commands.....................................................................................690
33.3.1. Executing SQL Statements ......................................................................690
33.3.2. Using Cursors...........................................................................................691
33.3.3. Managing Transactions............................................................................691
33.3.4. Prepared Statements................................................................................. 692
33.4. Using Host Variables ............................................................................................693
33.4.1. Overview..................................................................................................693
33.4.2. Declare Sections.......................................................................................693
33.4.3. Retrieving Query Results.........................................................................694
33.4.4. Type Mapping ..........................................................................................695
33.4.4.1. Handling Character Strings ......................................................... 696
33.4.4.2. Accessing Special Data Types..................................................... 697
33.4.4.2.1. timestamp, date...............................................................697
33.4.4.2.2. interval ............................................................................ 697
33.4.4.2.3. numeric, decimal.............................................................698
33.4.4.3. Host Variables with Nonprimitive Types .................................... 699
33.4.4.3.1. Arrays .............................................................................699
xvi
33.4.4.3.2. Structures ........................................................................ 700
33.4.4.3.3. Typedefs..........................................................................702
33.4.4.3.4. Pointers ...........................................................................702
33.4.5. Handling Nonprimitive SQL Data Types.................................................702
33.4.5.1. Arrays.......................................................................................... 702
33.4.5.2. Composite Types .........................................................................704
33.4.5.3. User-defined Base Types .............................................................706
33.4.6. Indicators..................................................................................................707
33.5. Dynamic SQL....................................................................................................... 707
33.5.1. Executing Statements without a Result Set ............................................. 707
33.5.2. Executing a Statement with Input Parameters ......................................... 708
33.5.3. Executing a Statement with a Result Set ................................................. 708
33.6. pgtypes Library.....................................................................................................709
33.6.1. The numeric Type ....................................................................................709
33.6.2. The date Type...........................................................................................712
33.6.3. The timestamp Type.................................................................................715
33.6.4. The interval Type .....................................................................................719
33.6.5. The decimal Type.....................................................................................720
33.6.6. errno Values of pgtypeslib .......................................................................720
33.6.7. Special Constants of pgtypeslib...............................................................721
33.7. Using Descriptor Areas ........................................................................................721
33.7.1. Named SQL Descriptor Areas .................................................................722
33.7.2. SQLDA Descriptor Areas ........................................................................724
33.7.2.1. SQLDA Data Structure................................................................724
33.7.2.1.1. sqlda_t Structure ............................................................. 725
33.7.2.1.2. sqlvar_t Structure............................................................ 725
33.7.2.1.3. struct sqlname Structure .................................................726
33.7.2.2. Retrieving a Result Set Using an SQLDA ..................................727
33.7.2.3. Passing Query Parameters Using an SQLDA..............................728
33.7.2.4. A Sample Application Using SQLDA ........................................729
33.8. Error Handling...................................................................................................... 734
33.8.1. Setting Callbacks ..................................................................................... 735
33.8.2. sqlca ......................................................................................................... 736
33.8.3. SQLSTATE vs. SQLCODE........................................................................... 738
33.9. Preprocessor Directives ........................................................................................ 741
33.9.1. Including Files ......................................................................................... 741
33.9.2. The define and undef Directives .............................................................. 742
33.9.3. ifdef, ifndef, else, elif, and endif Directives.............................................743
33.10. Processing Embedded SQL Programs................................................................ 743
33.11. Library Functions ...............................................................................................744
33.12. Large Objects...................................................................................................... 745
33.13. C++ Applications ...............................................................................................747
33.13.1. Scope for Host Variables........................................................................747
33.13.2. C++ Application Development with External C Module ......................748
33.14. Embedded SQL Commands ...............................................................................750
ALLOCATE DESCRIPTOR ...............................................................................750
CONNECT...........................................................................................................752
DEALLOCATE DESCRIPTOR .......................................................................... 755
DECLARE ...........................................................................................................756
DESCRIBE ..........................................................................................................758
DISCONNECT ....................................................................................................759
EXECUTE IMMEDIATE.................................................................................... 761
xvii
GET DESCRIPTOR ............................................................................................ 762
OPEN ...................................................................................................................765
PREPARE ............................................................................................................767
SET AUTOCOMMIT .......................................................................................... 768
SET CONNECTION ........................................................................................... 769
SET DESCRIPTOR.............................................................................................770
TYPE....................................................................................................................772
VAR...................................................................................................................... 774
WHENEVER .......................................................................................................775
33.15. Informix Compatibility Mode ............................................................................777
33.15.1. Additional Types.................................................................................... 777
33.15.2. Additional/Missing Embedded SQL Statements ...................................777
33.15.3. Informix-compatible SQLDA Descriptor Areas.................................... 778
33.15.4. Additional Functions..............................................................................781
33.15.5. Additional Constants..............................................................................789
33.16. Internals .............................................................................................................. 790
34. The Information Schema...................................................................................................793
34.1. The Schema ..........................................................................................................793
34.2. Data Types ............................................................................................................793
34.3. information_schema_catalog_name ...........................................................794
34.4. administrable_role_authorizations.......................................................794
34.5. applicable_roles............................................................................................794
34.6. attributes.........................................................................................................795
34.7. character_sets................................................................................................799
34.8. check_constraint_routine_usage .............................................................800
34.9. check_constraints ......................................................................................... 800
34.10. collations.......................................................................................................801
34.11. collation_character_set_applicability ............................................801
34.12. column_domain_usage ...................................................................................802
34.13. column_options..............................................................................................802
34.14. column_privileges ....................................................................................... 803
34.15. column_udt_usage..........................................................................................803
34.16. columns .............................................................................................................804
34.17. constraint_column_usage .......................................................................... 809
34.18. constraint_table_usage............................................................................. 810
34.19. data_type_privileges................................................................................. 810
34.20. domain_constraints .....................................................................................811
34.21. domain_udt_usage..........................................................................................812
34.22. domains .............................................................................................................812
34.23. element_types ................................................................................................ 815
34.24. enabled_roles ................................................................................................ 818
34.25. foreign_data_wrapper_options................................................................819
34.26. foreign_data_wrappers............................................................................... 819
34.27. foreign_server_options............................................................................. 819
34.28. foreign_servers............................................................................................820
34.29. foreign_table_options............................................................................... 820
34.30. foreign_tables..............................................................................................821
34.31. key_column_usage..........................................................................................821
34.32. parameters.......................................................................................................822
34.33. referential_constraints .......................................................................... 825
34.34. role_column_grants .....................................................................................826
34.35. role_routine_grants ...................................................................................826
xviii
34.36. role_table_grants ....................................................................................... 827
34.37. role_udt_grants............................................................................................828
34.38. role_usage_grants ....................................................................................... 828
34.39. routine_privileges .....................................................................................829
34.40. routines...........................................................................................................830
34.41. schemata...........................................................................................................836
34.42. sequences.........................................................................................................836
34.43. sql_features ..................................................................................................837
34.44. sql_implementation_info .......................................................................... 838
34.45. sql_languages ................................................................................................ 839
34.46. sql_packages ..................................................................................................839
34.47. sql_parts.........................................................................................................840
34.48. sql_sizing.......................................................................................................840
34.49. sql_sizing_profiles ...................................................................................841
34.50. table_constraints ....................................................................................... 841
34.51. table_privileges..........................................................................................842
34.52. tables ...............................................................................................................843
34.53. triggered_update_columns ........................................................................ 844
34.54. triggers...........................................................................................................844
34.55. udt_privileges..............................................................................................846
34.56. usage_privileges..........................................................................................847
34.57. user_defined_types .....................................................................................847
34.58. user_mapping_options................................................................................. 849
34.59. user_mappings ................................................................................................ 850
34.60. view_column_usage ....................................................................................... 850
34.61. view_routine_usage .....................................................................................851
34.62. view_table_usage..........................................................................................851
34.63. views .................................................................................................................852
V. Server Programming ................................................................................................................. 854
35. Extending SQL..................................................................................................................856
35.1. How Extensibility Works......................................................................................856
35.2. The PostgreSQL Type System.............................................................................. 856
35.2.1. Base Types ...............................................................................................856
35.2.2. Composite Types......................................................................................856
35.2.3. Domains ...................................................................................................857
35.2.4. Pseudo-Types ...........................................................................................857
35.2.5. Polymorphic Types ..................................................................................857
35.3. User-defined Functions.........................................................................................858
35.4. Query Language (SQL) Functions .......................................................................858
35.4.1. Arguments for SQL Functions................................................................. 859
35.4.2. SQL Functions on Base Types................................................................. 860
35.4.3. SQL Functions on Composite Types .......................................................861
35.4.4. SQL Functions with Output Parameters ..................................................864
35.4.5. SQL Functions with Variable Numbers of Arguments............................ 865
35.4.6. SQL Functions with Default Values for Arguments................................ 866
35.4.7. SQL Functions as Table Sources .............................................................867
35.4.8. SQL Functions Returning Sets ................................................................868
35.4.9. SQL Functions Returning TABLE ............................................................869
35.4.10. Polymorphic SQL Functions .................................................................870
35.4.11. SQL Functions with Collations..............................................................871
35.5. Function Overloading........................................................................................... 872
xix
35.6. Function Volatility Categories.............................................................................. 873
35.7. Procedural Language Functions ...........................................................................874
35.8. Internal Functions................................................................................................. 874
35.9. C-Language Functions.......................................................................................... 875
35.9.1. Dynamic Loading.....................................................................................875
35.9.2. Base Types in C-Language Functions......................................................876
35.9.3. Version 0 Calling Conventions ................................................................879
35.9.4. Version 1 Calling Conventions ................................................................881
35.9.5. Writing Code............................................................................................884
35.9.6. Compiling and Linking Dynamically-loaded Functions..........................885
35.9.7. Composite-type Arguments .....................................................................887
35.9.8. Returning Rows (Composite Types) ........................................................ 888
35.9.9. Returning Sets..........................................................................................890
35.9.10. Polymorphic Arguments and Return Types........................................... 895
35.9.11. Transform Functions..............................................................................896
35.9.12. Shared Memory and LWLocks .............................................................. 897
35.9.13. Using C++ for Extensibility...................................................................897
35.10. User-defined Aggregates ....................................................................................898
35.11. User-defined Types .............................................................................................900
35.12. User-defined Operators.......................................................................................903
35.13. Operator Optimization Information....................................................................904
35.13.1. COMMUTATOR.......................................................................................... 904
35.13.2. NEGATOR ................................................................................................ 905
35.13.3. RESTRICT ..............................................................................................906
35.13.4. JOIN.......................................................................................................906
35.13.5. HASHES...................................................................................................907
35.13.6. MERGES...................................................................................................908
35.14. Interfacing Extensions To Indexes......................................................................908
35.14.1. Index Methods and Operator Classes ....................................................909
35.14.2. Index Method Strategies ........................................................................ 909
35.14.3. Index Method Support Routines ............................................................911
35.14.4. An Example ........................................................................................... 913
35.14.5. Operator Classes and Operator Families................................................916
35.14.6. System Dependencies on Operator Classes ...........................................918
35.14.7. Ordering Operators ................................................................................ 919
35.14.8. Special Features of Operator Classes.....................................................920
35.15. Packaging Related Objects into an Extension.................................................... 920
35.15.1. Extension Files....................................................................................... 921
35.15.2. Extension Relocatability ........................................................................923
35.15.3. Extension Configuration Tables............................................................. 924
35.15.4. Extension Updates ................................................................................. 924
35.15.5. Extension Example ................................................................................ 925
35.16. Extension Building Infrastructure ......................................................................926
36. Triggers ............................................................................................................................. 930
36.1. Overview of Trigger Behavior..............................................................................930
36.2. Visibility of Data Changes....................................................................................932
36.3. Writing Trigger Functions in C ............................................................................933
36.4. A Complete Trigger Example............................................................................... 935
37. The Rule System ...............................................................................................................939
37.1. The Query Tree.....................................................................................................939
37.2. Views and the Rule System ..................................................................................941
37.2.1. How SELECT Rules Work........................................................................ 941
xx
剩余2670页未读,继续阅读
2013-11-20 上传
1591 浏览量
点击了解资源详情
2012-12-18 上传
2009-06-09 上传
110 浏览量
848 浏览量
yfsky_2008
- 粉丝: 0
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- C语言数组操作:高度检查器编程实践
- 基于Swift开发的嘉定单车LBS iOS应用项目解析
- 钗头凤声乐表演的二度创作分析报告
- 分布式数据库特训营全套教程资料
- JavaScript开发者Robert Bindar的博客平台
- MATLAB投影寻踪代码教程及文件解压缩指南
- HTML5拖放实现的RPSLS游戏教程
- HT://Dig引擎接口,Ampoliros开源模块应用
- 全面探测服务器性能与PHP环境的iprober PHP探针v0.024
- 新版提醒应用v2:基于MongoDB的数据存储
- 《我的世界》东方大陆1.12.2材质包深度体验
- Hypercore Promisifier: JavaScript中的回调转换为Promise包装器
- 探索开源项目Artifice:Slyme脚本与技巧游戏
- Matlab机器人学习代码解析与笔记分享
- 查尔默斯大学计算物理作业HP2解析
- GitHub问题管理新工具:GIRA-crx插件介绍
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功