Part VII. Internals#

Part VII. Internals

Part VII. Internals

This part contains assorted information that might be of use to Tantor SE-1C developers.

Table of Contents

49. Overview of PostgreSQL Internals
49.1. The Path of a Query
49.2. How Connections Are Established
49.3. The Parser Stage
49.4. The Tantor SE-1C Rule System
49.5. Planner/Optimizer
49.6. Executor
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_init_privs
50.29. pg_language
50.30. pg_largeobject
50.31. pg_largeobject_metadata
50.32. pg_namespace
50.33. pg_opclass
50.34. pg_operator
50.35. pg_opfamily
50.36. pg_parameter_acl
50.37. pg_partitioned_table
50.38. pg_policy
50.39. pg_proc
50.40. pg_publication
50.41. pg_publication_namespace
50.42. pg_publication_rel
50.43. pg_range
50.44. pg_replication_origin
50.45. pg_rewrite
50.46. pg_seclabel
50.47. pg_sequence
50.48. pg_shdepend
50.49. pg_shdescription
50.50. pg_shseclabel
50.51. pg_statistic
50.52. pg_statistic_ext
50.53. pg_statistic_ext_data
50.54. pg_subscription
50.55. pg_subscription_rel
50.56. pg_tablespace
50.57. pg_transform
50.58. pg_trigger
50.59. pg_ts_config
50.60. pg_ts_config_map
50.61. pg_ts_dict
50.62. pg_ts_parser
50.63. pg_ts_template
50.64. pg_type
50.65. pg_user_mapping
51. System Views
51.1. Overview
51.2. pg_available_extensions
51.3. pg_available_extension_versions
51.4. pg_backend_memory_contexts
51.5. pg_config
51.6. pg_cursors
51.7. pg_file_settings
51.8. pg_group
51.9. pg_hba_file_rules
51.10. pg_ident_file_mappings
51.11. pg_indexes
51.12. pg_locks
51.13. pg_matviews
51.14. pg_policies
51.15. pg_prepared_statements
51.16. pg_prepared_xacts
51.17. pg_publication_tables
51.18. pg_replication_origin_status
51.19. pg_replication_slots
51.20. pg_roles
51.21. pg_rules
51.22. pg_seclabels
51.23. pg_sequences
51.24. pg_settings
51.25. pg_shadow
51.26. pg_shmem_allocations
51.27. pg_stats
51.28. pg_stats_ext
51.29. pg_stats_ext_exprs
51.30. pg_tables
51.31. pg_timezone_abbrevs
51.32. pg_timezone_names
51.33. pg_user
51.34. pg_user_mappings
51.35. pg_views
52. Frontend/Backend Protocol
52.1. Overview
52.2. Message Flow
52.3. SASL Authentication
52.4. Streaming Replication Protocol
52.5. Logical Streaming Replication Protocol
52.6. Message Data Types
52.7. Message Formats
52.8. Error and Notice Message Fields
52.9. Logical Replication Message Formats
52.10. Summary of Changes since Protocol 2.0
53. PostgreSQL Coding Conventions
53.1. Formatting
53.2. Reporting Errors Within the Server
53.3. Error Message Style Guide
53.4. Miscellaneous Coding Conventions
54. Native Language Support
54.1. For the Translator
54.2. For the Programmer
55. Writing a Procedural Language Handler
56. Writing a Foreign Data Wrapper
56.1. Foreign Data Wrapper Functions
56.2. Foreign Data Wrapper Callback Routines
56.3. Foreign Data Wrapper Helper Functions
56.4. Foreign Data Wrapper Query Planning
56.5. Row Locking in Foreign Data Wrappers
57. Writing a Table Sampling Method
57.1. Sampling Method Support Functions
58. Writing a Custom Scan Provider
58.1. Creating Custom Scan Paths
58.2. Creating Custom Scan Plans
58.3. Executing Custom Scans
59. Genetic Query Optimizer
59.1. Query Handling as a Complex Optimization Problem
59.2. Genetic Algorithms
59.3. Genetic Query Optimization (GEQO) in PostgreSQL
59.4. Further Reading
60. Table Access Method Interface Definition
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. Custom WAL Resource Managers
64. B-Tree Indexes
64.1. Introduction
64.2. Behavior of B-Tree Operator Classes
64.3. B-Tree Support Functions
64.4. Implementation
65. GiST Indexes
65.1. Introduction
65.2. Built-in Operator Classes
65.3. Extensibility
65.4. Implementation
65.5. Examples
66. SP-GiST Indexes
66.1. Introduction
66.2. Built-in Operator Classes
66.3. Extensibility
66.4. Implementation
66.5. Examples
67. GIN Indexes
67.1. Introduction
67.2. Built-in Operator Classes
67.3. Extensibility
67.4. Implementation
67.5. GIN Tips and Tricks
67.6. Limitations
67.7. Examples
68. BRIN Indexes
68.1. Introduction
68.2. Built-in Operator Classes
68.3. Extensibility
69. Hash Indexes
69.1. Overview
69.2. Implementation
70. Database Physical Storage
70.1. Database File Layout
70.2. TOAST
70.3. Free Space Map
70.4. Visibility Map
70.5. The Initialization Fork
70.6. Database Page Layout
70.7. Heap-Only Tuples (HOT)
71. System Catalog Declarations and Initial Contents
71.1. System Catalog Declaration Rules
71.2. System Catalog Initial Data
71.3. BKI File Format
71.4. BKI Commands
71.5. Structure of the Bootstrap BKI File
71.6. BKI Example
72. How the Planner Uses Statistics
72.1. Row Estimation Examples
72.2. Multivariate Statistics Examples
72.3. Planner Statistics and Security
73. Backup Manifest Format
73.1. Backup Manifest Top-level Object
73.2. Backup Manifest File Object
73.3. Backup Manifest WAL Range Object