*** a/src/backend/libpq/hba.c --- b/src/backend/libpq/hba.c *************** *** 1657,1681 **** check_hba(hbaPort *port) --- 1657,1697 ---- if (hba->conntype == ctLocal) { if (!IS_AF_UNIX(port->raddr.addr.ss_family)) + { + ereport(NOTICE, (errmsg("Skipped %d pg_hba line, because of host connection type.", + hba->linenumber))); continue; + } } else { if (IS_AF_UNIX(port->raddr.addr.ss_family)) + { + ereport(NOTICE, (errmsg("Skipped %d pg_hba line, because of local connection type.", + hba->linenumber))); continue; + } /* Check SSL state */ if (port->ssl_in_use) { /* Connection is SSL, match both "host" and "hostssl" */ if (hba->conntype == ctHostNoSSL) + { + ereport(NOTICE, (errmsg("Skipped %d pg_hba line, because of SSL connection.", + hba->linenumber))); continue; + } } else { /* Connection is not SSL, match both "host" and "hostnossl" */ if (hba->conntype == ctHostSSL) + { + ereport(NOTICE, (errmsg("Skipped %d pg_hba line, because of not SSL connection.", + hba->linenumber))); continue; + } } /* Check IP address */ *************** *** 1686,1699 **** check_hba(hbaPort *port) --- 1702,1723 ---- { if (!check_hostname(port, hba->hostname)) + { + ereport(NOTICE, (errmsg("Skipped %d pg_hba line, because of non matching hostname.", + hba->linenumber))); continue; + } } else { if (!check_ip(&port->raddr, (struct sockaddr *) & hba->addr, (struct sockaddr *) & hba->mask)) + { + ereport(NOTICE, (errmsg("Skipped %d pg_hba line, because of non matching IP.", + hba->linenumber))); continue; + } } break; case ipCmpAll: *************** *** 1702,1708 **** check_hba(hbaPort *port) --- 1726,1736 ---- case ipCmpSameNet: if (!check_same_host_or_net(&port->raddr, hba->ip_cmp_method)) + { + ereport(NOTICE, (errmsg("Skipped %d pg_hba line, because of non matching samenet/samehost.", + hba->linenumber))); continue; + } break; default: /* shouldn't get here, but deem it no-match if so */ *************** *** 1713,1722 **** check_hba(hbaPort *port) --- 1741,1758 ---- /* Check database and role */ if (!check_db(port->database_name, port->user_name, roleid, hba->databases)) + { + ereport(NOTICE, (errmsg("Skipped %d pg_hba line, because of non matching database.", + hba->linenumber))); continue; + } if (!check_role(port->user_name, roleid, hba->roles)) + { + ereport(NOTICE, (errmsg("Skipped %d pg_hba line, because of non matching role.", + hba->linenumber))); continue; + } /* Found a record that matched! */ port->hba = hba;