☰
✕
PostgreSQL Documentation
语言
English
中文
版本
10.7
11.2
Preface
1. What is PostgreSQL?
2. A Brief History of PostgreSQL
2.1. The Berkeley POSTGRES Project
2.2. Postgres95
2.3. PostgreSQL
3. Conventions
4. Further Information
5. Bug Reporting Guidelines
5.1. Identifying Bugs
5.2. What to Report
5.3. Where to Report Bugs
I. Tutorial
1. Getting Started
1.1. Installation
1.2. Architectural Fundamentals
1.3. Creating a Database
1.4. Accessing a Database
2. The SQL Language
2.1. Introduction
2.2. Concepts
2.3. Creating a New Table
2.4. Populating a Table With Rows
2.5. Querying a Table
2.6. Joins Between Tables
2.7. Aggregate Functions
2.8. Updates
2.9. Deletions
3. Advanced Features
3.1. Introduction
3.2. Views
3.3. Foreign Keys
3.4. Transactions
3.5. Window Functions
3.6. Inheritance
3.7. Conclusion
II. The SQL Language
4. SQL Syntax
4.1. Lexical Structure
4.2. Value Expressions
4.3. Calling Functions
5. Data Definition
5.1. Table Basics
5.2. Default Values
5.3. Constraints
5.4. System Columns
5.5. Modifying Tables
5.6. Privileges
5.7. Row Security Policies
5.8. Schemas
5.9. Inheritance
5.10. Table Partitioning
5.11. Foreign Data
5.12. Other Database Objects
5.13. Dependency Tracking
6. Data Manipulation
6.1. Inserting Data
6.2. Updating Data
6.3. Deleting Data
6.4. Returning Data From Modified Rows
7. Queries
7.1. Overview
7.2. Table Expressions
7.3. Select Lists
7.4. Combining Queries
7.5. Sorting Rows
7.6. LIMIT and OFFSET
7.7. VALUES Lists
7.8. WITH Queries (Common Table Expressions)
8. Data Types
8.1. Numeric Types
8.2. Monetary Types
8.3. Character Types
8.4. Binary Data Types
8.5. Date/Time Types
8.6. Boolean Type
8.7. Enumerated Types
8.8. Geometric Types
8.9. Network Address Types
8.10. Bit String Types
8.11. Text Search Types
8.12. UUID Type
8.13. XML Type
8.14. JSON Types
8.15. Arrays
8.16. Composite Types
8.17. Range Types
8.18. Domain Types
8.19. Object Identifier Types
8.20. pg_lsn Type
8.21. Pseudo-Types
9. Functions and Operators
9.1. Logical Operators
9.2. Comparison Functions and Operators
9.3. Mathematical Functions and Operators
9.4. String Functions and Operators
9.5. Binary String Functions and Operators
9.6. Bit String Functions and Operators
9.7. Pattern Matching
9.8. Data Type Formatting Functions
9.9. Date/Time Functions and Operators
9.10. Enum Support Functions
9.11. Geometric Functions and Operators
9.12. Network Address Functions and Operators
9.13. Text Search Functions and Operators
9.14. XML Functions
9.15. JSON Functions and Operators
9.16. Sequence Manipulation Functions
9.17. Conditional Expressions
9.18. Array Functions and Operators
9.19. Range Functions and Operators
9.20. Aggregate Functions
9.21. Window Functions
9.22. Subquery Expressions
9.23. Row and Array Comparisons
9.24. Set Returning Functions
9.25. System Information Functions
9.26. System Administration Functions
9.27. Trigger Functions
9.28. Event Trigger Functions
10. Type Conversion
10.1. Overview
10.2. Operators
10.3. Functions
10.4. Value Storage
10.5. UNION, CASE, and Related Constructs
10.6. SELECT Output Columns
11. Indexes
11.1. Introduction
11.2. Index Types
11.3. Multicolumn Indexes
11.4. Indexes and ORDER BY
11.5. Combining Multiple Indexes
11.6. Unique Indexes
11.7. Indexes on Expressions
11.8. Partial Indexes
11.9. Index-Only Scans and Covering Indexes
11.10. Operator Classes and Operator Families
11.11. Indexes and Collations
11.12. Examining Index Usage
12. Full Text Search
12.1. Introduction
12.2. Tables and Indexes
12.3. Controlling Text Search
12.4. Additional Features
12.5. Parsers
12.6. Dictionaries
12.7. Configuration Example
12.8. Testing and Debugging Text Search
12.9. GIN and GiST Index Types
12.10. psql Support
12.11. Limitations
13. Concurrency Control
13.1. Introduction
13.2. Transaction Isolation
13.3. Explicit Locking
13.4. Data Consistency Checks at the Application Level
13.5. Caveats
13.6. Locking and Indexes
14. Performance Tips
14.1. Using EXPLAIN
14.2. Statistics Used by the Planner
14.3. Controlling the Planner with Explicit JOIN Clauses
14.4. Populating a Database
14.5. Non-Durable Settings
15. Parallel Query
15.1. How Parallel Query Works
15.2. When Can Parallel Query Be Used?
15.3. Parallel Plans
15.4. Parallel Safety
III. Server Administration
16. Installation from Source Code
16.1. Short Version
16.2. Requirements
16.3. Getting The Source
16.4. Installation Procedure
16.5. Post-Installation Setup
16.6. Supported Platforms
16.7. Platform-specific Notes
17. Installation from Source Code on Windows
17.1. Building with Visual C++ or the Microsoft Windows SDK
18. Server Setup and Operation
18.1. The PostgreSQL User Account
18.2. Creating a Database Cluster
18.3. Starting the Database Server
18.4. Managing Kernel Resources
18.5. Shutting Down the Server
18.6. Upgrading a PostgreSQL Cluster
18.7. Preventing Server Spoofing
18.8. Encryption Options
18.9. Secure TCP/IP Connections with SSL
18.10. Secure TCP/IP Connections with SSH Tunnels
18.11. Registering Event Log on Windows
19. Server Configuration
19.1. Setting Parameters
19.2. File Locations
19.3. Connections and Authentication
19.4. Resource Consumption
19.5. Write Ahead Log
19.6. Replication
19.7. Query Planning
19.8. Error Reporting and Logging
19.9. Run-time Statistics
19.10. Automatic Vacuuming
19.11. Client Connection Defaults
19.12. Lock Management
19.13. Version and Platform Compatibility
19.14. Error Handling
19.15. Preset Options
19.16. Customized Options
19.17. Developer Options
19.18. Short Options
20. Client Authentication
20.1. The pg_hba.conf File
20.2. User Name Maps
20.3. Authentication Methods
20.4. Trust Authentication
20.5. Password Authentication
20.6. GSSAPI Authentication
20.7. SSPI Authentication
20.8. Ident Authentication
20.9. Peer Authentication
20.10. LDAP Authentication
20.11. RADIUS Authentication
20.12. Certificate Authentication
20.13. PAM Authentication
20.14. BSD Authentication
20.15. Authentication Problems
21. Database Roles
21.1. Database Roles
21.2. Role Attributes
21.3. Role Membership
21.4. Dropping Roles
21.5. Default Roles
21.6. Function Security
22. Managing Databases
22.1. Overview
22.2. Creating a Database
22.3. Template Databases
22.4. Database Configuration
22.5. Destroying a Database
22.6. Tablespaces
23. Localization
23.1. Locale Support
23.2. Collation Support
23.3. Character Set Support
24. Routine Database Maintenance Tasks
24.1. Routine Vacuuming
24.2. Routine Reindexing
24.3. Log File Maintenance
25. Backup and Restore
25.1. SQL Dump
25.2. File System Level Backup
25.3. Continuous Archiving and Point-in-Time Recovery (PITR)
26. High Availability, Load Balancing, and Replication
26.1. Comparison of Different Solutions
26.2. Log-Shipping Standby Servers
26.3. Failover
26.4. Alternative Method for Log Shipping
26.5. Hot Standby
27. Recovery Configuration
27.1. Archive Recovery Settings
27.2. Recovery Target Settings
27.3. Standby Server Settings
28. Monitoring Database Activity
28.1. Standard Unix Tools
28.2. The Statistics Collector
28.3. Viewing Locks
28.4. Progress Reporting
28.5. Dynamic Tracing
29. Monitoring Disk Usage
29.1. Determining Disk Usage
29.2. Disk Full Failure
30. Reliability and the Write-Ahead Log
30.1. Reliability
30.2. Write-Ahead Logging (WAL)
30.3. Asynchronous Commit
30.4. WAL Configuration
30.5. WAL Internals
31. Logical Replication
31.1. Publication
31.2. Subscription
31.3. Conflicts
31.4. Restrictions
31.5. Architecture
31.6. Monitoring
31.7. Security
31.8. Configuration Settings
31.9. Quick Setup
32. Just-in-Time Compilation (JIT)
32.1. What is JIT compilation?
32.2. When to JIT?
32.3. Configuration
32.4. Extensibility
33. Regression Tests
33.1. Running the Tests
33.2. Test Evaluation
33.3. Variant Comparison Files
33.4. TAP Tests
33.5. Test Coverage Examination
IV. Client Interfaces
34. libpq - C Library
34.1. Database Connection Control Functions
34.2. Connection Status Functions
34.3. Command Execution Functions
34.4. Asynchronous Command Processing
34.5. Retrieving Query Results Row-By-Row
34.6. Canceling Queries in Progress
34.7. The Fast-Path Interface
34.8. Asynchronous Notification
34.9. Functions Associated with the COPY Command
34.10. Control Functions
34.11. Miscellaneous Functions
34.12. Notice Processing
34.13. Event System
34.14. Environment Variables
34.15. The Password File
34.16. The Connection Service File
34.17. LDAP Lookup of Connection Parameters
34.18. SSL Support
34.19. Behavior in Threaded Programs
34.20. Building libpq Programs
34.21. Example Programs
35. Large Objects
35.1. Introduction
35.2. Implementation Features
35.3. Client Interfaces
35.4. Server-side Functions
35.5. Example Program
36. ECPG - Embedded SQL in C
36.1. The Concept
36.2. Managing Database Connections
36.3. Running SQL Commands
36.4. Using Host Variables
36.5. Dynamic SQL
36.6. pgtypes Library
36.7. Using Descriptor Areas
36.8. Error Handling
36.9. Preprocessor Directives
36.10. Processing Embedded SQL Programs
36.11. Library Functions
36.12. Large Objects
36.13. C++ Applications
36.14. Embedded SQL Commands
36.15. Informix Compatibility Mode
36.16. Internals
37. The Information Schema
37.1. The Schema
37.2. Data Types
37.3. information_schema_catalog_name
37.4. administrable_role_authorizations
37.5. applicable_roles
37.6. attributes
37.7. character_sets
37.8. check_constraint_routine_usage
37.9. check_constraints
37.10. collations
37.11. collation_character_set_applicability
37.12. column_domain_usage
37.13. column_options
37.14. column_privileges
37.15. column_udt_usage
37.16. columns
37.17. constraint_column_usage
37.18. constraint_table_usage
37.19. data_type_privileges
37.20. domain_constraints
37.21. domain_udt_usage
37.22. domains
37.23. element_types
37.24. enabled_roles
37.25. foreign_data_wrapper_options
37.26. foreign_data_wrappers
37.27. foreign_server_options
37.28. foreign_servers
37.29. foreign_table_options
37.30. foreign_tables
37.31. key_column_usage
37.32. parameters
37.33. referential_constraints
37.34. role_column_grants
37.35. role_routine_grants
37.36. role_table_grants
37.37. role_udt_grants
37.38. role_usage_grants
37.39. routine_privileges
37.40. routines
37.41. schemata
37.42. sequences
37.43. sql_features
37.44. sql_implementation_info
37.45. sql_languages
37.46. sql_packages
37.47. sql_parts
37.48. sql_sizing
37.49. sql_sizing_profiles
37.50. table_constraints
37.51. table_privileges
37.52. tables
37.53. transforms
37.54. triggered_update_columns
37.55. triggers
37.56. udt_privileges
37.57. usage_privileges
37.58. user_defined_types
37.59. user_mapping_options
37.60. user_mappings
37.61. view_column_usage
37.62. view_routine_usage
37.63. view_table_usage
37.64. views
V. Server Programming
38. Extending SQL
38.1. How Extensibility Works
38.2. The PostgreSQL Type System
38.3. User-defined Functions
38.4. User-defined Procedures
38.5. Query Language (SQL) Functions
38.6. Function Overloading
38.7. Function Volatility Categories
38.8. Procedural Language Functions
38.9. Internal Functions
38.10. C-Language Functions
38.11. User-defined Aggregates
38.12. User-defined Types
38.13. User-defined Operators
38.14. Operator Optimization Information
38.15. Interfacing Extensions To Indexes
38.16. Packaging Related Objects into an Extension
38.17. Extension Building Infrastructure
39. Triggers
39.1. Overview of Trigger Behavior
39.2. Visibility of Data Changes
39.3. Writing Trigger Functions in C
39.4. A Complete Trigger Example
40. Event Triggers
40.1. Overview of Event Trigger Behavior
40.2. Event Trigger Firing Matrix
40.3. Writing Event Trigger Functions in C
40.4. A Complete Event Trigger Example
40.5. A Table Rewrite Event Trigger Example
41. The Rule System
41.1. The Query Tree
41.2. Views and the Rule System
41.3. Materialized Views
41.4. Rules on INSERT, UPDATE, and DELETE
41.5. Rules and Privileges
41.6. Rules and Command Status
41.7. Rules Versus Triggers
42. Procedural Languages
42.1. Installing Procedural Languages
43. PL/pgSQL - SQL Procedural Language
43.1. Overview
43.2. Structure of PL/pgSQL
43.3. Declarations
43.4. Expressions
43.5. Basic Statements
43.6. Control Structures
43.7. Cursors
43.8. Transaction Management
43.9. Errors and Messages
43.10. Trigger Functions
43.11. PL/pgSQL Under the Hood
43.12. Tips for Developing in PL/pgSQL
43.13. Porting from Oracle PL/SQL
44. PL/Tcl - Tcl Procedural Language
44.1. Overview
44.2. PL/Tcl Functions and Arguments
44.3. Data Values in PL/Tcl
44.4. Global Data in PL/Tcl
44.5. Database Access from PL/Tcl
44.6. Trigger Functions in PL/Tcl
44.7. Event Trigger Functions in PL/Tcl
44.8. Error Handling in PL/Tcl
44.9. Explicit Subtransactions in PL/Tcl
44.10. Transaction Management
44.11. PL/Tcl Configuration
44.12. Tcl Procedure Names
45. PL/Perl - Perl Procedural Language
45.1. PL/Perl Functions and Arguments
45.2. Data Values in PL/Perl
45.3. Built-in Functions
45.4. Global Values in PL/Perl
45.5. Trusted and Untrusted PL/Perl
45.6. PL/Perl Triggers
45.7. PL/Perl Event Triggers
45.8. PL/Perl Under the Hood
46. PL/Python - Python Procedural Language
46.1. Python 2 vs. Python 3
46.2. PL/Python Functions
46.3. Data Values
46.4. Sharing Data
46.5. Anonymous Code Blocks
46.6. Trigger Functions
46.7. Database Access
46.8. Explicit Subtransactions
46.9. Transaction Management
46.10. Utility Functions
46.11. Environment Variables
47. Server Programming Interface
47.1. Interface Functions
47.2. Interface Support Functions
47.3. Memory Management
47.4. Transaction Management
47.5. Visibility of Data Changes
47.6. Examples
48. Background Worker Processes
49. Logical Decoding
49.1. Logical Decoding Examples
49.2. Logical Decoding Concepts
49.3. Streaming Replication Protocol Interface
49.4. Logical Decoding SQL Interface
49.5. System Catalogs Related to Logical Decoding
49.6. Logical Decoding Output Plugins
49.7. Logical Decoding Output Writers
49.8. Synchronous Replication Support for Logical Decoding
50. Replication Progress Tracking
VI. Reference
I. SQL Commands
ABORT — abort the current transaction
ALTER AGGREGATE — change the definition of an aggregate function
ALTER COLLATION — change the definition of a collation
ALTER CONVERSION — change the definition of a conversion
ALTER DATABASE — change a database
ALTER DEFAULT PRIVILEGES — define default access privileges
ALTER DOMAIN — change the definition of a domain
ALTER EVENT TRIGGER — change the definition of an event trigger
ALTER EXTENSION — change the definition of an extension
ALTER FOREIGN DATA WRAPPER — change the definition of a foreign-data wrapper
ALTER FOREIGN TABLE — change the definition of a foreign table
ALTER FUNCTION — change the definition of a function
ALTER GROUP — change role name or membership
ALTER INDEX — change the definition of an index
ALTER LANGUAGE — change the definition of a procedural language
ALTER LARGE OBJECT — change the definition of a large object
ALTER MATERIALIZED VIEW — change the definition of a materialized view
ALTER OPERATOR — change the definition of an operator
ALTER OPERATOR CLASS — change the definition of an operator class
ALTER OPERATOR FAMILY — change the definition of an operator family
ALTER POLICY — change the definition of a row level security policy
ALTER PROCEDURE — change the definition of a procedure
ALTER PUBLICATION — change the definition of a publication
ALTER ROLE — change a database role
ALTER ROUTINE — change the definition of a routine
ALTER RULE — change the definition of a rule
ALTER SCHEMA — change the definition of a schema
ALTER SEQUENCE — change the definition of a sequence generator
ALTER SERVER — change the definition of a foreign server
ALTER STATISTICS — change the definition of an extended statistics object
ALTER SUBSCRIPTION — change the definition of a subscription
ALTER SYSTEM — change a server configuration parameter
ALTER TABLE — change the definition of a table
ALTER TABLESPACE — change the definition of a tablespace
ALTER TEXT SEARCH CONFIGURATION — change the definition of a text search configuration
ALTER TEXT SEARCH DICTIONARY — change the definition of a text search dictionary
ALTER TEXT SEARCH PARSER — change the definition of a text search parser
ALTER TEXT SEARCH TEMPLATE — change the definition of a text search template
ALTER TRIGGER — change the definition of a trigger
ALTER TYPE — change the definition of a type
ALTER USER — change a database role
ALTER USER MAPPING — change the definition of a user mapping
ALTER VIEW — change the definition of a view
ANALYZE — collect statistics about a database
BEGIN — start a transaction block
CALL — invoke a procedure
CHECKPOINT — force a write-ahead log checkpoint
CLOSE — close a cursor
CLUSTER — cluster a table according to an index
COMMENT — define or change the comment of an object
COMMIT — commit the current transaction
COMMIT PREPARED — commit a transaction that was earlier prepared for two-phase commit
COPY — copy data between a file and a table
CREATE ACCESS METHOD — define a new access method
CREATE AGGREGATE — define a new aggregate function
CREATE CAST — define a new cast
CREATE COLLATION — define a new collation
CREATE CONVERSION — define a new encoding conversion
CREATE DATABASE — create a new database
CREATE DOMAIN — define a new domain
CREATE EVENT TRIGGER — define a new event trigger
CREATE EXTENSION — install an extension
CREATE FOREIGN DATA WRAPPER — define a new foreign-data wrapper
CREATE FOREIGN TABLE — define a new foreign table
CREATE FUNCTION — define a new function
CREATE GROUP — define a new database role
CREATE INDEX — define a new index
CREATE LANGUAGE — define a new procedural language
CREATE MATERIALIZED VIEW — define a new materialized view
CREATE OPERATOR — define a new operator
CREATE OPERATOR CLASS — define a new operator class
CREATE OPERATOR FAMILY — define a new operator family
CREATE POLICY — define a new row level security policy for a table
CREATE PROCEDURE — define a new procedure
CREATE PUBLICATION — define a new publication
CREATE ROLE — define a new database role
CREATE RULE — define a new rewrite rule
CREATE SCHEMA — define a new schema
CREATE SEQUENCE — define a new sequence generator
CREATE SERVER — define a new foreign server
CREATE STATISTICS — define extended statistics
CREATE SUBSCRIPTION — define a new subscription
CREATE TABLE — define a new table
CREATE TABLE AS — define a new table from the results of a query
CREATE TABLESPACE — define a new tablespace
CREATE TEXT SEARCH CONFIGURATION — define a new text search configuration
CREATE TEXT SEARCH DICTIONARY — define a new text search dictionary
CREATE TEXT SEARCH PARSER — define a new text search parser
CREATE TEXT SEARCH TEMPLATE — define a new text search template
CREATE TRANSFORM — define a new transform
CREATE TRIGGER — define a new trigger
CREATE TYPE — define a new data type
CREATE USER — define a new database role
CREATE USER MAPPING — define a new mapping of a user to a foreign server
CREATE VIEW — define a new view
DEALLOCATE — deallocate a prepared statement
DECLARE — define a cursor
DELETE — delete rows of a table
DISCARD — discard session state
DO — execute an anonymous code block
DROP ACCESS METHOD — remove an access method
DROP AGGREGATE — remove an aggregate function
DROP CAST — remove a cast
DROP COLLATION — remove a collation
DROP CONVERSION — remove a conversion
DROP DATABASE — remove a database
DROP DOMAIN — remove a domain
DROP EVENT TRIGGER — remove an event trigger
DROP EXTENSION — remove an extension
DROP FOREIGN DATA WRAPPER — remove a foreign-data wrapper
DROP FOREIGN TABLE — remove a foreign table
DROP FUNCTION — remove a function
DROP GROUP — remove a database role
DROP INDEX — remove an index
DROP LANGUAGE — remove a procedural language
DROP MATERIALIZED VIEW — remove a materialized view
DROP OPERATOR — remove an operator
DROP OPERATOR CLASS — remove an operator class
DROP OPERATOR FAMILY — remove an operator family
DROP OWNED — remove database objects owned by a database role
DROP POLICY — remove a row level security policy from a table
DROP PROCEDURE — remove a procedure
DROP PUBLICATION — remove a publication
DROP ROLE — remove a database role
DROP ROUTINE — remove a routine
DROP RULE — remove a rewrite rule
DROP SCHEMA — remove a schema
DROP SEQUENCE — remove a sequence
DROP SERVER — remove a foreign server descriptor
DROP STATISTICS — remove extended statistics
DROP SUBSCRIPTION — remove a subscription
DROP TABLE — remove a table
DROP TABLESPACE — remove a tablespace
DROP TEXT SEARCH CONFIGURATION — remove a text search configuration
DROP TEXT SEARCH DICTIONARY — remove a text search dictionary
DROP TEXT SEARCH PARSER — remove a text search parser
DROP TEXT SEARCH TEMPLATE — remove a text search template
DROP TRANSFORM — remove a transform
DROP TRIGGER — remove a trigger
DROP TYPE — remove a data type
DROP USER — remove a database role
DROP USER MAPPING — remove a user mapping for a foreign server
DROP VIEW — remove a view
END — commit the current transaction
EXECUTE — execute a prepared statement
EXPLAIN — show the execution plan of a statement
FETCH — retrieve rows from a query using a cursor
GRANT — define access privileges
IMPORT FOREIGN SCHEMA — import table definitions from a foreign server
INSERT — create new rows in a table
LISTEN — listen for a notification
LOAD — load a shared library file
LOCK — lock a table
MOVE — position a cursor
NOTIFY — generate a notification
PREPARE — prepare a statement for execution
PREPARE TRANSACTION — prepare the current transaction for two-phase commit
REASSIGN OWNED — change the ownership of database objects owned by a database role
REFRESH MATERIALIZED VIEW — replace the contents of a materialized view
REINDEX — rebuild indexes
RELEASE SAVEPOINT — destroy a previously defined savepoint
RESET — restore the value of a run-time parameter to the default value
REVOKE — remove access privileges
ROLLBACK — abort the current transaction
ROLLBACK PREPARED — cancel a transaction that was earlier prepared for two-phase commit
ROLLBACK TO SAVEPOINT — roll back to a savepoint
SAVEPOINT — define a new savepoint within the current transaction
SECURITY LABEL — define or change a security label applied to an object
SELECT — retrieve rows from a table or view
SELECT INTO — define a new table from the results of a query
SET — change a run-time parameter
SET CONSTRAINTS — set constraint check timing for the current transaction
SET ROLE — set the current user identifier of the current session
SET SESSION AUTHORIZATION — set the session user identifier and the current user identifier of the current session
SET TRANSACTION — set the characteristics of the current transaction
SHOW — show the value of a run-time parameter
START TRANSACTION — start a transaction block
TRUNCATE — empty a table or set of tables
UNLISTEN — stop listening for a notification
UPDATE — update rows of a table
VACUUM — garbage-collect and optionally analyze a database
VALUES — compute a set of rows
II. PostgreSQL Client Applications
clusterdb — cluster a PostgreSQL database
createdb — create a new PostgreSQL database
createuser — define a new PostgreSQL user account
dropdb — remove a PostgreSQL database
dropuser — remove a PostgreSQL user account
ecpg — embedded SQL C preprocessor
pg_basebackup — take a base backup of a PostgreSQL cluster
pgbench — run a benchmark test on PostgreSQL
pg_config — retrieve information about the installed version of PostgreSQL
pg_dump — extract a PostgreSQL database into a script file or other archive file
pg_dumpall — extract a PostgreSQL database cluster into a script file
pg_isready — check the connection status of a PostgreSQL server
pg_receivewal — stream write-ahead logs from a PostgreSQL server
pg_recvlogical — control PostgreSQL logical decoding streams
pg_restore — restore a PostgreSQL database from an archive file created by pg_dump
psql — PostgreSQL interactive terminal
reindexdb — reindex a PostgreSQL database
vacuumdb — garbage-collect and analyze a PostgreSQL database
III. PostgreSQL Server Applications
initdb — create a new PostgreSQL database cluster
pg_archivecleanup — clean up PostgreSQL WAL archive files
pg_controldata — display control information of a PostgreSQL database cluster
pg_ctl — initialize, start, stop, or control a PostgreSQL server
pg_resetwal — reset the write-ahead log and other control information of a PostgreSQL database cluster
pg_rewind — synchronize a PostgreSQL data directory with another data directory that was forked from it
pg_test_fsync — determine fastest wal_sync_method for PostgreSQL
pg_test_timing — measure timing overhead
pg_upgrade — upgrade a PostgreSQL server instance
pg_verify_checksums — verify data checksums in a PostgreSQL database cluster
pg_waldump — display a human-readable rendering of the write-ahead log of a PostgreSQL database cluster
postgres — PostgreSQL database server
postmaster — PostgreSQL database server
VII. Internals
51. Overview of PostgreSQL Internals
51.1. The Path of a Query
51.2. How Connections are Established
51.3. The Parser Stage
51.4. The PostgreSQL Rule System
51.5. Planner/Optimizer
51.6. Executor
52. System Catalogs
52.1. Overview
52.2. pg_aggregate
52.3. pg_am
52.4. pg_amop
52.5. pg_amproc
52.6. pg_attrdef
52.7. pg_attribute
52.8. pg_authid
52.9. pg_auth_members
52.10. pg_cast
52.11. pg_class
52.12. pg_collation
52.13. pg_constraint
52.14. pg_conversion
52.15. pg_database
52.16. pg_db_role_setting
52.17. pg_default_acl
52.18. pg_depend
52.19. pg_description
52.20. pg_enum
52.21. pg_event_trigger
52.22. pg_extension
52.23. pg_foreign_data_wrapper
52.24. pg_foreign_server
52.25. pg_foreign_table
52.26. pg_index
52.27. pg_inherits
52.28. pg_init_privs
52.29. pg_language
52.30. pg_largeobject
52.31. pg_largeobject_metadata
52.32. pg_namespace
52.33. pg_opclass
52.34. pg_operator
52.35. pg_opfamily
52.36. pg_partitioned_table
52.37. pg_pltemplate
52.38. pg_policy
52.39. pg_proc
52.40. pg_publication
52.41. pg_publication_rel
52.42. pg_range
52.43. pg_replication_origin
52.44. pg_rewrite
52.45. pg_seclabel
52.46. pg_sequence
52.47. pg_shdepend
52.48. pg_shdescription
52.49. pg_shseclabel
52.50. pg_statistic
52.51. pg_statistic_ext
52.52. pg_subscription
52.53. pg_subscription_rel
52.54. pg_tablespace
52.55. pg_transform
52.56. pg_trigger
52.57. pg_ts_config
52.58. pg_ts_config_map
52.59. pg_ts_dict
52.60. pg_ts_parser
52.61. pg_ts_template
52.62. pg_type
52.63. pg_user_mapping
52.64. System Views
52.65. pg_available_extensions
52.66. pg_available_extension_versions
52.67. pg_config
52.68. pg_cursors
52.69. pg_file_settings
52.70. pg_group
52.71. pg_hba_file_rules
52.72. pg_indexes
52.73. pg_locks
52.74. pg_matviews
52.75. pg_policies
52.76. pg_prepared_statements
52.77. pg_prepared_xacts
52.78. pg_publication_tables
52.79. pg_replication_origin_status
52.80. pg_replication_slots
52.81. pg_roles
52.82. pg_rules
52.83. pg_seclabels
52.84. pg_sequences
52.85. pg_settings
52.86. pg_shadow
52.87. pg_stats
52.88. pg_tables
52.89. pg_timezone_abbrevs
52.90. pg_timezone_names
52.91. pg_user
52.92. pg_user_mappings
52.93. pg_views
53. Frontend/Backend Protocol
53.1. Overview
53.2. Message Flow
53.3. SASL Authentication
53.4. Streaming Replication Protocol
53.5. Logical Streaming Replication Protocol
53.6. Message Data Types
53.7. Message Formats
53.8. Error and Notice Message Fields
53.9. Logical Replication Message Formats
53.10. Summary of Changes since Protocol 2.0
54. PostgreSQL Coding Conventions
54.1. Formatting
54.2. Reporting Errors Within the Server
54.3. Error Message Style Guide
54.4. Miscellaneous Coding Conventions
55. Native Language Support
55.1. For the Translator
55.2. For the Programmer
56. Writing A Procedural Language Handler
57. Writing A Foreign Data Wrapper
57.1. Foreign Data Wrapper Functions
57.2. Foreign Data Wrapper Callback Routines
57.3. Foreign Data Wrapper Helper Functions
57.4. Foreign Data Wrapper Query Planning
57.5. Row Locking in Foreign Data Wrappers
58. Writing A Table Sampling Method
58.1. Sampling Method Support Functions
59. Writing A Custom Scan Provider
59.1. Creating Custom Scan Paths
59.2. Creating Custom Scan Plans
59.3. Executing Custom Scans
60. Genetic Query Optimizer
60.1. Query Handling as a Complex Optimization Problem
60.2. Genetic Algorithms
60.3. Genetic Query Optimization (GEQO) in PostgreSQL
60.4. Further Reading
61. Index Access Method Interface Definition
61.1. Basic API Structure for Indexes
61.2. Index Access Method Functions
61.3. Index Scanning
61.4. Index Locking Considerations
61.5. Index Uniqueness Checks
61.6. Index Cost Estimation Functions
62. Generic WAL Records
63. B-Tree Indexes
63.1. Introduction
63.2. Behavior of B-Tree Operator Classes
63.3. B-Tree Support Functions
63.4. Implementation
64. GiST Indexes
64.1. Introduction
64.2. Built-in Operator Classes
64.3. Extensibility
64.4. Implementation
64.5. Examples
65. SP-GiST Indexes
65.1. Introduction
65.2. Built-in Operator Classes
65.3. Extensibility
65.4. Implementation
65.5. Examples
66. GIN Indexes
66.1. Introduction
66.2. Built-in Operator Classes
66.3. Extensibility
66.4. Implementation
66.5. GIN Tips and Tricks
66.6. Limitations
66.7. Examples
67. BRIN Indexes
67.1. Introduction
67.2. Built-in Operator Classes
67.3. Extensibility
68. Database Physical Storage
68.1. Database File Layout
68.2. TOAST
68.3. Free Space Map
68.4. Visibility Map
68.5. The Initialization Fork
68.6. Database Page Layout
69. System Catalog Declarations and Initial Contents
69.1. System Catalog Declaration Rules
69.2. System Catalog Initial Data
69.3. BKI File Format
69.4. BKI Commands
69.5. Structure of the Bootstrap BKI File
69.6. BKI Example
70. How the Planner Uses Statistics
70.1. Row Estimation Examples
70.2. Multivariate Statistics Examples
70.3. Planner Statistics and Security
VIII. Appendixes
A. PostgreSQL Error Codes
B. Date/Time Support
B.1. Date/Time Input Interpretation
B.2. Handling of Invalid or Ambiguous Timestamps
B.3. Date/Time Key Words
B.4. Date/Time Configuration Files
B.5. History of Units
C. SQL Key Words
D. SQL Conformance
D.1. Supported Features
D.2. Unsupported Features
D.3. XML Limits and Conformance to SQL/XML
E. Release Notes
E.1. Release 11.8
E.2. Release 11.7
E.3. Release 11.6
E.4. Release 11.5
E.5. Release 11.4
E.6. Release 11.3
E.7. Release 11.2
E.8. Release 11.1
E.9. Release 11
E.10. Prior Releases
F. Additional Supplied Modules
F.1. adminpack
F.2. amcheck
F.3. auth_delay
F.4. auto_explain
F.5. bloom
F.6. btree_gin
F.7. btree_gist
F.8. citext
F.9. cube
F.10. dblink
F.11. dict_int
F.12. dict_xsyn
F.13. earthdistance
F.14. file_fdw
F.15. fuzzystrmatch
F.16. hstore
F.17. intagg
F.18. intarray
F.19. isn
F.20. lo
F.21. ltree
F.22. pageinspect
F.23. passwordcheck
F.24. pg_buffercache
F.25. pgcrypto
F.26. pg_freespacemap
F.27. pg_prewarm
F.28. pgrowlocks
F.29. pg_stat_statements
F.30. pgstattuple
F.31. pg_trgm
F.32. pg_visibility
F.33. postgres_fdw
F.34. seg
F.35. sepgsql
F.36. spi
F.37. sslinfo
F.38. tablefunc
F.39. tcn
F.40. test_decoding
F.41. tsm_system_rows
F.42. tsm_system_time
F.43. unaccent
F.44. uuid-ossp
F.45. xml2
G. Additional Supplied Programs
G.1. Client Applications
G.2. Server Applications
H. External Projects
H.1. Client Interfaces
H.2. Administration Tools
H.3. Procedural Languages
H.4. Extensions
I. The Source Code Repository
I.1. Getting The Source via Git
J. Documentation
J.1. DocBook
J.2. Tool Sets
J.3. Building The Documentation
J.4. Documentation Authoring
J.5. Style Guide
K. Acronyms
Bibliography
Index
Chapter 67. BRIN Indexes
Table of Contents
67.1. Introduction
67.1.1. Index Maintenance
67.2. Built-in Operator Classes
67.3. Extensibility
上一章
首页
下一章
⌃