{"id":10293,"date":"2017-06-30T15:12:20","date_gmt":"2017-06-30T13:12:20","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/"},"modified":"2017-06-30T15:12:20","modified_gmt":"2017-06-30T13:12:20","slug":"postgresql-10-beta-1-pg_hba_file_rules-view","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/","title":{"rendered":"PostgreSQL 10 Beta 1 : pg_hba_file_rules view"},"content":{"rendered":"<p>This short blog to share a helpful stuff with the pg_hba.conf file :<\/p>\n<p>The pg_hba.conf file is the central configuration file to control client authentication.<br \/>\nIt is located in the database cluster&#8217;s data directory :<br \/>\n<code>postgres@ppas01:\/u02\/pgdata\/PG10BETA1\/ [PG10BETA1] ll pg_hba.conf<br \/>\nlrwxrwxrwx. 1 postgres postgres 59 Jun 30 10:19 pg_hba.conf<br \/>\npostgres@ppas01:\/u02\/pgdata\/PG10BETA1\/ [PG10BETA1]<br \/>\n<\/code><\/p>\n<p>When you add or modify an entry in this file, you have to reload the cluster to take the changes in account :<br \/>\n<code><br \/>\npostgres@ppas01:\/u02\/pgdata\/PG10BETA1\/ [PG10BETA1] echo \"host   all   efm   192.168.22.38\/35   md5\" &gt;&gt; \/u02\/pgdata\/PG10BETA1\/pg_hba.conf<br \/>\npostgres@ppas01:\/u02\/pgdata\/PG10BETA1\/ [PG10BETA1]<br \/>\npostgres@ppas01:\/u02\/pgdata\/PG10BETA1\/ [PG10BETA1] pg_ctl -D \"\/u02\/pgdata\/PG10BETA1\/\" reload<br \/>\nserver signaled<br \/>\npostgres@ppas01:\/u02\/pgdata\/PG10BETA1\/ [PG10BETA1]<br \/>\n<\/code><\/p>\n<p>Oops&#8230; Have you seen my mistake ? Probably not. The system didn&#8217;t see it either.<br \/>\nThat was in Postgres 9.6 and older versions.<\/p>\n<p>In Postgres 10 there is now a new view called &#8220;pg_hba_file_rules&#8221; which will returns the current content of the pg_hba.conf file entries AND reports the errors :<br \/>\n<code>postgres=# select version();<br \/>\n                                                            version<br \/>\n-------------------------------------------------------------------------------------------------------------------------------<br \/>\n PostgreSQL <span style=\"color: orange\">10beta1<\/span> dbi services build on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11), 64-bit<br \/>\n(1 row)<br \/>\n<br \/>\npostgres=# select line_number, error, type, database, user_name, address, netmask from <span style=\"color: orange\">pg_hba_file_rules<\/span>;<br \/>\n line_number |                      error                      | type  |   database    | user_name |  address  |                 netmask<br \/>\n-------------+-------------------------------------------------+-------+---------------+-----------+-----------+-----------------------------------------<br \/>\n          80 |                                                 | local | {all}         | {all}     |           |<br \/>\n          82 |                                                 | host  | {all}         | {all}     | 127.0.0.1 | 255.255.255.255<br \/>\n          84 |                                                 | host  | {all}         | {all}     | ::1       | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff<br \/>\n          87 |                                                 | local | {replication} | {all}     |           |<br \/>\n          88 |                                                 | host  | {replication} | {all}     | 127.0.0.1 | 255.255.255.255<br \/>\n          89 |                                                 | host  | {replication} | {all}     | ::1       | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff<br \/>\n          90 | <span style=\"color: orange\">invalid CIDR mask in address \"192.168.22.38\/35\"<\/span> |       |               |           |           |<br \/>\n(7 rows)<br \/>\n<\/code><\/p>\n<p>This will allows you to get a quick look at what is wrong in pg_hba.conf and fixing it as necessary.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This short blog to share a helpful stuff with the pg_hba.conf file : The pg_hba.conf file is the central configuration file to control client authentication. It is located in the database cluster&#8217;s data directory : postgres@ppas01:\/u02\/pgdata\/PG10BETA1\/ [PG10BETA1] ll pg_hba.conf lrwxrwxrwx. 1 postgres postgres 59 Jun 30 10:19 pg_hba.conf postgres@ppas01:\/u02\/pgdata\/PG10BETA1\/ [PG10BETA1] When you add or modify [&hellip;]<\/p>\n","protected":false},"author":30,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229,198],"tags":[1127,1128,1129,570,1108],"type_dbi":[],"class_list":["post-10293","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","category-database-management","tag-beta","tag-pg_hba","tag-pg_hba_file_rules","tag-postgres","tag-postgresql-10"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>PostgreSQL 10 Beta 1 : pg_hba_file_rules view - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PostgreSQL 10 Beta 1 : pg_hba_file_rules view\" \/>\n<meta property=\"og:description\" content=\"This short blog to share a helpful stuff with the pg_hba.conf file : The pg_hba.conf file is the central configuration file to control client authentication. It is located in the database cluster&#8217;s data directory : postgres@ppas01:\/u02\/pgdata\/PG10BETA1\/ [PG10BETA1] ll pg_hba.conf lrwxrwxrwx. 1 postgres postgres 59 Jun 30 10:19 pg_hba.conf postgres@ppas01:\/u02\/pgdata\/PG10BETA1\/ [PG10BETA1] When you add or modify [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-06-30T13:12:20+00:00\" \/>\n<meta name=\"author\" content=\"Jo\u00ebl Cattin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jo\u00ebl Cattin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/\"},\"author\":{\"name\":\"Jo\u00ebl Cattin\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/2c774f00321ee734515f0c2f6a96b780\"},\"headline\":\"PostgreSQL 10 Beta 1 : pg_hba_file_rules view\",\"datePublished\":\"2017-06-30T13:12:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/\"},\"wordCount\":141,\"commentCount\":0,\"keywords\":[\"beta\",\"pg_hba\",\"pg_hba_file_rules\",\"postgres\",\"PostgreSQL 10\"],\"articleSection\":[\"Database Administration &amp; Monitoring\",\"Database management\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/\",\"name\":\"PostgreSQL 10 Beta 1 : pg_hba_file_rules view - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2017-06-30T13:12:20+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/2c774f00321ee734515f0c2f6a96b780\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PostgreSQL 10 Beta 1 : pg_hba_file_rules view\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/2c774f00321ee734515f0c2f6a96b780\",\"name\":\"Jo\u00ebl Cattin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/a4271811924694263d4de5a469f8bd4a90b14d3d90e6ad819b9e2e5ac035a2dc?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a4271811924694263d4de5a469f8bd4a90b14d3d90e6ad819b9e2e5ac035a2dc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a4271811924694263d4de5a469f8bd4a90b14d3d90e6ad819b9e2e5ac035a2dc?s=96&d=mm&r=g\",\"caption\":\"Jo\u00ebl Cattin\"},\"description\":\"Jo\u00ebl Cattin has more than three years of experience in databases management. He is specialized in Oracle solutions such as Data Guard and RMAN and has a good background knowledge of Oracle Database Appliance (ODA), Real Application Cluster (RAC) and applications development on APEX. Jo\u00ebl Cattin\u2019s experience includes other RDBMS, such as PostgreSQL and MySQL. He is Oracle Database 12c Administrator Certified Professional, EDB Postgres Advanced Server 9.5 Certified Professional, RedHat Certified System Administrator and ITILv3 Foundation for Service Management Certified. Jo\u00ebl Cattin holds a degree from the \u00c9cole Sup\u00e9rieure d\u2019Informatique de Gestion (ESIG) in Del\u00e9mont and a Federal Certificate of Proficiency in Computer Science (Certificat f\u00e9d\u00e9ral de Capacit\u00e9 \u2013 CFC).\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/joel-cattin\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"PostgreSQL 10 Beta 1 : pg_hba_file_rules view - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/","og_locale":"en_US","og_type":"article","og_title":"PostgreSQL 10 Beta 1 : pg_hba_file_rules view","og_description":"This short blog to share a helpful stuff with the pg_hba.conf file : The pg_hba.conf file is the central configuration file to control client authentication. It is located in the database cluster&#8217;s data directory : postgres@ppas01:\/u02\/pgdata\/PG10BETA1\/ [PG10BETA1] ll pg_hba.conf lrwxrwxrwx. 1 postgres postgres 59 Jun 30 10:19 pg_hba.conf postgres@ppas01:\/u02\/pgdata\/PG10BETA1\/ [PG10BETA1] When you add or modify [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/","og_site_name":"dbi Blog","article_published_time":"2017-06-30T13:12:20+00:00","author":"Jo\u00ebl Cattin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jo\u00ebl Cattin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/"},"author":{"name":"Jo\u00ebl Cattin","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/2c774f00321ee734515f0c2f6a96b780"},"headline":"PostgreSQL 10 Beta 1 : pg_hba_file_rules view","datePublished":"2017-06-30T13:12:20+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/"},"wordCount":141,"commentCount":0,"keywords":["beta","pg_hba","pg_hba_file_rules","postgres","PostgreSQL 10"],"articleSection":["Database Administration &amp; Monitoring","Database management"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/","url":"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/","name":"PostgreSQL 10 Beta 1 : pg_hba_file_rules view - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2017-06-30T13:12:20+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/2c774f00321ee734515f0c2f6a96b780"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/postgresql-10-beta-1-pg_hba_file_rules-view\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"PostgreSQL 10 Beta 1 : pg_hba_file_rules view"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/2c774f00321ee734515f0c2f6a96b780","name":"Jo\u00ebl Cattin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a4271811924694263d4de5a469f8bd4a90b14d3d90e6ad819b9e2e5ac035a2dc?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a4271811924694263d4de5a469f8bd4a90b14d3d90e6ad819b9e2e5ac035a2dc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a4271811924694263d4de5a469f8bd4a90b14d3d90e6ad819b9e2e5ac035a2dc?s=96&d=mm&r=g","caption":"Jo\u00ebl Cattin"},"description":"Jo\u00ebl Cattin has more than three years of experience in databases management. He is specialized in Oracle solutions such as Data Guard and RMAN and has a good background knowledge of Oracle Database Appliance (ODA), Real Application Cluster (RAC) and applications development on APEX. Jo\u00ebl Cattin\u2019s experience includes other RDBMS, such as PostgreSQL and MySQL. He is Oracle Database 12c Administrator Certified Professional, EDB Postgres Advanced Server 9.5 Certified Professional, RedHat Certified System Administrator and ITILv3 Foundation for Service Management Certified. Jo\u00ebl Cattin holds a degree from the \u00c9cole Sup\u00e9rieure d\u2019Informatique de Gestion (ESIG) in Del\u00e9mont and a Federal Certificate of Proficiency in Computer Science (Certificat f\u00e9d\u00e9ral de Capacit\u00e9 \u2013 CFC).","url":"https:\/\/www.dbi-services.com\/blog\/author\/joel-cattin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/10293","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=10293"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/10293\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=10293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=10293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=10293"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=10293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}