Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qhMln-002G7J-LK for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Sep 2023 04:18:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qhMlm-006DsD-7Y for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Sep 2023 04:18:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qhMll-006DrO-SQ for pgsql-hackers@lists.postgresql.org; Sat, 16 Sep 2023 04:18:57 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qhMle-004pix-0w for pgsql-hackers@lists.postgresql.org; Sat, 16 Sep 2023 04:18:56 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 4CEA8320083A; Sat, 16 Sep 2023 00:18:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 16 Sep 2023 00:18:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1694837927; x=1694924327; bh=fS yiGZUNoDKUIER9lQ2YU0eXb1T5oIp9Q+azuNc6Xk4=; b=P1EboPv2188eKfBQ6f wopLYomNcr26HsHb/3nskkupQo/8ztp8P2CAcohP0tgRLNkcHHnaprMZ89b0UI3/ H11KPy3oOp5zTqsmYSABK6pP1/MgYyl7m1eNW+3/k/IoKycr1uH10s402Dj0oubI B372L/k/w7iTSn+AZX396Q3jkH618KkmI8cOcZkWpnVLdhKXHGwFfzGp2u1QcRdv x8LRFLR/Du3+ziLwaPCyoPmJZfqjo8KMGZLEtWlC9CEsNii1ktgWUS21FPUEDu8B krCRKtVXtj9DkQelM/m9hOeyTgxTf4sUNJ2hKtiUEBPFMPV9IRDz+os21X9CbHAv pBsA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1694837927; x=1694924327; bh=fSyiGZUNoDKUI ER9lQ2YU0eXb1T5oIp9Q+azuNc6Xk4=; b=YPfZD/VXSFMXtBPLeHXJmu1tDEsv+ /gQXEyS8Kp2y5uVf3tqIifGIa6ScSXQE9vxCIj8AaCpB0CQIByWg1DzB/s5pYpmg nD4u3og5KHXDCc50BGXgJg3Yzoo/bI947CLcpClUuPpef00Ou4LLge8u/khNK+Hs KzsHk9KxomSJ2SLAFLaWGWXp4LJXSnX63Bh9h9b9A3J/myUkF3h8ypC2jUPSwfpE gFgZFQD1dGZpe85CEVrBipvHkBGDm+TcoNtQqStTP2n9Kv1OJAtD+4eSsMZb1Q1J /dGUmep4fI8wlu5fRPu2DXmweMxcDv39MmepXmiO5og6IBkgZ8yzZcYVA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejfedgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtdorredt tddunecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnheptdfhjeevtdeivdegveeludek udefjeehffejleejvefhgfdugffhgfeuheekhfetnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 16 Sep 2023 00:18:46 -0400 (EDT) Date: Sat, 16 Sep 2023 13:18:41 +0900 From: Michael Paquier To: Jim Jones Cc: PostgreSQL Hackers , David Zhang Subject: Re: [PATCH] Add inline comments to the pg_hba_file_rules view Message-ID: References: <4d623899-36ac-71b5-311d-2a4672d75736@uni-muenster.de> <381eb298-92b3-9599-abe6-f04c9a151248@uni-muenster.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9K8TSUV1CY+pIUF+" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --9K8TSUV1CY+pIUF+ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 15, 2023 at 09:37:23AM +0200, Jim Jones wrote: > SELECT type, database, user_name, address, c.comment > FROM=A0 pg_hba_file_rules h, pg_read_conf_comments(h.file_name) c > WHERE user_name[1]=3D'jim' AND h.line_number =3D c.line_number ; >=20 > =A0type | database | user_name |=A0 address=A0 | comment > ------+----------+-----------+-----------+--------- > =A0host | {db}=A0=A0=A0=A0 | {jim}=A0=A0=A0=A0 | 127.0.0.1 | foo > =A0host | {db}=A0=A0=A0=A0 | {jim}=A0=A0=A0=A0 | 127.0.0.1 | bar > =A0host | {db}=A0=A0=A0=A0 | {jim}=A0=A0=A0=A0 | 127.0.0.1 | #foo# > (3 rows) >=20 >=20 > Is it more or less what you had in mind? That was the idea. I forgot about strpos(), but if you do that, do we actually need a function in core to achieve that? There are a few fancy cases with the SQL function you have sent, actually.. strpos() would grep the first '#' character, ignoring quoted areas. -- Michael --9K8TSUV1CY+pIUF+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmUFLKEACgkQnvQgOdby QH1Vmg//VjBzT63OvxyAlSQwzQD/1eBv7/a3/71n2vu3YV9v0HnEh5dHUBdkb4kP /NTOGH2Erls7KpiVt4iiat7wXYLUa7YFbI4DKBcBoWBWrwwQBjlea3zEMQlC8J4t mmoXaj910FnE1Rhojw4ttRbVVMxbm/CkmDPYcpgFF5oE7P2TwVv796NA1mfQPbB+ 9YrKbuyyGQso4M3WyoYKzWLHFMXSSwpzhITAWoUvFu6vJvV+DOIqJ8JOvcfoqM+0 Cci4kktFfPr7vdaV6cORlMLtnxB404g+92dWHurzLqZHr0eQ4BgQJ7PtZFRE3PI5 O3vhFTdoEb4Okzllrd0Y/y5eaB7sPW+cRtANjSoLCvhNGeU741nIHqNIMD/wOo3G aHb5dCwieep0MoHeZoepND74kehpVZ5riA6s0yuvFpoZFo4JV9WK8/X7qaLW+hjn WPfop10+eyWSIG/ADomX3ex1Vp3m6zA8nnhsss/37dxE7NiOPSgAeThxgci/0wJ4 Hfw+zZQpIuOImWt+huw7hACnlfGa+QB3PG+Zw6c3nWjSdJobhum+ecNj/3w+vN/B hN0HHsndIn5OzO1KakrA9JeaweObENMVDucPYFSaIEQl6T+1mDffwE9SQG+sYYmC Q4Bte5Em8RgAxDA6snzHcLSnewBDk3eOzZj6+fXWh7d5EBEDuJk= =pt3Y -----END PGP SIGNATURE----- --9K8TSUV1CY+pIUF+--