没有合适的资源?快使用搜索试试~ 我知道了~
postgresql-9.4API帮助
5星 · 超过95%的资源 需积分: 9 55 下载量 147 浏览量
2015-07-07
17:32:18
上传
评论
收藏 6.99MB PDF 举报
温馨提示
试读
3195页
postgresql9.4 帮助,希望能够帮助大家
资源推荐
资源详情
资源评论
PostgreSQL 9.4.4 Documentation
The PostgreSQL Global Development Group
PostgreSQL 9.4.4 Documentation
by The PostgreSQL Global Development Group
Copyright © 1996-2015 The PostgreSQL Global Development Group
Legal Notice
PostgreSQL is Copyright © 1996-2015 by the PostgreSQL Global Development Group.
Postgres95 is Copyright © 1994-5 by the Regents of the University of California.
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement
is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCI-
DENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IM-
PLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HERE-
UNDER IS ON AN “AS-IS” BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE,
SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
Table of Contents
Preface ................................................................................................................................................... lxix
1. What is PostgreSQL?................................................................................................................ lxix
2. A Brief History of PostgreSQL...................................................................................................lxx
2.1. The Berkeley POSTGRES Project .................................................................................lxx
2.2. Postgres95..................................................................................................................... lxxi
2.3. PostgreSQL................................................................................................................... lxxi
3. Conventions.............................................................................................................................. lxxii
4. Further Information.................................................................................................................. lxxii
5. Bug Reporting Guidelines........................................................................................................ lxxii
5.1. Identifying Bugs ......................................................................................................... lxxiii
5.2. What to Report ........................................................................................................... lxxiii
5.3. Where to Report Bugs ..................................................................................................lxxv
I. Tutorial....................................................................................................................................................1
1. Getting Started ...............................................................................................................................1
1.1. Installation .........................................................................................................................1
1.2. Architectural Fundamentals...............................................................................................1
1.3. Creating a Database...........................................................................................................2
1.4. Accessing a Database ........................................................................................................3
2. The SQL Language ........................................................................................................................6
2.1. Introduction .......................................................................................................................6
2.2. Concepts ............................................................................................................................6
2.3. Creating a New Table ........................................................................................................6
2.4. Populating a Table With Rows ..........................................................................................7
2.5. Querying a Table ...............................................................................................................8
2.6. Joins Between Tables.......................................................................................................10
2.7. Aggregate Functions........................................................................................................12
2.8. Updates............................................................................................................................14
2.9. Deletions..........................................................................................................................14
3. Advanced Features.......................................................................................................................16
3.1. Introduction .....................................................................................................................16
3.2. Views ...............................................................................................................................16
3.3. Foreign Keys....................................................................................................................16
3.4. Transactions.....................................................................................................................17
3.5. Window Functions...........................................................................................................19
3.6. Inheritance .......................................................................................................................22
3.7. Conclusion.......................................................................................................................24
II. The SQL Language.............................................................................................................................25
4. SQL Syntax..................................................................................................................................27
4.1. Lexical Structure..............................................................................................................27
4.1.1. Identifiers and Key Words...................................................................................27
4.1.2. Constants.............................................................................................................29
4.1.2.1. String Constants .....................................................................................29
4.1.2.2. String Constants with C-style Escapes...................................................29
4.1.2.3. String Constants with Unicode Escapes.................................................31
4.1.2.4. Dollar-quoted String Constants..............................................................32
iii
4.1.2.5. Bit-string Constants................................................................................33
4.1.2.6. Numeric Constants .................................................................................33
4.1.2.7. Constants of Other Types .......................................................................33
4.1.3. Operators.............................................................................................................34
4.1.4. Special Characters...............................................................................................35
4.1.5. Comments ...........................................................................................................35
4.1.6. Operator Precedence ...........................................................................................36
4.2. Value Expressions............................................................................................................37
4.2.1. Column References.............................................................................................38
4.2.2. Positional Parameters..........................................................................................38
4.2.3. Subscripts............................................................................................................38
4.2.4. Field Selection ....................................................................................................39
4.2.5. Operator Invocations...........................................................................................40
4.2.6. Function Calls.....................................................................................................40
4.2.7. Aggregate Expressions........................................................................................40
4.2.8. Window Function Calls.......................................................................................43
4.2.9. Type Casts...........................................................................................................45
4.2.10. Collation Expressions .......................................................................................45
4.2.11. Scalar Subqueries..............................................................................................46
4.2.12. Array Constructors............................................................................................47
4.2.13. Row Constructors..............................................................................................48
4.2.14. Expression Evaluation Rules ............................................................................50
4.3. Calling Functions.............................................................................................................51
4.3.1. Using Positional Notation...................................................................................52
4.3.2. Using Named Notation .......................................................................................52
4.3.3. Using Mixed Notation.........................................................................................53
5. Data Definition.............................................................................................................................54
5.1. Table Basics.....................................................................................................................54
5.2. Default Values .................................................................................................................55
5.3. Constraints.......................................................................................................................56
5.3.1. Check Constraints ...............................................................................................56
5.3.2. Not-Null Constraints...........................................................................................58
5.3.3. Unique Constraints..............................................................................................59
5.3.4. Primary Keys.......................................................................................................60
5.3.5. Foreign Keys.......................................................................................................61
5.3.6. Exclusion Constraints .........................................................................................64
5.4. System Columns..............................................................................................................64
5.5. Modifying Tables.............................................................................................................65
5.5.1. Adding a Column................................................................................................66
5.5.2. Removing a Column ...........................................................................................66
5.5.3. Adding a Constraint ............................................................................................67
5.5.4. Removing a Constraint .......................................................................................67
5.5.5. Changing a Column’s Default Value...................................................................67
5.5.6. Changing a Column’s Data Type ........................................................................68
5.5.7. Renaming a Column ...........................................................................................68
5.5.8. Renaming a Table ...............................................................................................68
5.6. Privileges .........................................................................................................................68
5.7. Schemas...........................................................................................................................69
iv
5.7.1. Creating a Schema ..............................................................................................70
5.7.2. The Public Schema .............................................................................................71
5.7.3. The Schema Search Path.....................................................................................71
5.7.4. Schemas and Privileges.......................................................................................72
5.7.5. The System Catalog Schema ..............................................................................73
5.7.6. Usage Patterns.....................................................................................................73
5.7.7. Portability............................................................................................................73
5.8. Inheritance .......................................................................................................................74
5.8.1. Caveats................................................................................................................77
5.9. Partitioning ......................................................................................................................77
5.9.1. Overview.............................................................................................................77
5.9.2. Implementing Partitioning ..................................................................................78
5.9.3. Managing Partitions............................................................................................81
5.9.4. Partitioning and Constraint Exclusion ................................................................82
5.9.5. Alternative Partitioning Methods........................................................................83
5.9.6. Caveats................................................................................................................84
5.10. Foreign Data ..................................................................................................................85
5.11. Other Database Objects .................................................................................................85
5.12. Dependency Tracking....................................................................................................86
6. Data Manipulation........................................................................................................................88
6.1. Inserting Data ..................................................................................................................88
6.2. Updating Data..................................................................................................................89
6.3. Deleting Data...................................................................................................................90
7. Queries .........................................................................................................................................91
7.1. Overview .........................................................................................................................91
7.2. Table Expressions ............................................................................................................91
7.2.1. The FROM Clause.................................................................................................92
7.2.1.1. Joined Tables ..........................................................................................92
7.2.1.2. Table and Column Aliases......................................................................96
7.2.1.3. Subqueries ..............................................................................................97
7.2.1.4. Table Functions ......................................................................................98
7.2.1.5. LATERAL Subqueries ..............................................................................99
7.2.2. The WHERE Clause.............................................................................................100
7.2.3. The GROUP BY and HAVING Clauses................................................................101
7.2.4. Window Function Processing ...........................................................................103
7.3. Select Lists.....................................................................................................................104
7.3.1. Select-List Items ...............................................................................................104
7.3.2. Column Labels..................................................................................................105
7.3.3. DISTINCT .........................................................................................................105
7.4. Combining Queries........................................................................................................106
7.5. Sorting Rows .................................................................................................................106
7.6. LIMIT and OFFSET........................................................................................................107
7.7. VALUES Lists .................................................................................................................108
7.8. WITH Queries (Common Table Expressions) ................................................................109
7.8.1. SELECT in WITH................................................................................................109
7.8.2. Data-Modifying Statements in WITH ................................................................113
8. Data Types..................................................................................................................................115
8.1. Numeric Types...............................................................................................................116
v
剩余3194页未读,继续阅读
资源评论
- csdk20002016-05-12嗯,高级手册,暂时用不上
公爵leung
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功