3 Architecture
PDF page 16
3.1.1 Modified System catalogs
The following catalogs have been changed.
| View name | Description |
|---|---|
| pg_ident_file_mappings | Provides a summary of the contents of the client user name mapping configuration file. |
| pg_parameter_acl | Provides ACL information that allows the execution of the ALTER SYSTEM SET statement. |
| pg_publication_namespace | Stores the mapping between the schema and the PUBLICATION. |
| pg_stat_recovery_prefetch | Provides prefetch status during recovery. |
| pg_stat_subscription_stats | Stores initial data synchronization failure information that is performed when the subscription is created. |
| View name | Added column | Data type | Description |
|---|---|---|---|
| pg_collation | colliculocale | text | ICU Collation name |
| pg_constraint | confdelsetcols | smallint[] | Column with ON DELETE clause for foreign key |
| pg_database | daticulocale | text | ICU Locale name |
| datlocprovider | char | ICU Collation Provider name | |
| datcollversion | boolean | Collation version | |
| pg_index | indnullsnotdistinct | boolean | Indicates the nullable setting of the unique index |
| pg_publication_rel | Prqual | pg_node_tree | Tuple conditions for replication |
| prattrs | int2vector | Column number to replicate | |
| pg_statistic_ext_data | stxdinherit | boolean | If true, the stats include inheritance child columns |
| pg_stats_ext | inherited | boolean | If true, the stats include inheritance child columns |
| pg_stats_ext_exprs | inherited | boolean | If true, the stats include inheritance child columns |
| pg_subscription | subskiplsn | pg_lsn | Skipped LSN |
| subtwophasestate | char | Indicates the state of Two-Phase mode | |
| subdisableonerr | boolean | Disable subscription on error occurs | |
| information_schema.table_constraints | nulls_distinct | information s _ chema.yes_or_no | Indicates the nullable setting of the unique index |
PDF page 17
| Catalog name | Column name | Description |
|---|---|---|
| pg_database | datlastsysoid | Removed because not used |
| View name | Description |
|---|---|
| pg_type | Added ‘Z’ to the typcategory column to indicate internal use. |
| pg_collation | The data type of collcollate and collctype columns has changed from ’name’ to ’text’. |
| pg_database | The data type of the datcollate and datctype columns has changed from ’name’ to ’text'. |
| pg_backend_memory_c | Information on the memory area for statistical data (PgStat *) is now |
| ontexts | output. |
| pg_shmem_allocations | Added Shared Memory Stats, XLOG Recovery Ctl, and XLogPrefetchStats tuples. |
Among the modified system catalogs, the details of the major catalogs are described below.
Pg_ident_file_mappings catalog
This is a view for searching the contents of the pg_ident.conf file from SQL statements.
PDF page 18
| Column name | Data type | Description |
|---|---|---|
| line_number | integer | Line number in the pg_ident.conf file |
| map_name | text | Map name |
| sys_name | text | System name |
| pg_username | text | PostgreSQL user name |
| error | text | Error message |
Pg_parameter_acl catalog
The catalog records configuration parameters for which privileges have been granted to one or more roles.
| Column name | Data type | Description |
|---|---|---|
| oid | oid | Object ID |
| parname | text | The parameter name to allow change |
| paracl | aclitem[] | Role information to allow changes |
Pg_publication_namespace
Information is stored when the FOR TABLE IN SCHEMA clause is specified in the CREATE PUBLICATION statement. Provides a mapping between PUBLICATION and SCHEMA.
| Column name | Data type | Description |
|---|---|---|
| oid | oid | Row identifier |
| pnpubid | oid | Reference to PUBLICATION |
| pnnspid | oid | Reference to SCHEMA |
PDF page 19
Pg_stat_recovery_prefetch view
Provides prefetched block statistics during recovery. It is also possible to check the status of replication processing in the standby instance of the streaming replication environment.
| Column name | Data type | Description |
|---|---|---|
| stats_reset | timestamp with time zone | Date time when the view was reset |
| prefetch | bigint | Number of blocks prefetched because they were not in the buffer pool |
| hit | bigint | Number of blocks not prefetched because they were already in the buffer pool |
| skip_init | bigint | Number of blocks not prefetched because they would be zeroinitialized |
| skip_new | bigint | Number of blocks not prefetched because they didn’t exist yet |
| skip_fpw | bigint | Number of blocks not prefetched because a full-page image was included in the WAL |
| skip_rep | bigint | Number of blocks not prefetched because they were already recently prefetched |
| wal_distance | integer | How many bytes ahead the prefetcher is looking |
| block_distance | integer | How many blocks ahead the prefetcher is looking |
| io_depth | integer | How many prefetches have been initiated but are not yet known to have been completed |
Pg_stat_subscription_stats view
The pg_stat_subscription_stats view contains error information about logical replication subscription workers.
PDF page 20
| Column name | Data type | Description |
|---|---|---|
| subid | oid | OID of the subscription |
| subname | name | Name of the subscription |
| apply_error_count | bigint | Number of times an error occurred while applying changes |
| sync_error_count | bigint | Number of times an error occurred during the initial table synchronization |
| stats_reset | timestamp with time zone | Time at which these statistics were last reset |
Reference to memory related view
The pg_backend_memory_contexts view and pg_shmem_allocations view can now be referenced not only by users with the SUPERUSER attribute but also by users belonging to the pg_read_all_stats role.
PDF page 21
3.1.2 Logical Replication Enhancements
The following features have been added to Logical Replication.
Column-specific replication
It is now possible to replicate only specific columns in a table. Specify a column list for the table name in the CREATE PUBLICATION or ALTER PUBLICATION statement. The target column number is stored in the prattrs column of the pg_publication_rel catalog.
Row filtered replication
By specifying the WHERE clause in the CREATE PUBLICATION statement or the ALTER
PDF page 22
PUBLICATION statement, the tuples in the table can be limited and replicated. Replication conditions are specified for each table. The WHERE clause description must be enclosed in parentheses.
PDF page 23
The conditions specified in the WHERE clause are converted and stored in the prqual column of the pg_publication_rel catalog. The psql command can be checked with the \d command or the \dRp+ command.
Specify all tables in the schema
The syntax is now available to register all tables in a particular schema with a PUBLICATION object. Specify the FOR TABLES IN SCHEMA clause and schema name in the CREATE PUBLICATION statement (or ALTER PUBLICATION statement). This syntax can only be executed by users with the SUPERUSER attribute. In the case of the FOR ALL TABLE clause that was available in the past, tables of all schemas were registered. Syntax
PDF page 24
Skip LSN
It is now possible to specify the SKIP clause in the ALTER SUBSCRIPTION statement. Specify LSN in the SKIP clause. Execution of this statement allows the SUBSCRIPTION side of logical replication to skip transactions that caused synchronization errors. Syntax
The skipped LSN can be obtained in the subskiplsn column of the pg_subscription catalog. The psql command added a Skip LSN entry to the output of the \dRs + command.
PDF page 25
Disable SUBSCRIPTION when an error occurs
The option disable_on_error can now be specified to disable SUBSCRIPTION if a replication error occurs. The default is false and no disabling is performed. The column subdisableonerr has been added to the pg_subscription catalog to indicate this option value.
TWO_PHASE option
The replication protocol command CREATE_REPILICATION_SLOT has been expanded and the TWO_PHASE option has been added. This makes it possible to decode PREPARE TRANSACTION, COMMIT PREPARED, ROLLBACK PREPARED, etc.
3.1.3 Parallel Query Enhancements
The SELECT DISTINCT statement can now work with parallel queries.
PDF page 26
3.1.4 WAL compression
It is now possible to specify LZ4 and Zstandard as the compression method for the full-page image output to WAL. Change the parameter wal_compression to perform WAL compression. The setting value on, which is the conventional compression method, is an alias for the setting value pglz. The default value remains off without any change.
3.1.5 Archive Library
It is now possible to use a shared library in addition to the traditional command (archive_command parameter) as a way to create an archive of WAL files. The archive_library parameter has been added to specify the archive library name. If archive_library is not set, the archive_command parameter can still be used. The Contrib module basic_archive has been added as a standard archive library. This Contrib module does not require the execution of the CREATE EXTENSION statement. The basic_archive.archive_directory parameter can be specified as the archive destination directory.
PDF page 27
3.1.6 Global Locale Provider
It is now possible to specify an ICU as the global locale provider. Allows ICU to be used as the default locale provider for the entire database cluster or database. You must use a binary compiled with the –with-icu option to use this feature. The –locale-provider option that specifies the locale provider name can be specified for the initdb command and createdb command. Specify libc or icu for this option. The –icu-locale option allows you to specify the ICU locale name.
PDF page 28
PDF page 29
3.1.7 Statistics Information
In previous versions, the stats collector process received UDP protocol packets and periodically wrote them to temporary files. PostgreSQL 15 now stores statistics in shared memory. Information on the shared memory area for statistics can be obtained by searching the pg_shmem_allocations view and pg_backend_memory_contexts view. The stats collector process has been deprecated as a result of this specification change.
PDF page 30
3.1.8 GiST Index
The following enhancements have been implemented to the GiST index:
Index statistics
Access to the SP-GiST index is now counted in the pg_stat_ * views.
BOOL type
It is now possible to create an index for a Boolean type.
3.1.9 Wait Events
The following wait events have been added.
| Wait Event name | Type | Description |
|---|---|---|
| ArchiveCleanupCommand | IPC | Waiting for the archive_cleanup_command command to complete |
| ArchiveCommand | IPC | Waiting for the archive_command command to complete |
| BaseBackupSync | IO | Waiting for storage synchronization of base backup |
| BaseBackupWrite | IO | Waiting for base backup write |
| RecoveryEndCommand | IPC | Waiting for the recovery_end_command command to complete |
| RestoreCommand | IPC | Waiting for the restore_command command to complete |
| VersionFileWrite | IO | Waiting for the version file to be written while creating a database. |
| VacuumTruncate | Timeout | Waiting to acquire an exclusive lock to truncate off any empty pages |
PDF page 31
The wait events PgStatMain, LogicalChangesRead, LogicalChangesWrite, LogicalSubxactRead, and LogicalSubxactWrite have been removed.
3.1.10 Role
The predefined role pg_checkpoint has been added. This role holder can execute the CHECKPOINT statement.
3.1.11 Libpq
The following enhancements have been implemented in the Libpq API:
Environment variable PG_COLORS
It is now possible to specify ’note’ in the color specification item of the terminal output.
PQsslAttribute
The PQsslAttribute(NULL, “library”) function can now be executed to obtain the name of the library in use.
PDF page 32
PQcancel
The connection string tcp_user_timeout and keepalives are now available for executing the PQcancel API.
Allow root-owned SSL private keys in libpq
Libpq applies the same private key file ownership and permission checks as used on the backend. The private key can be owned by either the current user or the root
3.1.12 Custom WAL resource manager
The custom WAL resource managers can now be registered for the shared_preload_libraries parameter. The pg_get_wal_resource_managers function has been added to check the current WAL resource managers.
3.1.13 Hook
The following hooks have been added.
String object access
Added an access hook for string objects. Executed when accessing the GUC string.
PDF page 33
Shared memory request
It must be specified from within the _PG_init function when the extension module gets the shared memory.
Object access hook
Execution of the ALTER TABLE SET {LOGGED, UNLOGGED, ACCESS METHOD} statement now executes an object access hook.
3.1.14 Custom scan providers
The custom scan providers can now choose to support projection. In previous versions, all custom scan providers needed projection support. Control is performed by the CUSTOMPATH_SUPPORT_PROJECTION macro.
3.1.15 Build target
The target name of Makefile to be specified when building from source code has been added. The following targets do not build or install documentation.
world-bin
install-world-bin
PDF page 34
This specification will also be backported to older versions.
3.1.16 Dynamic Shared Memory
Dynamic Shared Memory (DSM) is now also available in single user mode.