{"id":2581,"date":"2023-10-01T14:59:48","date_gmt":"2023-10-01T14:59:48","guid":{"rendered":"https:\/\/osdbtechnologies.com\/?p=2581"},"modified":"2023-10-01T14:59:48","modified_gmt":"2023-10-01T14:59:48","slug":"a-glimpse-into-the-future-series-of-whats-new-in-postgresql16","status":"publish","type":"post","link":"https:\/\/divaind.com\/ie1\/2023\/10\/01\/a-glimpse-into-the-future-series-of-whats-new-in-postgresql16\/","title":{"rendered":"A Glimpse into the Future: Series of What&#8217;s New in PostgreSQL16 ?"},"content":{"rendered":"<h1 data-renderer-start-pos=\"1\">A Glimpse into the Future: Series of What&#8217;s New in PostgreSQL16 ?<\/h1>\n<p data-renderer-start-pos=\"1\">On <a href=\"https:\/\/www.postgresql.org\/about\/news\/postgresql-16-released-2715\/\">September 14, 2023<\/a>, the PostgreSQL Global Development Group introduced PostgreSQL16, marking the latest release of the renowned open-source database. This version brings significant enhancements in performance, particularly in query parallelism, bulk data loading, and logical replication, including expanded SQL\/JSON syntax, additional monitoring statistics for workloads, and heightened flexibility in setting access control rules for policy management across large deployments. <a class=\"css-tgpl01\" title=\"https:\/\/www.postgresql.org\/about\/news\/postgresql-16-released-2715\/\" href=\"https:\/\/www.postgresql.org\/about\/news\/postgresql-16-released-2715\/\" data-testid=\"link-with-safety\" data-renderer-mark=\"true\">click here<\/a> for more details on the new release of PostgreSQL16 and the feature matrix of postgresql16 <a class=\"css-tgpl01\" title=\"https:\/\/www.postgresql.org\/about\/featurematrix\/\" href=\"https:\/\/www.postgresql.org\/about\/featurematrix\/\" data-testid=\"link-with-safety\" data-renderer-mark=\"true\">click here<\/a>.<\/p>\n<h2 id=\"What's-New-in-PostgreSQl16\" data-renderer-start-pos=\"597\">What&#8217;s New in PostgreSQl16<\/h2>\n<ol class=\"ak-ol\" start=\"1\" data-indent-level=\"1\">\n<li>\n<p data-renderer-start-pos=\"627\">Logical Replication Enhancements<\/p>\n<\/li>\n<li>\n<p data-renderer-start-pos=\"663\">Performance Improvements<\/p>\n<\/li>\n<li>\n<p data-renderer-start-pos=\"691\">I\/O Statistics Monitoring <code class=\"code css-z5oxh7\" data-renderer-mark=\"true\">pg_stat_io<\/code><\/p>\n<\/li>\n<li>\n<p data-renderer-start-pos=\"731\">Authentication and Privileges Changes<\/p>\n<\/li>\n<li>\n<p data-renderer-start-pos=\"772\">Parallelization of Joins<\/p>\n<\/li>\n<li>\n<p data-renderer-start-pos=\"800\">SQL\/JSON Features<\/p>\n<\/li>\n<li>\n<p data-renderer-start-pos=\"821\">Data Type and Functionality Additions<\/p>\n<\/li>\n<li>\n<p data-renderer-start-pos=\"862\">Libpq Enhancements<\/p>\n<\/li>\n<\/ol>\n<h3 id=\"Logical-Replication\" data-renderer-start-pos=\"884\">Logical Replication<\/h3>\n<p data-renderer-start-pos=\"905\">In this series covering the new features of postgresql16, we will be addressing refinements made to Logical Replication.<\/p>\n<ul>\n<li>Logical replication publishers can be created from standby instances. user can also set a Logical replica from the read-only Physical standby this required <code class=\"code css-z5oxh7\" data-renderer-mark=\"true\">wal_level = logical<\/code> on both primary and standby.<img loading=\"lazy\" decoding=\"async\" class=\" wp-image-2584 aligncenter\" src=\"https:\/\/divaind.com\/ie1\/wp-content\/uploads\/2023\/10\/0eebf801-7598-4573-aed8-878ae0f5142d-300x98.png\" alt=\"\" width=\"471\" height=\"154\" srcset=\"https:\/\/divaind.com\/ie1\/wp-content\/uploads\/2023\/10\/0eebf801-7598-4573-aed8-878ae0f5142d-300x98.png 300w, https:\/\/divaind.com\/ie1\/wp-content\/uploads\/2023\/10\/0eebf801-7598-4573-aed8-878ae0f5142d.png 736w\" sizes=\"auto, (max-width: 471px) 100vw, 471px\" \/>PostgreSQL 16 introduced a new parameter<strong data-renderer-mark=\"true\">, <\/strong><code class=\"code css-z5oxh7\" data-renderer-mark=\"true\">origin<\/code>for the <code class=\"code css-z5oxh7\" data-renderer-mark=\"true\">CREATE SUBSCRIPTION<\/code> command. This parameter controls whether the subscription will only receive changes that do not have an associated origin, or whether it will receive all changes, regardless of origin.<\/li>\n<\/ul>\n<h4>In other words,<\/h4>\n<p style=\"padding-left: 40px;\">the <code class=\"code css-z5oxh7\" data-renderer-mark=\"true\">origin<\/code> parameter specifies how selective the subscription is about the changes it receives. A value <code class=\"code css-z5oxh7\" data-renderer-mark=\"true\">origin = NONE<\/code> means that the subscription will receive all changes, regardless of origin. A value of <code class=\"code css-z5oxh7\" data-renderer-mark=\"true\">origin = ANY<\/code> means that the subscription will only receive changes that do not have an associated origin.<\/p>\n<p>Let&#8217;s take an example, NODE1 is primary and NODE2 is logical standby, if there are two other standbys for NODE2 &#8211; NODE3, NODE4.<br \/>\nNODE3 has the origin value ANY, so it will apply all changes in WAL logs it received from NODE2 which can have changes of NODE1, and\u00a0 NODE2.<br \/>\nNODE4 has an origin value of NONE, so it applies only to changes that are generated on the NODE2.<\/p>\n<p>Standard SQL<\/p>\n<pre class=\"lang:default decode:true \">CREATE PUBLICATION pub1 FOR ALL TABLES; \nCREATE SUBSCRIPTION sub1 CONNECTION 'conninfo' PUBLICATION pub1 WITH (origin = none);<\/pre>\n<h4>Example:-<\/h4>\n<pre class=\"lang:default decode:true \">-bash-4.2$ psql -p 5432 -d test_pg_11 \npsql (16.0, server 11.21) \nType \"help\" for help.\n\ntest_pg_11=# CREATE PUBLICATION pub1 FOR ALL TABLES; \nCREATE PUBLICATION \n\n-bash-4.2$ psql -p 5440 -d test_pg_16 \npsql (16.0) \nType \"help\" for help. \n\ntest_pg_16=# CREATE SUBSCRIPTION sub1 CONNECTION 'port=5432 user=postgres dbname=test_pg_11' PUBLICATION pub1 WITH (origin = none); \nNOTICE: created replication slot \"sub1\" on publisher \nCREATE SUBSCRIPTION<\/pre>\n<ul>\n<li data-renderer-start-pos=\"2794\">Initial table synchronization in binary format<br \/>\nThis option specifies whether the subscription requests data in binary format from the publisher (default is false). The binary format can be faster but less portable. It&#8217;s important to note that only data types with binary send and receive functions will be transferred in binary.<\/li>\n<\/ul>\n<pre class=\"lang:pgsql decode:true \">CREATE SUBSCRIPTION sub1 CONNECTION 'conninfo' PUBLICATION pub1 WITH (binary = true);<\/pre>\n<h4>Example:-<\/h4>\n<pre class=\"lang:pgsql decode:true \">test_pg_16=# CREATE SUBSCRIPTION sub1 CONNECTION 'port=5432 user=postgres dbname=test_pg_11' PUBLICATION pub1 WITH (binary = true);\nNOTICE: created replication slot \"sub1\" on publisher\nCREATE SUBSCRIPTION<\/pre>\n<ul>\n<li data-renderer-start-pos=\"2794\">Now a logical replication subscriber can use indexes other than the <code class=\"code css-z5oxh7\" data-renderer-mark=\"true\">PRIMARY KEY<\/code> to perform lookups during <code class=\"code css-z5oxh7\" data-renderer-mark=\"true\">UPDATE<\/code> or <code class=\"code css-z5oxh7\" data-renderer-mark=\"true\">DELETE<\/code> operations, Employing REPLICA IDENTITY FULL on the publisher may result in a comprehensive table scan for each tuple alteration on the subscriber, especially in cases where REPLICA IDENTITY or a primary key index is absent.<\/li>\n<li data-renderer-start-pos=\"2794\">Subscribers can now apply large transactions using parallel workers<\/li>\n<\/ul>\n<p>This setting <code class=\"code css-z5oxh7\" data-renderer-mark=\"true\">streaming<\/code> controls how transactions are sent to subscribers. The value &#8220;on&#8221; stores changes temporary files, applying them after the transaction is committed. &#8220;Parallel&#8221; applies changes directly, using parallel workers if available, otherwise, they&#8217;re stored temporarily and applied after the transaction is committed. Note, that errors in parallel may not report the finish LSN in the server log.<\/p>\n<pre class=\"lang:pgsql decode:true \">CREATE SUBSCRIPTION sub1 CONNECTION 'conninfo' PUBLICATION pub1 WITH (streaming = parallel);<\/pre>\n<h4>Example:-<\/h4>\n<pre class=\"lang:pgsql decode:true \">test_pg_16=# CREATE SUBSCRIPTION sub1 CONNECTION 'port=5432 user=postgres dbname=test_pg_11' PUBLICATION pub1 WITH (streaming = parallel);\nNOTICE: created replication slot \"sub1\" on publisher\nCREATE SUBSCRIPTION<\/pre>\n<p>Having delved into the Logical Replication enhancements in PostgreSQL 16 thus far, our journey through its exciting new features continues. In the upcoming blog post, we will delve into Performance Improvements and I\/O Statistics Monitoring. Keep an eye out for further insights into the evolving landscape of PostgreSQL 16<\/p>\n<blockquote><p>For the latest feaures in postgresql 18 <a href=\"https:\/\/divaind.com\/ie1\/contact\/\">follow<\/a> our blog &#8220;<a href=\"https:\/\/divaind.com\/ie1\/new-features-added-in-postgresql-18\/\">New Features added in postgresql18<\/a>&#8220;.<\/p><\/blockquote>\n<div id=\"confluence-macro-resources-container\" style=\"display: none;\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>A Glimpse into the Future: Series of What&#8217;s New in PostgreSQL16 ? On September 14, 2023, the PostgreSQL Global Development Group introduced PostgreSQL16, marking the latest release of the renowned open-source database. This version brings significant enhancements in performance, particularly in query parallelism, bulk data loading, and logical replication, including expanded SQL\/JSON syntax, additional monitoring&hellip;<\/p>\n","protected":false},"author":1,"featured_media":2998,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[49,192,262,265,266,305],"class_list":["post-2581","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql","tag-postgresql16","tag-logical","tag-postgres","tag-postgres16","tag-postgresql","tag-replication","category-28","description-off"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/posts\/2581","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/comments?post=2581"}],"version-history":[{"count":0,"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/posts\/2581\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/media\/2998"}],"wp:attachment":[{"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/media?parent=2581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/categories?post=2581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/divaind.com\/ie1\/wp-json\/wp\/v2\/tags?post=2581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}