VII. Internals

This part contains assorted information that might be of use to PostgreSQL developers.

Table of Contents
48. Overview of PostgreSQL Internals
48.1. The Path of a Query
48.2. How Connections are Established
48.3. The Parser Stage
48.4. The PostgreSQL Rule System
48.5. Planner/Optimizer
48.6. Executor
49. Overview of Postgres-XL Internals
49.1. Postgres-XL Components
49.2. GTM and Global Transaction Management
50. System Catalogs
50.1. Overview
50.2. pg_aggregate
50.3. pg_am
50.4. pg_amop
50.5. pg_amproc
50.6. pg_attrdef
50.7. pg_attribute
50.8. pg_authid
50.9. pg_auth_members
50.10. pg_cast
50.11. pg_class
50.12. pg_collation
50.13. pg_constraint
50.14. pg_conversion
50.15. pg_database
50.16. pg_db_role_setting
50.17. pg_default_acl
50.18. pg_depend
50.19. pg_description
50.20. pg_enum
50.21. pg_event_trigger
50.22. pg_extension
50.23. pg_foreign_data_wrapper
50.24. pg_foreign_server
50.25. pg_foreign_table
50.26. pg_index
50.27. pg_inherits
50.28. pg_language
50.29. pg_largeobject
50.30. pg_largeobject_metadata
50.31. pg_namespace
50.32. pg_opclass
50.33. pg_operator
50.34. pg_opfamily
50.35. pg_pltemplate
50.36. pg_policy
50.37. pg_proc
50.38. pg_range
50.39. pg_replication_origin
50.40. pg_rewrite
50.41. pg_seclabel
50.42. pg_shdepend
50.43. pg_shdescription
50.44. pg_shseclabel
50.45. pg_statistic
50.46. pg_tablespace
50.47. pg_transform
50.48. pg_trigger
50.49. pg_ts_config
50.50. pg_ts_config_map
50.51. pg_ts_dict
50.52. pg_ts_parser
50.53. pg_ts_template
50.54. pg_type
50.55. pg_user_mapping
50.56. pgxc_class
50.57. pgxc_node
50.58. pgxc_group
50.59. System Views
50.60. pg_available_extensions
50.61. pg_available_extension_versions
50.62. pg_cursors
50.63. pg_file_settings
50.64. pg_group
50.65. pg_indexes
50.66. pg_locks
50.67. pg_matviews
50.68. pg_policies
50.69. pg_prepared_statements
50.70. pg_prepared_xacts
50.71. pg_replication_origin_status
50.72. pg_replication_slots
50.73. pg_roles
50.74. pg_rules
50.75. pg_seclabels
50.76. pg_settings
50.77. pg_shadow
50.78. pg_stats
50.79. pg_tables
50.80. pg_timezone_abbrevs
50.81. pg_timezone_names
50.82. pg_user
50.83. pg_user_mappings
50.84. pg_views
51. Frontend/Backend Protocol
51.1. Overview
51.2. Message Flow
51.3. Streaming Replication Protocol
51.4. Message Data Types
51.5. Message Formats
51.6. Error and Notice Message Fields
51.7. Summary of Changes since Protocol 2.0
52. PostgreSQL Coding Conventions
52.1. Formatting
52.2. Reporting Errors Within the Server
52.3. Error Message Style Guide
53. Native Language Support
53.1. For the Translator
53.2. For the Programmer
54. Writing A Procedural Language Handler
55. Writing A Foreign Data Wrapper
55.1. Foreign Data Wrapper Functions
55.2. Foreign Data Wrapper Callback Routines
55.3. Foreign Data Wrapper Helper Functions
55.4. Foreign Data Wrapper Query Planning
55.5. Row Locking in Foreign Data Wrappers
56. Writing A Table Sampling Method
56.1. Sampling Method Support Functions
57. Writing A Custom Scan Provider
57.1. Creating Custom Scan Paths
57.2. Creating Custom Scan Plans
57.3. Executing Custom Scans
58. Genetic Query Optimizer
58.1. Query Handling as a Complex Optimization Problem
58.2. Genetic Algorithms
58.3. Genetic Query Optimization (GEQO) in PostgreSQL
58.4. Further Reading
59. Index Access Method Interface Definition
59.1. Catalog Entries for Indexes
59.2. Index Access Method Functions
59.3. Index Scanning
59.4. Index Locking Considerations
59.5. Index Uniqueness Checks
59.6. Index Cost Estimation Functions
60. GiST Indexes
60.1. Introduction
60.2. Built-in Operator Classes
60.3. Extensibility
60.4. Implementation
60.5. Examples
61. SP-GiST Indexes
61.1. Introduction
61.2. Built-in Operator Classes
61.3. Extensibility
61.4. Implementation
61.5. Examples
62. GIN Indexes
62.1. Introduction
62.2. Built-in Operator Classes
62.3. Extensibility
62.4. Implementation
62.5. GIN Tips and Tricks
62.6. Limitations
62.7. Examples
63. BRIN Indexes
63.1. Introduction
63.2. Built-in Operator Classes
63.3. Extensibility
64. Database Physical Storage
64.1. Database File Layout
64.2. TOAST
64.3. Free Space Map
64.4. Visibility Map
64.5. The Initialization Fork
64.6. Database Page Layout
65. BKI Backend Interface
65.1. BKI File Format
65.2. BKI Commands
65.3. Structure of the Bootstrap BKI File
65.4. Example
66. How the Planner Uses Statistics
66.1. Row Estimation Examples
66.2. Planner Statistics and Security